STRUCT MMAP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, welcome to struct mmap(9) β€” literally the manual page for struct mmap, and it's all about perf's ring buffer mmap details. that's the whole vibe. πŸ’…

this one lives in the Kernel API Manual, so yes, we're being fancy today. ✨


✨ SYNOPSIS ✨

here's the struct in all its glory, copied exactly so you don't have to squint, no cap:

struct mmap {
    struct perf_mmap        core;
    struct auxtrace_mmap auxtrace_mmap;
  #ifdef HAVE_AIO_SUPPORT;
    struct {
      void **data;
      struct aiocb     *cblocks;
      struct aiocb     **aiocb;
      int nr_cblocks;
    } aio;
  #endif;
    struct mmap_cpu_mask    affinity_mask;
    void *data;
    struct perf_data_file *file;
    struct zstd_data      zstd_data;
 };

like… look at it. the conditional compilation? the nested anonymous struct? it's giving structured. it's giving organized. we stan a well-formed struct. πŸŽ€


🫢 MEMBERS 🫢

(yeah this section is just the header doing its thing β€” the actual tea is served downstairs πŸ‘‡)


πŸ’… DESCRIPTION πŸ’…

  • refcnt β€” e.g. code using PERF_EVENT_IOC_SET_OUTPUT to share this.

and honestly? that's the note. it's a little one-liner but it matters β€” if you're the kind of dev passing PERF_EVENT_IOC_SET_OUTPUT around to share this thing, then refcnt is the member you care about. periodt. 🫑

fr fr though, don't sleep on the tiny descriptions β€” they're short but they're load-bearing. read them twice, bestie. πŸ’œ

πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./tools/perf/util/mmap.h β€” go read the source, it's right there, iykyk πŸ¦‹

okay that's the page!! so iconic, so brief, and brought to you by the fine people over in ./tools/perf/util, dated October 2026 β€” mwah, love that for us πŸ’–πŸŒΈπŸŽ€

πŸ“¦ where this page comes from