Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf annotate: Move 'max_jump_sources' struct to 'struct annotated_source'

It's only used in 'perf annotate' output which means functions with actual
samples. No need to consume memory for every symbol ('struct annotation').

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240404175716.1225482-8-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
f6b18aba a46acc45

+7 -5
+1 -1
tools/perf/ui/browsers/annotate.c
··· 49 49 50 50 if (current && (!browser->use_navkeypressed || browser->navkeypressed)) 51 51 return HE_COLORSET_SELECTED; 52 - if (nr == notes->max_jump_sources) 52 + if (nr == notes->src->max_jump_sources) 53 53 return HE_COLORSET_TOP; 54 54 if (nr > 1) 55 55 return HE_COLORSET_MEDIUM;
+3 -3
tools/perf/util/annotate.c
··· 1373 1373 if (target == NULL) 1374 1374 continue; 1375 1375 1376 - if (++target->jump_sources > notes->max_jump_sources) 1377 - notes->max_jump_sources = target->jump_sources; 1376 + if (++target->jump_sources > notes->src->max_jump_sources) 1377 + notes->src->max_jump_sources = target->jump_sources; 1378 1378 } 1379 1379 } 1380 1380 ··· 1432 1432 notes->src->widths.addr = notes->src->widths.target = 1433 1433 notes->src->widths.min_addr = hex_width(symbol__size(sym)); 1434 1434 notes->src->widths.max_addr = hex_width(sym->end); 1435 - notes->src->widths.jumps = width_jumps(notes->max_jump_sources); 1435 + notes->src->widths.jumps = width_jumps(notes->src->max_jump_sources); 1436 1436 notes->src->widths.max_ins_name = annotation__max_ins_name(notes); 1437 1437 } 1438 1438
+3 -1
tools/perf/util/annotate.h
··· 250 250 * @nr_entries: Number of annotated_line in the source list. 251 251 * @nr_asm_entries: Number of annotated_line with actual asm instruction in the 252 252 * source list. 253 + * @max_jump_sources: Maximum number of jump instructions targeting to the same 254 + * instruction. 253 255 * @widths: Precalculated width of each column in the TUI output. 254 256 * 255 257 * disasm_lines are allocated, percentages calculated and all sorted by percentage ··· 267 265 int nr_histograms; 268 266 int nr_entries; 269 267 int nr_asm_entries; 268 + int max_jump_sources; 270 269 struct { 271 270 u8 addr; 272 271 u8 jumps; ··· 312 309 struct LOCKABLE annotation { 313 310 u64 start; 314 311 int nr_events; 315 - int max_jump_sources; 316 312 struct annotated_source *src; 317 313 struct annotated_branch *branch; 318 314 };