STRUCT ANNOTATED_SOURCE(9)
π NAME π
struct annotated_source β bestie, when your symbols have hits, this is the little struct that gets attached to them, inside the annotation β¨
π¦ SYNOPSIS π¦
struct annotated_source {
struct list_head source;
struct sym_hist *histograms;
struct hashmap *samples;
int nr_histograms;
int nr_events;
int nr_entries;
int nr_asm_entries;
int max_jump_sources;
bool tried_source;
u64 start;
struct {
u8 addr;
u8 jumps;
u8 target;
u8 min_addr;
u8 max_addr;
u8 max_ins_name;
u16 max_line_len;
} widths;
};
π Members π
sourceβ the list head forannotated_line(which is embeded indisasm_line, okurrr) πhistogramsβ an array of symbol histograms, one per event, holding onto the total number of samples and the period πΈsamplesβ a hash map ofsym_hist_entry, keyed by event index plus the offset in the symbol πΊοΈnr_histogramsβ lowkey this might not equalevsel->evlist->core.nr_entriesif you've got more than a group in a evlist, because then we want to see each group separately β that's literally whysymbol__annotate2setssrc->nr_histogramstoevsel->nr_membersπ§nr_eventsβ number of events in the current output β¨nr_entriesβ number ofannotated_linein the source list πnr_asm_entriesβ number ofannotated_linethat actually have a real asm instruction in the source list πmax_jump_sourcesβ the maximum number of jump instructions all targeting the same instruction, no cap πΉwidthsβ precalculated width of each column in the TUI output, so the table doesn't wobble on you π
π Description π
So here's the vibe: the disasm_lines get allocated, percentages get calculated, and everything gets sorted by percentage right when the annotation is about to be presented. Which means those percentages are for one of the entries in the histogram array β i.e. for the event/counter currently being presented, not some mix of everything. Main character energy only π
And then it gets deallocated right after symbol__{tui,tty,etc}_annotate returns. Gone. Poof. π«Ά
π₯ SEE ALSO π₯
Kernel file ./tools/perf/util/annotate.h, plus the whole friend group: struct sym_hist(9), struct cyc_hist(9), struct annotated_branch(9), struct annotated_op_loc(9), struct annotated_insn_loc(9), struct annotated_basic_block(9) β
ngl bestie, go read those other structs too, iykyk π
That's the whole page, mwah π β brought to you from ./tools/perf/util, dated October 2026, slay πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms