What is the difference between a permanent command and perfmon2 or libpfm4

I recently dig things around a performance counter. And I googled up perfmon2 and libpfm4 http://perfmon2.sourceforge.net/ , and I also found the primary command https://perf.wiki.kernel.org/index.php/Main_Page and comes with the Linux kernel source code. link to the source code . I played both with libpfm4 and with the perf command, and libpfm4 only seems to be able to count the number of CPU cycles or commands.

I cannot find any sample code or executable example of how to extract information, such as L1-dcache-loads, which seem to be obtained with perf, I looked at stackoverflow and found articles discussing the connection between perf command and libpfm4: Using Linux hardware performance counters People said libpfm4 was angry with one of the first Ingo developers, but he later really helped revise the code that worked.

So can someone explain what is the relationship between perfmon2 or libpfm4 with a permanent command. And can I get information like L1-dcache using libpfm4 in the same way as using perf command. Thank you very much!

+4
source share
1 answer

The perf command provides a subset of the common performance counter events for measuring such as processor clock cycles, number of commands, and cache event metrics. However, most processors provide many other implementation-related hardware events, such as floating-point operations and microarchitecture events (such as kiosks due to hardware resource limitations). To access these specific events, you must use the source event in perf (http://lxr.linux.no/#linux+v3.6/tools/perf/Documentation/perf-record.txt#L33), which can be tiring. libpfm4 provides a matching mechanism for referencing those hardware events associated with a particular implementation by name. libpfm is used by papi. You can see how papi uses libpfm to access these implementation-specific events (http://icl.cs.utk.edu/projects/papi/)

+5
source

Source: https://habr.com/ru/post/1437319/


All Articles