LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Problem in Making Perf Kernel Counter Work (https://www.linuxquestions.org/questions/linux-kernel-70/problem-in-making-perf-kernel-counter-work-4175573251/)

Skidro 02-25-2016 05:24 PM

Problem in Making Perf Kernel Counter Work
 
Hi All,
I have written a kernel module which creates a performance counter via "perf_event_create_kernel_counter" API and then periodically reads its value. My application works on Kernel version-4.0.9 (and prior revisions) but it doesn't work on Kernel version-4.1 (and later revisions). Basically in the later revisions of Kernel, I am able to read only Software counters (e.g. PERF_COUNT_SW_CPU_CYCLES) but none of the hardware counter (e.g. PERF_COUNT_HW_CACHE_MISSES). More specifically, the hardware counter always reads zero in the kernel revision 4.1 and later. Does anybody have an idea what might be causing this problem and how to fix it?

I will be grateful for any help!

Thanks!


All times are GMT -5. The time now is 10:25 AM.