LIBPFM(3)
π LIBPFM(3) β the libpfm_intel_wsm glow-up π
okay bestie, sit down, hydrate, and let me tell you about libpfm_intel_wsm β straight out of the Linux Programmer's Manual, section 3, and yes she's serving library energy. This is the page that spills all the tea on support for the Intel Westmere core PMU. π¦
β¨ NAME β¨
libpfm_intel_wsm β support for Intel Westmere core PMU. that's it, that's the whole name, no notes. π
πΈ SYNOPSIS πΈ
#include <perfmon/pfmlib.h>
and also, because she's got TWO personas (main character and main character's hotter cousin):
PMU name: wsm
PMU desc: Intel Westmere
PMU name: wsm_dp
PMU desc: Intel Westmere DP
π DESCRIPTION π
So the library supports the Intel Westmere core PMU. π
lowkey important caveat, bestie: this PMU model only covers each core's PMU, and not the socket level PMU. That one is provided separately, okay? don't come for me. π
Support is provided for the Intel Core i7 and Core i5 processors β that's models 37, 44. iconic lineup fr fr.
π MODIFIERS π
The following modifiers are supported on Intel Westmere processors β these are the little seasonings you sprinkle on your event, and each one is a whole vibe:
uβ measure at user level, which includes privilege levels 1, 2, 3. This corresponds toPFM_PLM3. She's a boolean modifier. β¨kβ measure at kernel level, which includes privilege level 0. 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. it's giving "opposite day" energy πeβ enable edge detection, i.e. 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 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]. πtβ measure on both threads at the same time, assuming hyper-threading is enabled. Boolean modifier. two for the price of one, slay πldlatβ pass a latency threshold to theMEM_INST_RETIRED:LATENCY_ABOVE_THRESHOLDevent. This is an integer attribute that must be in the range[1:65535]. It is required for this event. π
π¨ heads up babes: note that the event must be used with precise sampling (PEBS). no PEBS, no party. don't skip this one, it's not optional. π€
π₯ OFFCORE_RESPONSE events π₯
okay this part is the drama section, buckle up.
The library is able to encode the OFFCORE_RESPONSE_0 and OFFCORE_RESPONSE_1 events. Those are special events because they, each, need a second MSR (0x1a6 and 0x1a7 respectively) to be programmed for the event to count properly. So yes β two values are necessary for each event. π
- The first value can be programmed on any of the generic counters.
- The second value goes into the dedicated MSR (
0x1a6or0x1a7).
The OFFCORE_RESPONSE events are exposed as normal events with several umasks, and those umasks are divided into two groups: request and response. The user must provide at least one umask from each group. For instance, OFFCORE_RESPONSE_0:ANY_DATA:LOCAL_DRAM. like, you gotta show up with one from each side, it's a potluck. π§
When using pfm_get_event_encoding(), two 64-bit values are returned:
- the first value corresponds to what needs to be programmed into any of the generic counters;
- the second value must be programmed into the corresponding dedicated MSR (
0x1a6or0x1a7).
When using an OS-specific encoding routine, the way the event is encoded is OS specific. Refer to the corresponding man page for more information. iykyk π
π AUTHORS π
- Stephane Eranian
<eranian@gmail.com>β the icon, the legend, the blueprint π
and that's the whole page, bestie. this one dropped September, 2009, it's LIBPFM(3) from the Linux Programmer's Manual, and honestly? timeless. periodt. πβ¨π
π¦ 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 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