Friday, April 27, 2018

performancecounter - Configuring the PMU to read Perfomance Counters

I am using Linux 4.19.2 (ubuntu 16.04) on an intel i7-3770 CPU. I have used tools like perf for performance monitoring. I want to write a basic piece of code to read performance counters without using any such tools.



I came across the rdpmc instruction. Before using it, I am having trouble with configuring the registers to count a particular event. I checked some forums like https://software.intel.com/en-us/forums/software-tuning-performance-optimization-platform-monitoring/topic/745751 but this didn't help.
What exactly is meant by configuring the PMU here? And how would one do it?




I want to read from kernel code itself, so there's no issue of privileges. What is the easiest way to do it?



Also, is rdpmc the least overhead way to this?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...