diff options
author | Namhyung Kim <namhyung@kernel.org> | 2024-04-02 22:33:03 -0700 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2024-04-03 14:54:57 -0700 |
commit | 6f3fcd653e17a8e090c73344b62e2afc8a521e19 (patch) | |
tree | 1f1361ac850f099a5c60f65a889b86da2b560e5e | |
parent | 045379e9fe3e102adce630c126eb7efb79cd7985 (diff) | |
download | linux-perf-perf/annotate-diet-v3.tar.gz |
perf annotate: Move start field struct to annotated_sourceperf/annotate-diet-v3
It's only used in perf annotate output which means functions with actual
samples. No need to consume memory for every symbol (annotation).
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-rw-r--r-- | tools/perf/util/annotate.c | 10 | ||||
-rw-r--r-- | tools/perf/util/annotate.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 5f79ae0bccfd3..4db49611c3868 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -909,9 +909,9 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel, args.arch = arch; args.ms = *ms; if (annotate_opts.full_addr) - notes->start = map__objdump_2mem(ms->map, ms->sym->start); + notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); else - notes->start = map__rip_2objdump(ms->map, ms->sym->start); + notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); return symbol__disassemble(sym, &args); } @@ -1456,9 +1456,9 @@ void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *m annotate_opts.full_addr = !annotate_opts.full_addr; if (annotate_opts.full_addr) - notes->start = map__objdump_2mem(ms->map, ms->sym->start); + notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); else - notes->start = map__rip_2objdump(ms->map, ms->sym->start); + notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); annotation__update_column_widths(notes); } @@ -1766,7 +1766,7 @@ static void __annotation_line__write(struct annotation_line *al, struct annotati int color = -1; if (!annotate_opts.use_offset) - addr += notes->start; + addr += notes->src->start; if (!annotate_opts.use_offset) { printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr); diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index d22b9e9a2fadc..d5c821c22f79e 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -270,6 +270,7 @@ struct annotated_source { int nr_entries; int nr_asm_entries; int max_jump_sources; + u64 start; struct { u8 addr; u8 jumps; @@ -312,7 +313,6 @@ struct annotated_branch { }; struct LOCKABLE annotation { - u64 start; struct annotated_source *src; struct annotated_branch *branch; }; |