LIBPFM(3)
π LIBPFM(3) β the Linux Programmer's Manual glow-up π
okay bestie, sit down, hydrate, and let me tell you about a page from the Linux Programmer's Manual that is genuinely so niche and so good. it's LIBPFM(3) and it's giving β¨uncore PMU loreβ¨. let's go.
β¨ NAME β¨
libpfm_intel_hswep_unc_cbo β the support page for the Intel Haswell-EP C-Box uncore PMU. that's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
#include <perfmon/pfmlib.h>
PMU name: hswep_unc_cbo[0-17]
PMU desc: Intel Haswell-EP C-Box uncore PMU
like, that's the whole thing. short, sweet, iconic. π
πΈ DESCRIPTION πΈ
so the library supports the Intel Haswell C-Box (that's the coherency engine, bestie, it's the part that keeps everyone's caches from lying to each other) uncore PMU. this PMU model only exists on Haswell model 63 β no cap, if you're not on model 63, this whole page is not for you. π
there is one C-box PMU per physical core. so that means there are up to eighteen identical C-Box PMU instances, numbered from 0 to 17.
now here's the part that lowkey trips people up: on dual-socket systems, that number refers to the C-Box PMU on the socket where the program is running. so for example, if you're running on CPU18, then hswep_unc_cbo0 refers to the C-Box for physical core 0 on socket 1. but flip it β if you're running on CPU0, then that exact same hswep_unc_cbo0 refers to the C-Box for physical core 0, but on socket 0. same name, different physical thing, depending on where you're standing. it's giving relativity, honestly. π
and each C-Box PMU implements 4 generic counters and two filter registers, and those filter registers are only used with certain events and umasks. not everything, just certain ones. periodt. π
π MODIFIERS π
the following modifiers are supported on the Intel Haswell C-Box uncore PMU β read them all, don't skip, I will know:
eβ enables edge detection, meaning it counts only when there's 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 than or equal to one. it's a boolean modifier. π¦tβ sets the threshold value. when you set it to a non-zero value, the counter counts the number of C-Box cycles in which the number of occurrences of the event is greater than or equal to the threshold. this is an integer modifier and the legal range is[0:255]. πΈnfβ the Node filter. certain events, likeUNC_C_LLC_LOOKUPandUNC_C_LLC_VICTIMS, provide aNIDumask. sometimes thatNIDgets combined with other filtering capabilities, like opcodes. the node filter is an 8-bit max bitmask. a node corresponds to a processor socket, so the legal values totally depend on your underlying hardware configuration. for dual-socket systems, the bitmask has two valid bits,[0:1]. β¨cfβ the Core Filter. this is a 5-bit filter used to filter based on the physical core origin of the C-Box request. possible values are0-63. if you don't specify the filter, then no filtering takes place. bits0-3indicate the physical core id, and bit4filters on non thread-related data. πtfβ the Thread Filter. this is a 1-bit filter used to filter C-Box requests based on logical processor (hyper-thread) identification. possible values are0-1. if you don't specify the filter, then no filtering takes place. πncβ Non-Coherent. this is a 1-bit filter used to filter C-Box requests only for theTOR_INSERTSandTOR_OCCUPANCYumasks, using theOPCODEmatcher. if you don't specify the filter, then no filtering takes place. π«Άisocβ Isochronous. this is a 1-bit filter used to filter C-Box requests only for theTOR_INSERTSandTOR_OCCUPANCYumasks, using theOPCODEmatcher. if you don't specify the filter, then no filtering takes place. π₯
π Opcode filtering π
certain events, like UNC_C_TOR_INSERTS, support opcode matching on the C-BOX transaction type. here's the two-step, bestie:
- first, an opcode matching umask must be selected, e.g.
MISS_OPCODE. - second, the opcode to match on must be selected via a second umask among the
OPC_*umasks.
so for instance, UNC_C_TOR_INSERTS:OPCODE:OPC_RFO counts the number of TOR insertions for RFO transactions. π
opcode matching may also be combined with node filtering with certain umasks. in general, the filtering support is encoded into the umask name β e.g. NID_OPCODE supports both node and opcode filtering. so like:
UNC_C_TOR_INSERTS:NID_OPCODE:OPC_RFO:nf=1
ate. no crumbs. π
π AUTHORS π
Stephane Eranian <eranian@gmail.com> β ty for your service, king. π
π and that's the whole page, bestie. May, 2015, from the Linux Programmer's Manual, LIBPFM(3). go forth and count your C-Box cycles responsibly. mwah. ππ«Άβ¨
π¦ 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