LIBPFM(3)
π LIBPFM(3) β the girlies' guide to the Sandy Bridge uncore PMU π
okay so bestie, welcome to LIBPFM(3), from the Linux Programmer's Manual. this one's a deep cut but it's so worth it, i promise. grab a boba, we're going in π§β¨
πΈ NAME πΈ
libpfm_intel_snb_unc β the support page for the Intel Sandy Bridge uncore PMU. that's it. that's the whole vibe. π
β¨ SYNOPSIS β¨
first things first, you gotta pull in the header, no cap:
#include <perfmon/pfmlib.h>
and here's who we're actually talking about:
PMU name: snb_unc_cbo0, snb_unc_cbo1, snb_unc_cbo2, snb_unc_cbo3
PMU desc: Intel Sandy Bridge C-box uncore
four whole PMUs, bestie. four. one per core. periodt π
π¦ DESCRIPTION π¦
so the library supports the Intel Sandy Bridge client part β that's model 42 β and specifically its uncore PMU. rn the support is limited to the Coherency Box (aka the C-Box) for up to 4 physical cores. lowkey humble but highkey iconic.
here's the tea tho: every physical core has its own C-Box, and that's the little communication bestie it uses to talk to the L3 cache. all the C-boxes support the same set of events β matching outfits, love that for them π«Ά β but there's one exception. the Core 0 C-box (snb_unc_cbo0) also supports an extra uncore clock ticks event:
UNC_CLOCKTICKS
so yeah, core 0 is the main character, obviously. π
π MODIFIERS π
these are the little glow-ups you can slap onto the Intel Sandy Bridge C-Box uncore PMU:
iβ inverts the meaning of the event, bestie. the counter now counts cycles where the event is not happening. it's a boolean modifier, so it's a yes/no situation, no in-between. πeβ enables edge detection, aka "count only when something actually changes" β specifically, when there's a state transition from zero occurrences of the event to at least one. β οΈ important: this modifier must be combined with a counter mask modifier (m) with a value greater or equal to one. it's also a boolean modifier.cβ sets the counter mask value. the mask is a threshold, and the counter counts the number of cycles where the number of occurrences of the event is greater or equal to that threshold. this one's an integer modifier with values in the range[0:255]. slay, math.
okay so heads up, this next bit is real: bothUNC_CBO_CACHE_LOOKUPandUNC_CBO_XSNP_RESPONSErequire two umasks to even be valid. forUNC_CBO_CACHE_LOOKUP, the first umask has to be one of the MESI state umasks, and the second has to be one of the filters. forUNC_CBO_XSNP_RESPONSE, the first umask has to be one of the snoop types, and the second has to be one of the filters. no second umask = no vibes. π
π AUTHORS π
this masterpiece was brought to you by Stephane Eranian <eranian@gmail.com> π
and that's the whole page, bestie!! π this was from the August, 2012 era, sourced from LIBPFM(3) β yes we stan a vintage queen. go forth and count your uncore events, iykyk β¨π¦πΈ
π¦ 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