LIBPFM(3)

πŸ’– LIBPFM(3) β€” the Linux Programmer's Manual, but make it cute πŸ’–

okay bestie, gather round, we're doing a manual page from the Linux Programmer's Manual and honestly? it's giving niche-but-iconic. this one's about libpfm_intel_p6, so buckle up πŸŽ€


✨ NAME ✨

libpfm_intel_p6 β€” support for Intel P5 based processors πŸ¦‹


🌸 SYNOPSIS 🌸

#include <perfmon/pfmlib.h>

PMU name: pm, ppro, pii, piii, p6

PMU desc: Intel Pentium M, Intel Pentium Pro, Intel Pentium II, Intel Pentium III, Intel P6


πŸ’… DESCRIPTION πŸ’…

so the tea is: this library has your back for all the Intel P6-based processors, and we're talking all the way back to the Pentium Pro. vintage. retro. main character energy from like 1995. πŸ‘‘

and yes, technically every single one of those processors rocks the exact same PMU architecture β€” like, same vibe, same structure β€” BUT. and this is the important part. they do not all offer the same events. the architecture matches, the events do not. no cap. so don't go assuming one's event list works on the others, because it does not. πŸ™ˆ


⭐ MODIFIERS ⭐

these next ones? they work on every Intel P6 processor, so you can just learn them once and slay forever:

  • u β€” measure at user level, which includes privilege levels 1, 2, and 3. this corresponds to PFM_PLM3. it's a boolean</> modifier, so it's on or off, that's it.
  • k β€” measure at kernel level, which includes privilege level 0. this corresponds to PFM_PLM0. also a boolean</> modifier. simple. clean. iconic.
  • i β€” invert the meaning of the event. the counter will now count cycles in which the event is not occurring. yes bestie, we're counting the absence, it's giving reverse uno card. this is a boolean</> modifier.
  • e β€” enable edge detection, i.e., count only when there is a state transition. a boolean</> modifier, meaning it's just a toggle, no numbers involved.
  • 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 one's an integer modifier, and the values live in the range [0:255]. do not go outside that range, it's not the vibe. 🫢
lowkey reminder: u, k, i, and e are boolean, c is the only integer one. don't mix them up and you're golden ✨

πŸ‘‘ AUTHORS πŸ‘‘

Stephane Eranian <eranian@gmail.com>


and that's the whole page, bestie, you ate it up πŸ’– this was LIBPFM(3), version dated September, 2009, and honestly the fact that a 2009 manual page is still this useful? obsessed. periodt. πŸŒˆπŸŽ€πŸ’œ