STRUCT PERF_PMU_FORMAT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct perf_pmu_format(9) β€” kernel API manual, bestie edition ✨

Okay so picture this: it's a kernel API manual page, right, and it's here to explain struct perf_pmu_format β€” the little icon that holds the values from a format file that got read from <sysfs>/devices/cpu/format/ and is now chilling inside struct perf_pmu. Yeah. She's a keeper. πŸŽ€


✨ SYNOPSIS ✨

struct perf_pmu_format {
    struct list_head list;
    unsigned long bits[BITS_TO_LONGS( PERF_PMU_FORMAT_BITS)];
    char *name;
    u16 value;
    bool loaded;
 };
ngl that array declaration is giving BITS_TO_LONGS( PERF_PMU_FORMAT_BITS) with the space and everything β€” copy it exactly as-is, bestie, we do not editorialize in code blocks. πŸ’€

🌸 Members 🌸

  • list β€” this is her element on the list that lives inside struct perf_pmu. She's on a list! She's booked and busy! πŸ¦‹
  • bits β€” the config bits that this format value actually sets. Which ones? These ones. Specifically these. πŸ‘‘
  • name β€” the modifier/file name, literally just the name, no notes. ✨
  • value β€” which config value this format relates to. Supported values run from PERF_PMU_FORMAT_VALUE_CONFIG to PERF_PMU_FORMAT_VALUE_CONFIG_END. That's the range, don't go outside it. πŸ™ˆ
  • loaded β€” has the contents been loaded/parsed? A whole boolean for that question. Yes or no. That's the vibe check. ⭐

πŸ’– Description πŸ’–

So like, a real example, because examples ate:

Say the contents of <sysfs>/devices/cpu/format/event is literally the string "config:0-7". When that gets represented here, you get:

  • name="event"
  • value=PERF_PMU_FORMAT_VALUE_CONFIG
  • and bits 0 to 7 will be set

That's it. That's the whole transformation. She read the file, she parsed it, she set the bits, she slayed. πŸ’…πŸ”₯


🌈 SEE ALSO 🌈

  • Kernel file ./tools/perf/util/pmu.h
  • struct perf_pmu(9)

🫢 That's a wrap, bestie! This page came from ./tools/perf/util, dated October 2026, and it's the struct perf_pmu_format(9) page β€” go forth and read your format files with main character energy. πŸ’œπŸŽ€

πŸ“¦ where this page comes from