LIBPFM(3)

πŸ’– LIBPFM β€” the Linux Programmer's Manual situation πŸ’–

okay bestie, pull up a chair, we're doing the LIBPFM(3) page and it's giving deep lore. this is the manual for libpfm_amd64_fam15h β€” support for AMD64 Family 15h processors πŸ¦‹


✨ NAME ✨

libpfm_amd64_fam15h β€” support for AMD64 Family 15h processors


🌸 SYNOPSIS 🌸

#include <perfmon/pfmlib.h>

and then the PMU glow-ups themselves:

PMU name: amd64_fam15h_interlagos
PMU desc: AMD64 Fam15h Interlagos
PMU name: amd64_fam15h_nb
PMU desc: AMD64 Fam15h Northbridge

like, two whole PMUs, two whole vibes πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so the tea is: this library supports the AMD Family 15h processors core PMU, and it works in both 32-bit and 64-bit modes. yes ma'am, both. equal opportunity counting πŸ”₯

and the uncore (that's the NorthBridge) PMU? it's also supported, but as a separate PMU model β€” it's not sharing a room with the core PMU, it has main character energy of its own πŸ‘‘


πŸŽ€ MODIFIERS πŸŽ€

here's the list of modifiers supported on the AMD64 Family 15h core PMU. these are the little suffixes that change the vibe of your event, iykyk:

  • u β€” measure at user level, which includes privilege levels 1, 2, 3. this maps to PFM_PLM3. it's a boolean modifier ✨
  • k β€” measure at kernel level, which includes privilege level 0. this maps to PFM_PLM0. also a boolean modifier πŸ’–
  • h β€” measure while executing in host mode (so, when you're doing the virtualization thing). this maps to PFM_PLMH. heads up: this modifier is available starting with Fam10h. boolean modifier, periodt 🫢
  • g β€” measure while executing in guest mode (again, virtualization girlies rise). this modifier is available starting with Fam10h. boolean modifier 🌈
  • i β€” invert the meaning of the event. the counter will now count cycles in which the event is not occurring. iconic little chaos move. boolean modifier πŸ’€
  • e β€” enable edge detection, meaning it counts only when there's a state transition. boolean modifier ⭐
  • c β€” set the counter mask value. the mask acts as a threshold: the counter counts the number of cycles in which the number of occurrences of the event is greater or equal to the threshold. this one is an integer modifier with values in the range [0:255] πŸ”₯
⚠️ and now the important one: the uncore (NorthBridge) PMU does not support any modifiers. none. zero. not a single one. so don't come for it with suffixes, bestie πŸ™ˆ

πŸ‘‘ AUTHORS πŸ‘‘

the legends behind all this:

  • Stephane Eranian <eranian@gmail.com>
  • Robert Richter <robert.richter@amd.com>

and that's the whole page, babe πŸ’– this version is from Nov, 2013, and it lives in the LIBPFM(3) section of the Linux Programmer's Manual β€” so go forth, count those cycles, and slay πŸŒΈπŸ§šπŸ’œ

πŸ“¦ where this page comes from