LIBPFM(3)
๐ LIBPFM ๐
okay bestie, welcome to the Linux Programmer's Manual, page LIBPFM(3). this one's about the Intel Sandy Bridge-EP U-Box uncore PMU and she is niche but she is serving. let's get into it ๐
โจ NAME โจ
libpfm_intel_snbep_unc_ubo โ the whole entire support package for the Intel Sandy Bridge-EP U-Box uncore PMU. yes that's a mouthful. no we're not shortening it. ๐
๐ฆ SYNOPSIS ๐ฆ
#include <perfmon/pfmlib.h>
and also, like, the important little identity card:
PMU name: snbep_unc_ubo
PMU desc: Intel Sandy Bridge-EP U-Box uncore PMU
๐ธ DESCRIPTION ๐ธ
so the library does support the Intel Sandy Bridge system configuration unit (U-Box) uncore PMU. ๐ซถ
heads up though โ this PMU model only exists on Sandy Bridge model 45. like, that's it, that's the whole guest list. and there is only one U-Box PMU per processor socket. one. singular. iconic main character behavior honestly ๐
๐ MODIFIERS ๐
here's the modifier lineup for the Intel Sandy Bridge U-Box uncore PMU. these are the little seasoning packets you sprinkle on your events, and every single one of them matters:
iโ invert the meaning of the event. so instead of counting the thing, the counter now counts HA cycles in which the event is not occurring. it's a boolean modifier. plot twist energy ๐eโ enable edge detection, meaning count only when there is a state transition from no occurrence of the event to at least one occurrence. โ ๏ธ this modifier must be combined with a threshold modifier (t) with a value greater or equal to one. it's a boolean modifier. no solo runs allowed bestie, it's a duet ๐tโ set the threshold value. when you set it 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 with values in the range[0:15]. small range, big power โจoiโ invert the meaning of the occupancy eventPOWER_STATE_OCCUPANCY. the counter will now count PCU cycles in which the event is not occurring. it's a boolean modifier. same flip energy, different event ๐ฆoeโ enable edge detection for the occupancy eventPOWER_STATE_OCCUPANCY. the event now counts only when there is a state transition from no occurrence of the event to at least one occurrence. โ ๏ธ this one must be combined with a threshold modifier (t) with a value greater or equal to one. it's a boolean modifier.ffโ enable frequency band filtering. ๐๏ธ this modifier applies only to theUNC_P_FREQ_BANDx_CYCLESevents, where x is[0-3]. the modifier expects an integer in the range[0-255]. that value gets interpreted as a frequency value to be multiplied by 100Mhz. so like, if the value is 32, then all cycles where the processor is running at 3.2GHz and more are counted. math girlies rise ๐งฎ๐
๐ Frequency band filtering ๐
okay so there are 3 events that support frequency band filtering... and then the list names four of them, which, yes, we're just reading the manual as written, don't come for me ๐:
UNC_P_FREQ_BAND0_CYCLESUNC_P_FREQ_BAND1_CYCLESUNC_P_FREQ_BAND2_CYCLESUNC_P_FREQ_BAND3_CYCLES
the frequency filter (available via the ff modifier) is stored into a PMU shared register which 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 the filter register properly. like, you're gonna have to do some assembly required, bestie ๐งฉ
ngl this is the part where you double-check your register plumbing. the library does its one-at-a-time thing, you do the merging. teamwork ๐ช
๐ AUTHORS ๐
- Stephane Eranian
<eranian@gmail.com>
and that's the whole page, fr fr โจ written down in August, 2012, and it's the LIBPFM(3) page from the Linux Programmer's Manual โ so like, shoutout to the era that gave us this one. mwah ๐ slay, go count some cycles ๐ฆ๐
๐ฆ 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