andikleen / pmu-tools

Intel PMU profiling tools
GNU General Public License v2.0
1.97k stars 330 forks source link

two events monitoring in simple-pebs.c #462

Closed doru50 closed 1 year ago

doru50 commented 1 year ago

I use Intel cascade processor. Is there any way to change code to monitor two events simultaneously?

I tried adding below definitions and some codes to use these, but I don't think it is the correct way to monitor two events.

#define MSR_IA32_PERFCTR1           0x000000c2
#define MSR_IA32_EVNTSEL1           0x00000187

Could you give me some advise how to edit the code in simple-pebs.c to monitor two events?

andikleen commented 1 year ago

Every time simple-pebs programs or reads one counter program two. It is always the next MSR number. Or use a more capable PEBS driver like perf