LIBPFM(3)
πΈ NAME πΈ
okay bestie, meet libpfm_intel_adl_grt π β support for Intel Alderlake Gracemont (P-core) core PMU. yes she's a whole vibe, and this is the LIBPFM(3) page from the Linux Programmer's Manual, so that's the manual we're living in rn π
β¨ SYNOPSIS β¨
#include <perfmon/pfmlib.h>
PMU name: adl_grt
PMU desc: Intel Alderlake Goldencove (E-core)
π¦ DESCRIPTION π¦
so the library supports the Intel Alderlake Gracemont (E-core) core PMU π and lowkey important: this PMU model only covers each core's PMU and not the socket level PMU. don't @ me, that's just the rules.
now here's the tea β β because the processor uses a hybrid architecture with a P-Core and an E-Core with a different PMU model, it may be necessary to force a PMU instance name to get the desired encoding. for instance, to encode for the P-Core adl_grt::BR_INST_RETIRED and for the E-core adl_grt::BR_INST_RETIRED. (yes, both of those are written the same on this page, i'm literally just the messenger π)
On Adlerlake Gracemont (P-Core), there are 6 generic counters and 3 fixed counters. periodt.
and the pfm_get_pmu_info() function returns the maximum number of generic counters in num_cntrs β¨
π MODIFIERS π
The following modifiers are supported on Intel SapphireRapid processors:
yes that's what it says, i don't make the rules π
uβ measure at user level, which includes privilege levels1,2,3. this corresponds toPFM_PLM3. it's a boolean modifier π«Άkβ measure at kernel level, which includes privilege level0. this corresponds toPFM_PLM0. also a boolean modifier β¨iβ invert the meaning of the event π the counter will now count cycles in which the event is not occurring. boolean modifier, no cap.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. this modifier must be combined with a counter mask modifier (m) with a value greater or equal to one. boolean modifier πcβ set the counter mask value. the mask acts as a threshold: the counter will count the number of cycles in which the number of occurrences of the event is greater or equal to the threshold. this is an integer modifier with values in the range[0:255]π₯ldlatβ pass a latency threshold in core cycles to theMEM_TRANS_RETIRED:LOAD_LATENCYevent. this is an integer attribute that must be in the range[1:65535], and it is required for this event. the library provides a set of presets for specific latencies, such as128β note that the event must be used with precise sampling (PEBS).
π OFFCORE_RESPONSE events π
Intel Alderlake Gracemont (E-Core) supports two encodings for offcore_response events (0x1b7, 0x2b7) π in the library these are called OCR0 and OCR1. the two encodings are equivalent β iconic, we love options. on Linux, the kernel can schedule any OCR encoding into any of the two OCR counters.
the offcore_response events are exposed as normal events by the library π and the extra settings are exposed as regular umasks. the library takes care of encoding the events according to the underlying kernel interface β¨
On Intel Alderlake Gracemont (E-Core), the event is treated as a regular event with a flat set of umasks to choose from. it is not possible to combine the various requests, supplier, snoop bits anymore π instead, the library offers the list of validated combinations as per Intel's official event list. slay.
π AUTHORS π
Stephane Eranian <eranian@gmail.com>
and that's the whole vibe, bestie π¦ this was LIBPFM(3), dated February, 2024 β go forth and count those cycles, main character energy only ππ
π¦ 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 trixie: libpfm4-dev 4.13.0+git99-gc5587f9-1 Β· MIT
- 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.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
- 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