LIBPFM(3)
π LIBPFM(3) β Linux Programmer's Manual π
okay bestie, welcome to the libpfm_intel_ivb page, living inside the big LIBPFM(3) manual. it's giving "let me tell you about this one specific Intel chip" and honestly? iconic. let's go π
β¨ NAME β¨
libpfm_intel_ivb β support for Intel Ivy Bridge core PMU
π¦ SYNOPSIS π¦
#include <perfmon/pfmlib.h>
PMU name: ivb
PMU desc: Intel Ivy Bridge
PMU name: ivb_ep
PMU desc: Intel Ivy Bridge EP
two PMUs, one vibe check, no notes π
πΈ DESCRIPTION πΈ
so this library supports the Intel Ivy Bridge core PMU, periodt. but before you get too excited β it only covers each core's PMU, not the socket level PMU. like, per-core energy only, bestie. don't come for the socket stuff.
here's the tea on generic counters on Ivy Bridge: the number depends on Hyperthreading (HT) mode π
- when HT is on β only 4 generic counters are available
- when HT is off β a whole 8 generic counters are available
and if you need to know the max, pfm_get_pmu_info() returns it for you in num_cntrs. slay, function doing its job π«Ά
π MODIFIERS π
these are the modifiers supported on Intel Ivy Bridge processors, and every single one matters, no skipping:
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. also a boolean modifier.iβ invert the meaning of the event β¨. the counter will now count cycles in which the event is not occurring. yes, it's a boolean modifier.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. it's a boolean modifier.cβ set the counter mask value. the mask acts like 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, obviously.ldlatβ pass a latency threshold to theMEM_TRANS_RETIRED:LATENCY_ABOVE_THRESHOLDevent. this is an integer attribute that must be in the range[1:65535], and it is required for this event. π note that the event must be used with precise sampling (PEBS).
π₯ OFFCORE_RESPONSE events π₯
Intel Ivy Bridge provides two offcore_response events, and their names are:
OFFCORE_RESPONSE_0OFFCORE_RESPONSE_1
these events need special treatment in the performance monitoring infrastructure because each event uses an extra register to store some settings. so if multiple offcore_response events are being monitored simultaneously, the kernel needs to manage the sharing of that extra register. teamwork, but make it kernel π
the offcore_response events are exposed as normal events by the library. the extra settings are exposed as regular umasks, and the library takes care of encoding the events according to the underlying kernel interface. we love a library that handles the admin π
on Intel Ivy Bridge, the umasks are divided into three categories:
- request
- supplier
- snoop
the user must provide at least one umask for each category. the categories are shown in the umask descriptions. π
there's also a special response umask called ANY_RESPONSE. when this umask is used, it overrides any supplier and snoop umasks. in other words, users can specify either ANY_RESPONSE or any combinations of supplier + snoops. pick a lane, bestie π
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:
OFFCORE_RESPONSE_0:ANY_RFO:LLC_HITM:ANY_RESPONSE
OFFCORE_RESPONSE_0:ANY_RFO:LLC_HITM:SNOOP_ANY:ANY_RESPONSE
yeah those last two? not the move. do not pass go, do not collect your counters π
π«Ά AUTHORS π«Ά
Stephane Eranian <eranian@gmail.com>
and that's the whole page, bestie!! this one shipped back in August, 2012 under the LIBPFM(3) name β shoutout to the Linux Programmer's Manual for housing it π stay perf-y, 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 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