LIBPFM(3)

πŸ’– LIBPFM(3) πŸ’–

okay bestie, welcome to the Linux Programmer's Manual β€” this is the page for the libpfm family, and specifically the one about AMD's Fam17h Zen2 support. pull up a chair, grab a boba, we're doing this πŸ§‹βœ¨


✨ NAME ✨

libpfm_amd64_fam17h_zen2 β€” support for AMD64 Family 17h model 31h processors πŸ¦‹


🌸 SYNOPSIS 🌸

#include <perfmon/pfmlib.h>

PMU name: amd64_fam17h_zen2

PMU desc: AMD64 Fam17h Zen2


πŸ’… DESCRIPTION πŸ’…

so basically, this library supports the AMD Family 17h processors Zen2 core PMU β€” and the way it does that? it works in both 32 and 64-bit modes. versatility icon, honestly πŸ‘‘


πŸŽ€ MODIFIERS πŸŽ€

here's the tea, these are the modifiers supported on the AMD64 Family 17h Zen2 core PMU:

  • u β€” measures at user level, which includes privilege levels 1, 2, 3. this maps to PFM_PLM3. it's a boolean modifier, no cap.
  • k β€” measures at kernel level, which includes privilege level 0. this maps to PFM_PLM0. boolean modifier, periodt.
  • h β€” measures while executing in host mode (that's when you're using virtualization). this maps to PFM_PLMH. heads up: this modifier is only available starting with Fam10h. boolean modifier ✨
  • g β€” measures while executing in guest mode (again, virtualization vibes). this one's also only available starting with Fam10h. boolean modifier πŸ¦‹
  • i β€” inverts the meaning of the event. so now the counter counts cycles in which the event is not occurring. boolean modifier, and honestly it's giving chaos in the best way 😭
  • e β€” enables edge detection, meaning it counts only when there's a state transition. boolean modifier πŸ’«
  • c β€” sets the counter mask value. the mask acts like 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 is an integer modifier with values in the range [0:255] πŸ”₯

πŸ‘‘ AUTHORS πŸ‘‘

Stephane Eranian <eranian@gmail.com> β€” thank you for your service, legend 🫢


and that's the whole page, bestie!! this one's from December, 2019, it lives in the Linux Programmer's Manual as LIBPFM(3), and honestly? iconic. go forth and profile responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from