LIBPFM(3)

πŸ“¦
version 4.14.1 Β· 2 versions
  • 4.14.1 Β· arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 4.11.1+git32-gd0b85fb Β· ubuntu jammy
, in arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 to PFM_PLM3. it's a boolean modifier ✨
  • k β€” measure at kernel level, which includes privilege level 0. this corresponds to PFM_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 the MEM_INST_RETIRED:LATENCY_ABOVE_THRESHOLD event. 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