LIBPFM(3)
okay bestie, pull up a chair, we're doing the LIBPFM(3) page together π β the one from the Linux Programmer's Manual. This one's all about Intel's Haswell-EP Power Controller Unit, and honestly? it's giving very specific, very niche, very slay.
β¨ NAME β¨
libpfm_intel_hswep_unc_pcu β the support layer for the Intel Haswell-EP Power Controller Unit (PCU) uncore PMU. π
π¦ SYNOPSIS π¦
#include <perfmon/pfmlib.h>
PMU name: hswep_unc_pcu PMU desc: Intel Haswell-EP PCU uncore PMU
πΈ DESCRIPTION πΈ
So the library supports the Intel Haswell Power Controller Unit uncore PMU. That's the whole vibe. π
Heads up: this PMU model only exists on Haswell model 63. Nowhere else. If you're not on model 63, this is not your moment, bestie. π
π MODIFIERS π
These are the modifiers supported on the Intel Haswell PCU uncore PMU β collect them all like little charms:
eβ turns on edge detection, aka count only when there's a state transition from zero occurrences of the event to at least one occurrence. It's a boolean modifier, and it must be paired with a threshold modifier (t) whose value is greater or equal to one. No solo flights. π«Άtβ sets the threshold value. When it's set to a non-zero value, the counter counts the number of HA cycles in which the number of occurrences of the event is greater or equal to the threshold. It's an integer modifier, values in the range[0:15]. π―iβ inverts the meaning of the threshold or edge filter. If it's set, the event counts when strictly less than N occurrences happen per cycle (assuming threshold is set to N). And when invert is set, the threshold must be a non-zero value, periodt. Also: if it's set and edge detection is set, the event counts when the event transitions from occurring to not occurring β a falling edge. Boolean modifier. π«ffβ enables frequency band filtering. This one applies only to theUNC_P_FREQ_BANDx_CYCLESevents, wherexis[0-3]. It expects an integer in the range[0-255]. That value gets read as a frequency to be multiplied by 100Mhz. So like, if the value is32, then every cycle where the processor is running at 3.2GHz and more gets counted. π₯
π§ Frequency band filtering π§
The page says there are 3 events that support frequency band filtering, namely UNC_P_FREQ_BAND0_CYCLES, UNC_P_FREQ_BAND1_CYCLES, UNC_P_FREQ_BAND2_CYCLES, UNC_P_FREQ_BAND3_CYCLES. (Yes bestie, that's four listed for a "3" β we report the text exactly as it's written, no editing the source, iykyk. π)
The frequency filter β the one you reach with the ff modifier β is stored into a PMU shared register that holds all 4 possible frequency bands, one per event. But here's the tea: the library generates the encoding for each event individually, because it processes events one at a time. So the caller or the underlying kernel interface may have to merge the band filter settings to program that filter register properly. Teamwork makes the dream work. π
π AUTHORS π
Stephane Eranian <eranian@gmail.com> β the icon, the legend, the moment. π
and that's the whole page, no cap. β¨ mwah β¨ this came from the Linux Programmer's Manual, dated May, 2015, and it's the LIBPFM(3) page β so go forth, count your cycles, and stay hydrated. π
πΈπ¦
π¦ where this page comes from
- arch rolling: libpfm 4.14.1-1 Β· MIT
- centos-stream 10: libpfm-devel 4.14.1-1.el10 Β· MIT
- centos-stream 9: libpfm-devel 4.14.1-1.el9 Β· MIT
- 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-16.fc43 Β· MIT
- fedora 43: libpfm-devel 4.13.0-20.fc43
- fedora 43: libpfm-devel 4.13.0-20.fc43
- fedora 43: libpfm-devel 4.14.1-2.fc43 Β· MIT
- 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-19.fc44 Β· MIT
- fedora 44: libpfm-devel 4.13.0-20.fc44
- fedora 44: libpfm-devel 4.13.0-20.fc44
- fedora 44: libpfm-devel 4.14.1-2.fc44 Β· MIT
- fedora 44: libpfm-devel 4.14.1-2.fc44 Β· MIT
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: libpfm 4.14.1
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: libpfm-devel 4.13.0-160000.3.1 Β· 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