LIBPFM(3)
π LIBPFM(3) β the Linux Programmer's Manual, but make it make sense π
okay bestie, welcome to the libpfm(3) page, except it's the specific corner of it about Intel Nehalem. grab a boba, we're doing performance monitoring units together π§β¨
β¨ NAME β¨
libpfm_intel_nhm β support for Intel Nehalem core PMU. that's it, that's the whole name, she's giving very demure, very mindful πΈ
π SYNOPSIS π
#include <perfmon/pfmlib.h>
PMU name: nhm PMU desc: Intel Nehalem PMU name: nhm_ex PMU desc: Intel Nehalem EX
π¦ DESCRIPTION π¦
so the library supports the Intel Nehalem core PMU. big caveat incoming: this PMU model only covers each core's PMU, and not the socket level PMU β that one's a whole separate thing, it's provided separately, no it does not come with the fries π
Support is provided for the Intel Core i7 and Core i5 processors. iconic duo honestly π
π MODIFIERS π
The following modifiers are supported on Intel Nehalem processors:
uβ measure at user level, which includes privilege levels 1, 2, 3. this corresponds toPFM_PLM3. it's a boolean modifier β¨kβ measure at kernel level, which includes privilege level 0. this corresponds toPFM_PLM0. also a boolean modifier πiβ invert the meaning of the event. the counter will now count cycles in which the event is not occurring. boolean modifier, lowkey chaotic of it πeβ enable edge detection, i.e. count only when there is a state transition from no occurrence of the event to at least one occurrence. important: this modifier must be combined with a counter mask modifier (m) with a value greater or equal to one. boolean modifier π₯cβ set the counter mask value. the mask acts as a threshold. the counter will count the number of cycles in which the number of occurrences of the event is greater or equal to the threshold. this is an integer modifier with values in the range[0:255]πtβ measure on both threads at the same time, assuming hyper-threading is enabled. boolean modifier πΈldlatβ pass a latency threshold to theMEM_INST_RETIRED:LATENCY_ABOVE_THRESHOLDevent. this is an integer attribute that must be in the range[1:65535]. it is required for this event. and like, heads up β the event must be used with precise sampling (PEBS) π
π OFFCORE_RESPONSE event π
The library is able to encode the OFFCORE_RESPONSE_0 event. this one's a special event because it needs a second MSR (0x1a6) to be programmed for the event to count properly. so two values are necessary, periodt. the first value can be programmed on any of the generic counters. the second value goes into the dedicated MSR (0x1a6) π«Ά
The OFFCORE_RESPONSE event is exposed as a normal event with several umasks, which are divided in two groups: request and response. the user must provide at least one umask from each group. for instance, OFFCORE_RESPONSE_0:ANY_DATA:LOCAL_DRAM β¨
When using pfm_get_event_encoding(), two 64-bit values are returned. the first value corresponds to what needs to be programmed into any of the generic counters. the second value must be programmed into the dedicated MSR (0x1a6) π
When using an OS-specific encoding routine, the way the event is encoded is OS specific. refer to the corresponding man page for more information β iykyk π
π AUTHORS π
Stephane Eranian <eranian@gmail.com> β thank you for your service king π
and that's the whole page bestie, no notes. this little gem is from September, 2009 and it lives in the LIBPFM(3) manual. slay, go measure some cycles πβ¨ππ¦πΈπ
π¦ where this page comes from
- arch rolling: libpfm 4.14.1-1 Β· MIT
- centos-stream 10: libpfm-devel 4.14.1-1.el10 Β· MIT
- centos-stream 9: libpfm-devel 4.14.1-1.el9 Β· MIT
- centos-stream 9: libpfm-devel 4.14.1-1.el9 Β· MIT
- debian bookworm: libpfm4-dev 4.13.0-1 Β· MIT
- debian trixie: libpfm4-dev 4.13.0+git99-gc5587f9-1 Β· MIT
- fedora 43: libpfm-devel 4.13.0-16.fc43 Β· MIT
- fedora 43: libpfm-devel 4.13.0-16.fc43 Β· MIT
- fedora 43: libpfm-devel 4.13.0-20.fc43
- fedora 43: libpfm-devel 4.13.0-20.fc43
- fedora 43: libpfm-devel 4.14.1-2.fc43 Β· MIT
- fedora 43: libpfm-devel 4.14.1-2.fc43 Β· MIT
- fedora 44: libpfm-devel 4.13.0-19.fc44 Β· MIT
- fedora 44: libpfm-devel 4.13.0-19.fc44 Β· MIT
- fedora 44: libpfm-devel 4.13.0-20.fc44
- fedora 44: libpfm-devel 4.13.0-20.fc44
- fedora 44: libpfm-devel 4.14.1-2.fc44 Β· MIT
- fedora 44: libpfm-devel 4.14.1-2.fc44 Β· MIT
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: libpfm 4.14.1
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: libpfm-devel 4.13.0-160000.3.1 Β· MIT
- ubuntu noble: libpfm4-dev 4.13.0+git32-g0d4ed0e-1 Β· MIT
- ubuntu noble: libpfm4-dev 4.13.0+git32-g0d4ed0e-1ubuntu0.1 Β· MIT
- ubuntu questing: libpfm4-dev 4.13.0+git99-gc5587f9-1
- ubuntu resolute: libpfm4-dev 4.13.0+git106-g3e4031b-1 Β· MIT
- ubuntu resolute: libpfm4-dev 4.13.0+git106-g3e4031b-1ubuntu0.1 Β· MIT
- ubuntu stonking: libpfm4-dev 4.13.0+git106-g3e4031b-1ubuntu1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms