LIBPFM(3)
π LIBPFM π
okay bestie, so this one is libpfm_intel_glm β the Intel Goldmont support page from the Linux Programmer's Manual (that's the LIBPFM(3) section, third manpage section, you know the vibe). sit down, grab a lil snack, we're learning PMU stuff π
β¨ NAME β¨
libpfm_intel_glm β support for Intel Goldmont core PMU
πΈ SYNOPSIS πΈ
#include <perfmon/pfmlib.h>
- PMU name:
glm - PMU desc:
Intel Goldmont
π¦ DESCRIPTION π¦
So the library supports the Intel Goldmont core PMU. But important!! this PMU model only covers each core's PMU and not the socket level PMU. so don't come for me when your socket-level numbers look weird, it's literally not what this is π
On Goldmont, the number of generic counters is 4. There is no HyperThreading support (ngl, she's single-threaded and thriving). The pfm_get_pmu_info() function returns the maximum number of generic counters in num_cntrs.
π MODIFIERS π
The following modifiers are supported on Intel Goldmont processors:
uβ Measure at user level which includes privilege levels 1, 2, 3. This corresponds toPFM_PLM3. This is a boolean modifier.kβ Measure at kernel level which includes privilege level 0. This corresponds toPFM_PLM0. This is a boolean modifier.iβ Invert the meaning of the event. The counter will now count cycles in which the event is not occurring. This is a boolean modifier.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. This is a 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].
π OFFCORE_RESPONSE events π
Intel Goldmont provides two offcore_response events. They are called OFFCORE_RESPONSE_0 and OFFCORE_RESPONSE_1.
Those events need special treatment in the performance monitoring infrastructure because each event uses an extra register to store some settings. So, in case multiple offcore_response events are monitored simultaneously, the kernel needs to manage the sharing of that extra register. (the kernel is doing the group project coordination so you don't have to π«Ά)
The offcore_response events are exposed as normal events by the library. The extra settings are exposed as regular umasks. The library takes care of encoding the events according to the underlying kernel interface.
On Intel Goldmont, the umasks are divided into 4 categories: request, supplier and snoop and average latency. Offcore_response event has two modes of operations: normal and average latency. In the first mode, the two offcore_respnse events operate independently of each other. The user must provide at least one umask for each of the first 3 categories: request, supplier, snoop. In the second mode, the two offcore_response events are combined to compute an average latency per request type.
For the normal mode, there is a special supplier (response) umask called ANY_RESPONSE. When this umask is used then it overrides any supplier and snoop umasks. In other words, users can specify either ANY_RESPONSE OR any combinations of supplier + snoops. In case no supplier or snoop is specified, the library defaults to using ANY_RESPONSE.
For instance, the following are valid event selections:
OFFCORE_RESPONSE_0:DMND_DATA_RD:ANY_RESPONSE
OFFCORE_RESPONSE_0:ANY_REQUEST
OFFCORE_RESPONSE_0:ANY_RFO:LLC_HITM:SNOOP_ANY
But the following are illegal π« (yes the library will side-eye you):
OFFCORE_RESPONSE_0:ANY_RFO:LLC_HITM:ANY_RESPONSE
OFFCORE_RESPONSE_0:ANY_RFO:LLC_HITM:SNOOP_ANY:ANY_RESPONSE
In average latency mode, OFFCORE_RESPONSE_0 must be programmed to select the request types of interest, for instance, DMND_DATA_RD, and the OUTSTANDING umask must be set and no others. the library will enforce that restriction as soon as the OUTSTANDING umask is used. Then OFFCORE_RESPONSE_1 must be set with the same request types and the ANY_RESPONSE umask. It should be noted that the library encodes events independently of each other and therefore cannot verify that the requests are matching between the two events. Example of average latency settings:
OFFCORE_RESPONSE_0:DMND_DATA_RD:OUTSTANDING+OFFCORE_RESPONSE_1:DMND_DATA_RD:ANY_RESPONSE
OFFCORE_RESPONSE_0:ANY_REQUEST:OUTSTANDING+OFFCORE_RESPONSE_1:ANY_REQUEST:ANY_RESPONSE
The average latency for the request(s) is obtained by dividing the counts of OFFCORE_RESPONSE_0 by the count of OFFCORE_RESPONSE_1. The ratio is expressed in core cycles.
π AUTHORS π
Stephane Eranian <eranian@gmail.com>
and that's the whole page bestie, no cap. this edition of the LIBPFM(3) manpage came from July, 2016 β thank you for coming to my ted talk, stan Stephane, slay, periodt πβ¨ππ¦
July, 2016 Β· LIBPFM(3) π«Ά
π¦ 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