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 toPFM_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 toPFM_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, andeare boolean,cis 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. πππ
π¦ where this page comes from
- centos-stream 9: libpfm-devel 4.14.1-1.el9 Β· MIT
- debian bookworm: libpfm4-dev 4.13.0-1 Β· MIT
- debian trixie: libpfm4-dev 4.13.0+git99-gc5587f9-1 Β· MIT
- fedora 43: libpfm-devel 4.13.0-16.fc43 Β· MIT
- fedora 43: libpfm-devel 4.13.0-20.fc43
- fedora 43: libpfm-devel 4.14.1-2.fc43 Β· MIT
- fedora 44: libpfm-devel 4.13.0-19.fc44 Β· MIT
- fedora 44: libpfm-devel 4.13.0-20.fc44
- fedora 44: libpfm-devel 4.14.1-2.fc44 Β· MIT
- ubuntu jammy: libpfm4-dev 4.11.1+git32-gd0b85fb-1 Β· BSD-like
- ubuntu jammy: libpfm4-dev 4.11.1+git32-gd0b85fb-1ubuntu0.1 Β· BSD-like
- ubuntu noble: libpfm4-dev 4.13.0+git32-g0d4ed0e-1 Β· MIT
- ubuntu noble: libpfm4-dev 4.13.0+git32-g0d4ed0e-1ubuntu0.1 Β· MIT
- ubuntu questing: libpfm4-dev 4.13.0+git99-gc5587f9-1
- ubuntu resolute: libpfm4-dev 4.13.0+git106-g3e4031b-1 Β· MIT
- ubuntu resolute: libpfm4-dev 4.13.0+git106-g3e4031b-1ubuntu0.1 Β· MIT
- ubuntu stonking: libpfm4-dev 4.13.0+git106-g3e4031b-1ubuntu1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms