STRUCT PERF_FILE_HEADER(9)
๐ struct perf_file_header(9) ๐
ok so bestie, welcome to the struct perf_file_header(9) page from the Kernel API Manual โ this is the little on-disk glow-up that heads up a perf file, and honestly? it's giving โจ*manifest*โจ energy. let's get into it ๐
๐ธ NAME ๐ธ
struct perf_file_header โ the header representation on disk, no cap. this is literally the first thing that shows up when your perf file wakes up and chooses main character energy ๐
โจ SYNOPSIS โจ
struct perf_file_header {
u64 magic;
u64 size;
u64 attr_size;
struct perf_file_section attrs;
struct perf_file_section data;
struct perf_file_section event_types;
unsigned long adds_features[BITS_TO_LONGS( HEADER_FEAT_BITS)];
};
like, look at her. seven whole fields. iconic. ๐
๐ฆ Members ๐ฆ
okay so let's go field by field because every single one matters, fr fr ๐ซถ
magicโ holds"PERFILE2". that's the vibe check at the door โ if this doesn't match, the file is not getting in ๐ฅsizeโ the size of this header, literallysizeof(struct perf_file_header). she knows her own measurements ๐attr_sizeโ the size of the attrs entries, and that'ssizeof(struct perf_event_attr) + sizeof(struct perf_file_section). yes, both. do the math, don't skip a term ๐งฎโจattrsโ the offset and size of the file section holding the attributes. that's where the attr crew lives ๐dataโ the offset and size of the file section holding regular event data. the actual main event data, literally ๐event_typesโ ignored. yeah. she's just there. not me pointing at her ๐ (the manpage said ignored, so bestie, we ignore her ๐)adds_featuresโ a bitmap of features. important detail: the features are immediately after the data section. don't go hunting elsewhere, they're right there ๐ต๏ธโโ๏ธโญ
๐ SEE ALSO ๐
- Kernel file
./tools/perf/util/header.hโ go read the source, iykyk ๐๐
and that's the whole page, bestie!! ๐ no notes. now go forth and parse some headers, you absolute icon ๐
with love from the Kernel API Manual, struct perf_file_header(9), brought to you by ./tools/perf/util ๐ซถ โ dropped October 2026, mark your calendars ๐โจ
๐ฆ 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