Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Accessing hardware counters

Zirak
Beginner
1,279 Views

CPU hardware counter registers provides information about CPU events such as cache miss, hit and etc. This can be done through injecting a simulated code. Assume that, this code is processed by process (A) to collect required information. Is it possible that another process (B) monitor process (A) instead itself? Even if this can be done through kernel will be fine.

0 Kudos
4 Replies
Quoc-Thai_L_Intel
1,279 Views

I found this article that may be related to the information that you are looking for: Capturing Performance Counter Data for a Process by Process Id. - Thai

 

0 Kudos
Zirak
Beginner
1,279 Views

Thank you Thai, That is really interesting for Microsoft framework. But, I am working in Linux platform in C language. There are libraries like PAPI which can access PHC counters, but not sure if it is able to do that.

Many thanks Thai

0 Kudos
Quoc-Thai_L_Intel
1,279 Views

Your welcome.  I found some other information that may give you some hints on this research: 
- Intel® Performance Counter Monitor - A better way to measure CPU utilization article;
- Intel Performance Processor Counter Monitor on github.
-
For questions and comments about Intel PCM and its use-cases, we recommend the Software Tuning, Performance Optimization & Platform Monitoring forum.

-Thai
 

0 Kudos
Zirak
Beginner
1,279 Views

Thai,

Thank you for giving me the hints.  I've tried pmc and msr (RDMSR and WRMSR instructions).

0 Kudos
Reply