STRUCT PRINT_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct print_state(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” this page is literally all about struct print_state, and no cap it's a glow-up moment for your perf tooling. 🫢

πŸ’– NAME πŸ’–

struct print_state β€” the state and configuration that gets passed to the default_print functions. it's giving "carry-on luggage for your print job." πŸŽ€

🌸 SYNOPSIS 🌸

struct print_state {
    FILE *fp;
    char *pmu_glob;
    char *event_glob;
    bool name_only;
    bool desc;
    bool long_desc;
    bool deprecated;
    bool detailed;
    bool metrics;
    bool metricgroups;
    bool exclude_abi;
    char *last_topic;
    char *last_metricgroups;
    struct strlist *visited_metrics;
 };

yes bestie, that indentation on the closing brace is canon, we keep it exactly like that πŸ’…


πŸ¦‹ Members πŸ¦‹

  • fp β€” the File we write output to. that's the whole vibe, it's where the words go. πŸ“
  • pmu_glob β€” optionally restricts PMU and metric matching to the PMU name, or to the debugfs subsystem name. so like, a little filter for who gets to be matched. πŸ”₯
  • event_glob β€” an optional pattern matching glob. wildcard szn fr fr. ⭐
  • name_only β€” print event or metric names only. no extras, no lore, just the names. πŸŽ€
  • desc β€” print the event or metric description. the paragraph, the context, the backstory. πŸ’œ
  • long_desc β€” print a longer event or metric description. it's the description but it ate. 😭
  • deprecated β€” print deprecated events or metrics. yes we still print them, they're just old, ok don't be mean to them. πŸ’€
  • detailed β€” print extra information on the perf event, like names and expressions used internally by events. the behind-the-scenes tea β˜•
  • metrics β€” controls printing of metric and metric groups. πŸ‘‘
  • metricgroups β€” controls printing of metric and metric groups. (yes bestie, same description as metrics, that's literally what the page says, we do not editorialize πŸ’…)
  • exclude_abi β€” exclude PMUs with types less than PERF_TYPE_MAX except PERF_TYPE_RAW. very specific, very demure. 🌸
  • last_topic β€” the last printed event topic. a little memory of where we've been 🧚
  • last_metricgroups β€” the last printed metric group. same energy, metric edition. 🌈
  • visited_metrics β€” metrics that are printed, kept around to avoid duplicates. it's a guest list and everybody on it already got in. πŸ™ˆ

πŸŽ€ SEE ALSO πŸŽ€

  • Kernel file ./tools/perf/builtin-list.c β€” go read it, iykyk πŸ’–

ngl this whole struct is just "what do you want printed and to where" β€” but dressed up iconic. periodt. ✨

and that's the whole page bestie!! shoutout to ./tools/perf for shipping this, and this little beauty is dated October 2026 β€” mwah, love that for us πŸ’…πŸ«Ά

πŸ“¦ where this page comes from