STRUCT PERF_EVENT_CONTEXT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct perf_event_context(9) 🌸

okay bestie, so this is a page out of the Kernel API Manual β€” the manual name, yeah β€” and today's main character is struct perf_event_context, aka the event context structure. pull up a chair, we're doing kernel structs πŸ’…


✨ NAME ✨

struct perf_event_context β€” literally the event context structure. that's the whole name, no cap πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

here she is, in all her glory, bestie β€” copy it exactly, don't you dare touch a character:

struct perf_event_context {
    raw_spinlock_t lock;
    struct mutex                    mutex;
    struct list_head                pmu_ctx_list;
    struct perf_event_groups        pinned_groups;
    struct perf_event_groups        flexible_groups;
    struct list_head                event_list;
    int nr_events;
    int nr_user;
    int is_active;
    int nr_stat;
    int nr_freq;
    int rotate_disable;
    refcount_t refcount;
    struct task_struct              *task;
    struct perf_time_ctx            time;
    struct perf_time_ctx            timeguest;
    struct perf_event_context       *parent_ctx;
    u64 parent_gen;
    u64 generation;
    int pin_count;
  #ifdef CONFIG_CGROUP_PERF;
    int nr_cgroups;
  #endif;
    struct rcu_head                 rcu_head;
    local_t nr_no_switch_fast;
 };

like… look at her. the alignment. the way she's formatted. she ate and left absolutely no crumbs πŸ“ (and yes, the #ifdef CONFIG_CGROUP_PERF; really does have those semicolons hanging out β€” we do not fix it, we respect it, periodt)


πŸŽ€ Members πŸŽ€

this section is literally just sitting there with its heading on and no content underneath, so we're not gonna invent a member breakdown out of thin air β€” that would be lying and lying is not the vibe πŸ™ˆ if you want the details, that's what the header file is for, iykyk.


πŸ’– Description πŸ’–

so what is she? the page says it plain and simple: struct perf_event_context is used as a container for task events and CPU events as well. that's it, that's the whole description β€” container energy, holding her little events, minding her business πŸ‘‘


🌈 SEE ALSO 🌈

go read these, bestie, they're all right there in the kernel file ./include/linux/perf_event.h:

  • struct hw_perf_event(9)
  • struct pmu(9)
  • struct perf_addr_filter(9)
  • struct perf_addr_filters_head(9)
  • struct perf_event(9)
  • struct perf_ctx_data(9)

collect them all like little trading cards, fr fr 🫢

heads up bestie: everything above is straight from the page β€” i'm not adding extra lore, no guessing, no made-up behaviour. facts stay facts, only the vibe is new πŸ’œ

okay that's the whole page, you're officially educated ✨ this little gem lives over in ./include/linux, dated October 2026, and she's page struct perf_event_context(9) of the Kernel API Manual β€” mwah, slay, go read a header file for me πŸ§šπŸ’–

πŸ“¦ where this page comes from