How to properly use the PMC0 and PMC1 performance counters
I have a question regarding on how to use the PMC0 and PMC1 together with the APIC_LVTPC. I have developed 2 Linux kernel modules. First, reads PEBS and second, reads LBR. I use PMC0 and PMC1 to count the event.
My problem is that if I load PEBS module and than LBR reading module than only the LBR module working properly. If I load first the LBR module than the PEBS module is not working properly. Somehow the second module is shadowing the first one.
Is there something that I miss? Can the APIC_LVTPC register used with only one event at a time?
Please have a look at the code of PEBS module and LBR module here: