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 'start' field 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>
Link: https://lore.kernel.org/r/20240404175716.1225482-10-namhyung@kernel.org
Cc: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Cc: <linux-perf-users@vger.kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
8c004c7a 6f94a72d

+6 -6
+5 -5
tools/perf/util/annotate.c
··· 909 909 args.arch = arch; 910 910 args.ms = *ms; 911 911 if (annotate_opts.full_addr) 912 - notes->start = map__objdump_2mem(ms->map, ms->sym->start); 912 + notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); 913 913 else 914 - notes->start = map__rip_2objdump(ms->map, ms->sym->start); 914 + notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); 915 915 916 916 return symbol__disassemble(sym, &args); 917 917 } ··· 1456 1456 annotate_opts.full_addr = !annotate_opts.full_addr; 1457 1457 1458 1458 if (annotate_opts.full_addr) 1459 - notes->start = map__objdump_2mem(ms->map, ms->sym->start); 1459 + notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); 1460 1460 else 1461 - notes->start = map__rip_2objdump(ms->map, ms->sym->start); 1461 + notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); 1462 1462 1463 1463 annotation__update_column_widths(notes); 1464 1464 } ··· 1766 1766 int color = -1; 1767 1767 1768 1768 if (!annotate_opts.use_offset) 1769 - addr += notes->start; 1769 + addr += notes->src->start; 1770 1770 1771 1771 if (!annotate_opts.use_offset) { 1772 1772 printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr);
+1 -1
tools/perf/util/annotate.h
··· 270 270 int nr_entries; 271 271 int nr_asm_entries; 272 272 int max_jump_sources; 273 + u64 start; 273 274 struct { 274 275 u8 addr; 275 276 u8 jumps; ··· 313 312 }; 314 313 315 314 struct LOCKABLE annotation { 316 - u64 start; 317 315 struct annotated_source *src; 318 316 struct annotated_branch *branch; 319 317 };