Friday, 27 April 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

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...