STRUCT PERF_DATA_FILE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct perf_data_file(9) πŸ’–

okay bestie, we’re in the Kernel API Manual and this one is lowkey iconic: struct perf_data_file is literally a wrapper around a file that’s used for perf.data reading or writing, and it’s generally part of struct perf_data. no cap, it’s the file-handling sidekick πŸ’…


✨ NAME ✨

struct perf_data_file β€” a wrapper around a file used for perf.data reading or writing. Generally part of struct perf_data. 🫢

🌸 SYNOPSIS 🌸

       struct perf_data_file {
           char *path;
           union {
             int fd;
             FILE *fptr;
           };
           unsigned long    size;
           bool use_stdio;
        };

πŸŽ€ Members πŸŽ€

  • path β€” path of the file, fr fr. It’s generally a copy of perf_data.path, but if it’s a directory, it’s the file within that directory. πŸ—‚οΈ
  • {unnamed_union} β€” anonymous. yep, that’s the whole vibe. πŸ«₯
  • fd β€” the file descriptor for reads/writes. valid if use_stdio is false. πŸ”₯
  • fptr β€” the stdio FILE. valid if use_stdio is true, and currently it’s just pipes in perf inject. 🧚
  • size β€” size of the file when it was opened. πŸ“
  • use_stdio β€” use buffered stdio operations. πŸ’Ύ

🌈 SEE ALSO 🌈

  • Kernel file ./tools/perf/util/data.h
  • struct perf_data(9)

mwah πŸ’‹ signing off from the ./tools/perf/util source/version, dated October 2026 β€” this was literally struct perf_data_file(9), and yes bestie, she ate πŸ‘‘βœ¨

πŸ“¦ where this page comes from