STRUCT HIST_ENTRY(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct hist_entry β€” the histogram entry, bestie. This is the kernel API manual, section 9, and we're about to get so into it. ✨


✨ SYNOPSIS ✨

struct hist_entry {
    struct rb_node          rb_node_in;
    struct rb_node          rb_node;
    union {
      struct list_head node;
      struct list_head head;
    } pairs;
    struct he_stat          stat;
    struct he_stat          *stat_acc;
    struct he_mem_stat      *mem_stat;
    struct map_symbol       ms;
    struct thread           *thread;
    struct comm             *comm;
    struct namespace_id     cgroup_id;
    u64 cgroup;
    u64 ip;
    u64 transaction;
    u64 code_page_size;
    u64 weight;
    u64 ins_lat;
    u64 weight3;
    s32 socket;
    s32 cpu;
    int parallelism;
    int mem_type_off;
    u8 cpumode;
    u8 depth;
    struct simd_flags       simd_flags;
    bool dummy;
    bool leaf;
    char level;
    filter_mask_t filtered;
    u16 callchain_size;
    union {
      struct hist_entry_diff  diff;
      struct {
        u16 row_offset;
        u16 nr_rows;
        bool init_have_children;
        bool unfolded;
        bool has_children;
        bool has_no_entry;
      };
    };
    char *srcline;
    char *srcfile;
    struct symbol           *parent;
    struct branch_info      *branch_info;
    long time;
    struct hists            *hists;
    struct mem_info         *mem_info;
    struct block_info       *block_info;
    struct kvm_info         *kvm_info;
    void *raw_data;
    u32 raw_size;
    int num_res;
    struct res_sample       *res_samples;
    void *trace_output;
    struct perf_hpp_list    *hpp_list;
    struct hist_entry       *parent_he;
    struct hist_entry_ops   *ops;
    struct annotated_data_type *mem_type;
    union {
      struct {
        struct rb_root_cached   hroot_in;
        struct rb_root_cached   hroot_out;
      };
      struct rb_root  sorted_chain;
    };
    struct callchain_root   callchain[0];
 };

Like, look at her. That's a lot of fields and honestly? She's carrying the whole histogram on her back. πŸ’…


🫢 Members 🫢

Okay so here's the member-by-member breakdown, because we do not skip anything in this house:

  • weight3 β€” on x86 this one holds retire_lat, and on powerpc it holds p_stage_cyc. Same field, different personality depending on the architecture. iykyk. πŸ¦‹
  • {unnamed_union} β€” anonymous. That's it, that's the whole note. She's mysterious. She doesn't need a name. πŸŽ€
  • {unnamed_struct} β€” anonymous. Same energy. Iconic behaviour honestly. ✨
  • {unnamed_union} β€” anonymous. (Yes, there's another one. We stay unbothered.) πŸ’œ
  • {unnamed_struct} β€” anonymous. Fourth anonymous member, still serving looks. πŸ‘‘

🌸 Description 🌸

Okay bestie, this is the part where the manpage actually explains the mystery anonymous stuff, and it's lowkey the best part:

  • row_offset β€” offset from the first callchain expanded to appear on screen. Think of it as "which row do we start showing you from". πŸ“
  • nr_rows β€” rows expanded in callchain, and it gets recalculated on folding/unfolding. So every time you collapse or expand stuff, this number gets a fresh little glow-up. πŸ”„

That's literally the whole Description section β€” no cap, no filler. 🫢


πŸŽ€ SEE ALSO πŸŽ€

Kernel file ./tools/perf/util/hist.h β€” go read the header, it's right there, it's giving source-of-truth energy. πŸ“š


Heads up bestie: this page is short and sweet, so don't go inventing extra behaviour for any of these fields. Everything you need is above. πŸ’€

Mwah πŸ’‹ β€” signed off from ./tools/perf/util , dated October 2026. Struct hist_entry, section 9, out. 🧚

πŸ“¦ where this page comes from