STRUCT HW_PERF_EVENT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

Welcome to the struct hw_perf_event(9) page from the Kernel API Manual, bestie. This is where the performance event hardware details live, and it's a whole struct situation. πŸ’…


🌸 NAME 🌸

struct hw_perf_event β€” performance event hardware details. That's the name, no cap. It's the struct that holds the hardware-side details for a performance event.


✨ SYNOPSIS ✨

Okay so the synopsis is literally this struct definition. Every brace, every semicolon, and every preprocessor line is staying exactly as-is, bestie β€” yes, even the #endif ; with the space. Periodt. πŸ’€

struct hw_perf_event {
  #ifdef CONFIG_PERF_EVENTS;
    union {
      struct {
        u64 config;
        u64 config1;
        u64 last_tag;
        u64 dyn_constraint;
        unsigned long   config_base;
        unsigned long   event_base;
        int event_base_rdpmc;
        int idx;
        int last_cpu;
        int flags;
        struct hw_perf_event_extra extra_reg;
        struct hw_perf_event_extra branch_reg;
      };
      struct {
        u64 aux_config;
        unsigned int    aux_paused;
      };
      struct {
        struct hrtimer  hrtimer;
      };
      struct {
        struct list_head        tp_list;
      };
      struct {
        u64 pwr_acc;
        u64 ptsc;
      };
  #ifdef CONFIG_HAVE_HW_BREAKPOINT;
      struct {
        struct arch_hw_breakpoint       info;
        struct rhlist_head              bp_list;
      };
  #endif;
      struct {
        u8 iommu_bank;
        u8 iommu_cntr;
        u16 padding;
        u64 conf;
        u64 conf1;
      };
    };
    struct task_struct              *target;
    void *addr_filters;
    unsigned long                   addr_filters_gen;
  #define PERF_HES_STOPPED                0x01;
  #define PERF_HES_UPTODATE               0x02;
  #define PERF_HES_ARCH                   0x04;
    int state;
    local64_t prev_count;
    u64 sample_period;
    union {
      struct {
        u64 last_period;
        local64_t period_left;
      };
      struct {
        u64 saved_metric;
        u64 saved_slots;
      };
    };
    u64 interrupts_seq;
    u64 interrupts;
    u64 freq_time_stamp;
    u64 freq_count_stamp;
  #endif ;
 };

πŸ‘― MEMBERS πŸ‘―

The manual's Members list is giving anonymous-union-and-struct realness: every entry is literally anonymous, bestie. Here's the full roster in order so nobody gets left on read:

  1. {unnamed_union} β€” anonymous
  2. {unnamed_struct} β€” anonymous
  3. {unnamed_struct} β€” anonymous
  4. {unnamed_struct} β€” anonymous
  5. {unnamed_struct} β€” anonymous
  6. {unnamed_struct} β€” anonymous
  7. {unnamed_struct} β€” anonymous
  8. {unnamed_struct} β€” anonymous
  9. {unnamed_union} β€” anonymous
  10. {unnamed_struct} β€” anonymous
  11. {unnamed_struct} β€” anonymous

πŸ‘€ SEE ALSO πŸ‘€

First up, the kernel file: ./include/linux/perf_event.h β€” that's home base. Then the cross-reference besties:

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

Cute sign-off szn: source/version ./include/linux, dated October 2026. Byeee, go read kernel headers responsibly πŸ’–πŸ«Άβœ¨

πŸ“¦ where this page comes from