STRUCT PERF_MMAP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to the struct perf_mmap(9) glow-up πŸ’… this one lives in the Kernel API Manual, and it's basically the little receipt for perf's ring buffer mmap details. it's short, it's sweet, it's giving "entry-level struct with main character energy" πŸŽ€ let's get into it.


🌸 NAME 🌸

struct perf_mmap β€” the whole vibe of perf's ring buffer mmap details ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the actual struct, and yes you're gonna read every line of it because we don't skip πŸ’–

struct perf_mmap {
    void *base;
    int mask;
    int fd;
    struct perf_cpu          cpu;
    refcount_t refcnt;
    u64 prev;
    u64 start;
    u64 end;
    bool overwrite;
    u64 flush;
    libperf_unmap_cb_t unmap_cb;
    void *event_copy;
    size_t event_copy_sz;
    struct perf_mmap        *next;
 };

look at all those fields just sitting there, living their truth 🌈 base, mask, fd, cpu, refcnt, prev, start, end, overwrite, flush, unmap_cb, event_copy, event_copy_sz, next β€” iconic lineup, no notes πŸ‘‘


🧚 Members 🧚

yep, this section is literally just titled Members. short king behavior πŸ’€


πŸ’œ Description πŸ’œ

here's the one (1) description this page actually gives us, and we're gonna treat it with the respect it deserves:

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

that's it, that's the note 🫢 like, that's the entire description section. ngl she's mysterious. we love a withholding icon 😭

bestie, real talk: this page only documents refcnt. don't go making up lore for the other fields β€” if it's not written here, it's not written here πŸ™ˆ

⭐ SEE ALSO ⭐

go look at the kernel file, that's where the rest of the story lives:

  • Kernel file ./tools/lib/perf/include/internal/mmap.h πŸ”₯

and that's the whole page, bestie! πŸŽ€ this adorable little drop came from ./tools/lib/perf/include/internal, dated October 2026 β€” screenshot it, cite it, send it to the group chat, periodt πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from