STRUCT PRINT_STATE(9)
β¨ 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 asmetrics, that's literally what the page says, we do not editorialize π )exclude_abiβ exclude PMUs with types less thanPERF_TYPE_MAXexceptPERF_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms