LIBPFM(3)
π NAME π
Hii bestie π so the page you're looking at is LIBPFM(3) from the Linux Programmer's Manual, and the star of this particular show is libpfm_intel_skx_unc_cha β the support for the Intel Skylake X Server CHA-Box uncore PMU. That's the whole vibe. β¨
β¨ SYNOPSIS β¨
#include <perfmon/pfmlib.h>
- PMU name:
skx_unc_cha[0-27] - PMU desc:
Intel Skylake X CHA uncore PMU
π¦ DESCRIPTION π¦
Okay so, this library has your back for the Intel Skylake X CHA-Box uncore PMU β CHA being the coherency and home agent engine, iykyk. π«Ά
Here's the tea: there is one CHA-box PMU per physical core. So that means there are up to twenty-eight identical CHA-Box PMU instances, numbered from 0 up to possibly 27. Twenty-eight. That's a lot of little guys. π
And on dual-socket systems? The number refers to the CHA-Box PMU on the socket where the program is running. Let's spell that out:
- if you're running on
CPU18, thenskx_unc_cha0refers to the CHA-Box for physical core0on socket 1 - but if you're running on
CPU0, then that sameskx_unc_cha0refers to the CHA-Box for physical core0but on socket 0
Same name, different socket, depending on where you are. Main character energy but make it socket-aware. π
Each CHA-Box PMU implements 4 generic counters and two filter registers used only with certain events and umasks. Those filters get accessed either via modifiers (scroll down, bestie) or via umasks, like the opcode or cache state filter. πΈ
π MODIFIERS π
These are the modifiers supported on the Intel Skylake CHA-Box uncore PMU. Every single one, no skipping, periodt:
eβ enable edge detection, i.e. count only when there's a state transition from no occurrence of the event to at least one occurrence. Lowkey important: this modifier must be combined with a threshold modifier (t) with a value greater or equal to one. It's a boolean modifier. βtβ set the threshold value. When it's set 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 or equal to the threshold. This is an integer modifier, values in the range[0:255]. π’iβ invert the meaning of the event. The counter will now count cycles in which the event is not occurring. Also a boolean modifier. πlocβ match on local node target. This filter is only supported onUNC_C_TOR_INSERTSandUNC_C_TOR_OCCUPANCY. It's a boolean filter. πremβ match on remote node target. This filter is only supported onUNC_C_TOR_INSERTSandUNC_C_TOR_OCCUPANCY. boolean filter. π‘lmemβ match near memory cacheable. This filter is only supported onUNC_C_TOR_INSERTSandUNC_C_TOR_OCCUPANCY. boolean filter. π§rmemβ match not near memory cacheable. This filter is only supported onUNC_C_TOR_INSERTSandUNC_C_TOR_OCCUPANCY. boolean filter. π«π§ncβ match non-coherent requests. This filter is only supported onUNC_C_TOR_INSERTSandUNC_C_TOR_OCCUPANCY. boolean filter. πisocβ match isochronous requests. This filter is only supported onUNC_C_TOR_INSERTSandUNC_C_TOR_OCCUPANCY. boolean filter. β±οΈ
π₯ Opcode filtering π₯
Okay this part is giving precision, and honestly? Obsessed. π―
Events UNC_C_TOR_INSERTS and UNC_C_TOR_OCCUPANCY support opcode matching. The processor implements two opcode filters, and both are used at the same time. No picking favourites, they ride together. π
- The
OPC0umasks correspond to the first opcode matcher. OPC1corresponds to the second opcode matcher.
If you only need to track one opcode, then the unused filter gets set to 0. Simple as that. β¨
β οΈ Heads up bestie, this is the part where the library will straight up reject you: the opcode umasks must be used in combination with a specific queue umask, otherwise the library rejects the event. Not a vibe. π
The umask description shows which queue umask is required for each opcode. For instance, OPC0_RFO/OPC1_RFO require the IRQ queue and thus the IRQ umask. π¬
And the good news? The opcode match umasks can be combined with other modifiers. Mix and match, you're free. π¦
π AUTHORS π
This iconic work was brought to you by Stephane Eranian <eranian@gmail.com>. Give them their flowers. π
Okay that's the whole page, bestie! This one's from the Linux Programmer's Manual, version/date stamped January, 2018, and it lives at LIBPFM(3). Go forth and count those C-Box cycles. Slay. π
β¨π«Ά
π¦ 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