LIBPFM(3)

πŸ’– libpfm_amd64_k8 β€” the AMD64 K8 era, but make it legible πŸ’–

okay so bestie, welcome to libpfm(3), aka the Linux Programmer's Manual page that's about to explain AMD64 K8 processor support to you like you're a real one and not just someone who copy-pastes from Stack Overflow. grab a strawberry πŸ“, we're doing this.


✨ NAME ✨

libpfm_amd64_k8 β€” support for AMD64 K8 processors. that's it. that's the whole vibe. it's the library chunk that knows how to talk to AMD's K8 chips. πŸ’…


✨ SYNOPSIS ✨

first things first, you gotta include the header, no cap:

#include <perfmon/pfmlib.h>

then here's the PMU situation β€” six revisions, six names, all iconic:

PMU name: amd64_k8_revb, amd64_k8_revc, amd64_k8_revd, amd64_k8_reve, amd64_k8_revf, amd64_k8_revg
PMU desc: AMD64 K8 RevB, AMD64 K8 RevC, AMD64 K8 RevD, AMD64 K8 RevE, AMD64 K8 RevF, AMD64 K8 RevG

like, she's got range. πŸ¦‹


✨ DESCRIPTION ✨

so the library supports AMD K8 processors β€” and the way that it does that in both 32 and 64-bit modes? obsessed. πŸ™ˆ these chips correspond to processor family 15, which is the technical way of saying "yes, this is the one you're looking for."


✨ MODIFIERS ✨

okay this is the part you actually came for. the following modifiers are supported on AMD64 K8 processors, and every single one of them matters:

  • u β€” measure at user level, which includes privilege levels 1, 2, 3. this corresponds to PFM_PLM3. it's a boolean modifier, so it's giving on/off energy. ✨
  • 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. yes, it's the "not me" modifier, and yes, it's a boolean modifier. πŸ’€
  • e β€” enable edge detection, i.e., count only when there is a state transition. literally only counting the moment things change. this is a 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]. πŸ‘‘
ngl, that [0:255] range is not a suggestion, bestie. integer means integer.

✨ AUTHORS ✨

the masterminds behind this whole thing, show them some respect 🫢:

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

and that's the whole page, periodt. πŸ’œ this was libpfm(3) from the Linux Programmer's Manual, dated April, 2009 β€” yeah she's an elder but she still ate. bye bestie, go profile something. πŸ’…βœ¨

πŸ“¦ where this page comes from