Questions related to the use of the Intel Performance Management Unit, which provides performance counters related to the performance of currently executing code.
The Intel performance management unit provides performance counters which track performance related metrics for the currently executing code.
They are useful while profiling code, and are supported by Intel's VTune, Linux's perf command and the Windows Performance Toolkit.
The counters and the details of how to program them vary by CPU architecture and the details are available in Chapter 18 and 19 of the Intel-64 and IA-32 Architectures Software Developer Manual, Volume 3.
Other libraries / tools for using the PMU include:
Likwid: Various performance-related tools, including a micro-benchmarking framework. Supports Intel-PMU, AMD perf counters, some ARM, POWER8/9, and some NVidia GPUs.
libpfc: A simple Linux kernel module and library to let user-space program the counters, so it can use
rdpmc
in user-space. Example usage in the author's answer to this SO question.https://github.com/andikleen/pmu-tools some wrappers around Linux
perf
. ocperf.py used to be more useful, beforeperf
itself got symbolic event names for more CPU-specific events. But there are other tools in that repo.