LIBPFM(3)

πŸ’– LIBPFM(3) β€” Linux Programmer's Manual πŸ’–

okay so bestie, welcome to the libpfm_intel_snbep_unc_cbo page from the Linux Programmer's Manual 🫢 this is the one about Intel Sandy Bridge-EP C-Box uncore PMU support, and ngl it's kinda niche but it's also kinda iconic. sit down, grab a strawberry πŸ“, let's get into it.


✨ NAME ✨

libpfm_intel_snbep_unc_cbo β€” support for Intel Sandy Bridge-EP C-Box uncore PMU

like. that's the whole vibe. it's the support page. πŸ’…


🌈 SYNOPSIS 🌈

#include <perfmon/pfmlib.h>

PMU name: snbep_unc_cbo[0-7]
PMU desc: Intel Sandy Bridge-EP C-Box uncore PMU

so you pull in perfmon/pfmlib.h, and the PMU you're working with is named snbep_unc_cbo[0-7] and its description is literally "Intel Sandy Bridge-EP C-Box uncore PMU". that's it. that's the whole intro. πŸ’œ


πŸ¦‹ DESCRIPTION πŸ¦‹

so this library supports the Intel Sandy Bridge C-Box (coherency engine) uncore PMU. periodt.

heads up: this PMU model only exists on Sandy Bridge model 45. no other model. just 45. don't come for me, that's what it says πŸ’€

there is one C-box PMU per physical core. so do the math bestie, that means there are eight identical C-Box PMU instances, numbered from 0 to 7. eight. one per core. slay.

now here's the tea on dual-socket systems β˜• β€” the number refers to the C-Box PMU on the socket where the program runs. so like, if you're running on CPU8, then snbep_unc_cbo0 refers to the C-Box for physical core 0 on socket 1. but flip it β€” if you're running on CPU0, then that same snbep_unc_cbo0 refers to the C-Box for physical core 0 but on socket 0. same name, different socket, depending on where you're standing. it's giving relativity honestly 🧚

each C-Box PMU implements 4 generic counters and a filter register that's used only with certain events and umasks. lowkey important detail, don't skip it.


πŸ‘‘ MODIFIERS πŸ‘‘

okay this is the main character section. the following modifiers are supported on the Intel Sandy Bridge C-Box uncore PMU:

  • i β€” invert the meaning of the event πŸ’… the counter will now count C-Box cycles in which the event is not occurring. this is 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 threshold modifier (t) with a value greater or equal to one. this is a boolean modifier.
  • t β€” set the threshold value. when 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 with values in the range [0:255]. no cap on the drama, but there is a cap on the value πŸ”₯
  • nf β€” node filter 🌸 certain events, such as UNC_C_LLC_LOOKUP, UNC_C_LLC_VICTIMS, provide a NID umask. sometimes the NID is combined with other filtering capabilities, such as opcodes. the node filter is an 8-bit max bitmask. a node corresponds to a processor socket. the legal values therefore depend on the underlying hardware configuration. for dual-socket systems, the bitmask has two valid bits [0:1].
  • cf β€” Core Filter πŸ’– this is a 3-bit filter used to filter based on the physical core origin of the C-Box request. possible values are 0-7. if the filter is not specified, then no filtering takes place. simple as.
  • tf β€” Thread Filter πŸŽ€ this is a 1-bit filter used to filter C-Box requests based on logical processor (hyper-thread) identification. possible values are 0-1. if the filter is not specified, then no filtering takes place. same energy as above tbh.

πŸ” Opcode filtering πŸ”

certain events, such as UNC_C_TOR_INSERTS, support opcode matching on the C-BOX transaction type. here's how you do it, step by step bestie:

  1. first, an opcode matching umask must be selected, e.g., MISS_OPCODE.
  2. second, the opcode to match on must be selected via a second umask among the OPC_* umasks.

for instance, UNC_C_TOR_INSERTS:OPCODE:OPC_RFO counts the number of TOR insertions for RFO transactions. ate. ✨

opcode matching may be combined with node filtering with certain umasks. in general the filtering support is encoded into the umask name, e.g., NID_OPCODE supports both node and opcode filtering. for instance:

UNC_C_TOR_INSERTS:NID_OPCODE:OPC_RFO:nf=1

iykyk πŸ’…


🫢 AUTHORS 🫢

Stephane Eranian <eranian@gmail.com>


and that's the whole page, bestie πŸ’– this was the LIBPFM(3) page from August, 2012, part of the Linux Programmer's Manual β€” no cap, that's genuinely the source and date. go forth and count your C-Box cycles responsibly πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from