I know how to access performance counters from tools like perf and pcm, but I would like to associate hardware counters with particular lines of code in my application. Is there a library that implements the PAPI interface or some other way to get at the hardware counters from inside a C++ program? Where can I download it from?
Link Copied
There is very nice C++ tool to easily program performance counters from Morgan Stanley Xpedite
This allows programmer to easily instrument a section of code for performance counters.
For more complete information about compiler optimizations, see our Optimization Notice.