LIBPFM(3)

πŸ’– LIBPFM(3) β€” the girlies' guide to the Sandy Bridge uncore PMU πŸ’–

okay so bestie, welcome to LIBPFM(3), from the Linux Programmer's Manual. this one's a deep cut but it's so worth it, i promise. grab a boba, we're going in πŸ§‹βœ¨


🌸 NAME 🌸

libpfm_intel_snb_unc β€” the support page for the Intel Sandy Bridge uncore PMU. that's it. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

first things first, you gotta pull in the header, no cap:

#include <perfmon/pfmlib.h>

and here's who we're actually talking about:

PMU name: snb_unc_cbo0, snb_unc_cbo1, snb_unc_cbo2, snb_unc_cbo3
PMU desc: Intel Sandy Bridge C-box uncore

four whole PMUs, bestie. four. one per core. periodt πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so the library supports the Intel Sandy Bridge client part β€” that's model 42 β€” and specifically its uncore PMU. rn the support is limited to the Coherency Box (aka the C-Box) for up to 4 physical cores. lowkey humble but highkey iconic.

here's the tea tho: every physical core has its own C-Box, and that's the little communication bestie it uses to talk to the L3 cache. all the C-boxes support the same set of events β€” matching outfits, love that for them 🫢 β€” but there's one exception. the Core 0 C-box (snb_unc_cbo0) also supports an extra uncore clock ticks event:

  • UNC_CLOCKTICKS

so yeah, core 0 is the main character, obviously. πŸ‘‘


πŸ’… MODIFIERS πŸ’…

these are the little glow-ups you can slap onto the Intel Sandy Bridge C-Box uncore PMU:

  • i β€” inverts the meaning of the event, bestie. the counter now counts cycles where the event is not happening. it's a boolean modifier, so it's a yes/no situation, no in-between. πŸ™ˆ
  • e β€” enables edge detection, aka "count only when something actually changes" β€” specifically, when there's a state transition from zero occurrences of the event to at least one. ⚠️ important: this modifier must be combined with a counter mask modifier (m) with a value greater or equal to one. it's also a boolean modifier.
  • c β€” sets the counter mask value. the mask is a threshold, and the counter counts the number of cycles where the number of occurrences of the event is greater or equal to that threshold. this one's an integer modifier with values in the range [0:255]. slay, math.
okay so heads up, this next bit is real: both UNC_CBO_CACHE_LOOKUP and UNC_CBO_XSNP_RESPONSE require two umasks to even be valid. for UNC_CBO_CACHE_LOOKUP, the first umask has to be one of the MESI state umasks, and the second has to be one of the filters. for UNC_CBO_XSNP_RESPONSE, the first umask has to be one of the snoop types, and the second has to be one of the filters. no second umask = no vibes. πŸ’€

🌈 AUTHORS 🌈

this masterpiece was brought to you by Stephane Eranian <eranian@gmail.com> πŸ’–


and that's the whole page, bestie!! πŸŽ€ this was from the August, 2012 era, sourced from LIBPFM(3) β€” yes we stan a vintage queen. go forth and count your uncore events, iykyk βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from