Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Branch Trace Store on x64 Windows

Marcus_B_
Beginner
2,105 Views

I'm implementing BTS on x64 W7 and W8 as part of my academic research and I got a problem: I've set up everything (as far as I know) but I can't get being interrupted on BTS overflow. I have set up DS AREA and I can manually inspect the memory and check everything is fine ( BTS recorded until threshold). However, no interrupt is generated. I checked: APIC is set to edge and fixed, and its vector value is 254. I read IDTR and set IDT[254] to point my interrupt routine. BTINT is set on DEBUGCTL. Did I forget something ? Could anyone of you experienced with Windows implementation help me ? Besides, Are there any implementation piece available ? I found some on Linux, but none on Windows. Thanks in advance, Marcus

Edit: I left a question on Microsoft's Forums but they aren't sure about Intel's things.

0 Kudos
5 Replies
Marcus_B_
Beginner
2,105 Views
Well, since I asked such question I did a great effort on developing my implementation. Currently I developed a new device driver and handled PnP issues for registering a interrupt. However, I am still not sure about how to perform such registration. APIC LVT [254] is a windows used IRQ. I really don't know if I should pretend to have a message interrupt or any other approach. I'm sure you can help me since Intel Vtune makes use of such BTS capabilites on Windows. If I asked on a wrong forum section, please move to an appropriated one. Thanks in advance, Marcus
0 Kudos
Marcus_B_
Beginner
2,105 Views
My current doubt is how to register the correct IRQ. I can't set up 254 IRQ once it is already in use by the system. I can register another number, however I don't know how to redirect it. Any Ideia ?
0 Kudos
SHIH_K_Intel
Employee
2,105 Views

perhaps you can find similar situations in some open source porject to learn/practice the necessary programming mechanics dealing with setting up overflow interrupt caused by an buffer overflow condition. A proling tool project supporting sample-after mode of performance counter data gathering could provide the detail mechanics: buffer overflow -> counter overflow, BTINT in debugctl -> INT in the perfevtsel, etc..

 

0 Kudos
Marcus_B_
Beginner
2,105 Views
I checked linux implementation. I was able to handle interruptions both by using request_irq on a shared APIC entry, either by using NMI interruptions. However, I need that on Windows environment. I tried to register a shared IRQ but windows returns error 12 "This device cannot find enough free resources" I tried to change APIC to NMI and register a NMI callback, but nothing happens. Any ideias ?
0 Kudos
Marcus_B_
Beginner
2,105 Views
I finally registered my ISR routine, but I am not being interrupted. I am looking to see if my configuration is correct. I set DS MSR with the BTS structure, and I checked: addresses are correctly written. I set DEBUGCTL MSR with BTS, BTINT and LBR flags. Is is enough to generate the interruption ? Should I set something more, like MSR_PERF_GLOBAL MSR or other ? Thanks, Marcus
0 Kudos
Reply