diff options
author | Namhyung Kim <namhyung@kernel.org> | 2025-08-15 20:16:34 -0700 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-08-28 12:35:42 -0300 |
commit | 53a61a6ca279165dd51f4e3bb5f8b11544915138 (patch) | |
tree | 02609b017a1dfdd8547feafdee3ef7643e2c135d /tools/perf/util/annotate.c | |
parent | d69f56545ed53342204136b66b4d10ba80103d14 (diff) |
perf annotate: Add dso__debuginfo() helper
It'd be great if it can get the correct debug information using DSO
build-Id not just the path name. Instead of adding new callsites of
debuginfo__new(), let's add dso__debuginfo() which can hide the access
using the pathname and help the future conversion.
Suggested-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.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/20250816031635.25318-12-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r-- | tools/perf/util/annotate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index ea68b32da7ce..bea3457a0063 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1270,7 +1270,7 @@ int hist_entry__annotate_printf(struct hist_entry *he, struct evsel *evsel) apd.addr_fmt_width = annotated_source__addr_fmt_width(¬es->src->source, notes->src->start); evsel__get_arch(evsel, &apd.arch); - apd.dbg = debuginfo__new(filename); + apd.dbg = dso__debuginfo(dso); list_for_each_entry(pos, ¬es->src->source, node) { int err; @@ -1375,7 +1375,7 @@ static int symbol__annotate_fprintf2(struct symbol *sym, FILE *fp, if (annotate_opts.code_with_type) { evsel__get_arch(apd->evsel, &apd->arch); - apd->dbg = debuginfo__new(dso__long_name(map__dso(apd->he->ms.map))); + apd->dbg = dso__debuginfo(map__dso(apd->he->ms.map)); } list_for_each_entry(al, ¬es->src->source, node) { @@ -2882,7 +2882,7 @@ struct annotated_data_type *hist_entry__get_data_type(struct hist_entry *he) di_cache.dso = dso__get(map__dso(ms->map)); debuginfo__delete(di_cache.dbg); - di_cache.dbg = debuginfo__new(dso__long_name(di_cache.dso)); + di_cache.dbg = dso__debuginfo(di_cache.dso); } if (di_cache.dbg == NULL) { |