summaryrefslogtreecommitdiff
path: root/tools/perf/util
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2024-04-06 00:18:00 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-04-12 18:02:05 +0300
commit0235abd89feaf29fe67d3abbe2c18b7119503537 (patch)
treed0d40f901090a98aad06a3466e232c11f5e9eb25 /tools/perf/util
parent879ebf3c830dba437781d034c536af53b0bff0c0 (diff)
downloadlinux-0235abd89feaf29fe67d3abbe2c18b7119503537.tar.xz
perf annotate: Get rid of symbol__ensure_annotate()
Now symbol__annotate() is reentrant and it doesn't need to remove non-instruction lines. Let's get rid of symbol__ensure_annotate() and call symbol__annotate() directly. Also we can use it to get the arch pointer instead of calling evsel__get_arch() directly. Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> 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/20240405211800.1412920-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/annotate.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 5d9b79559c73..11da27801d88 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -2157,14 +2157,6 @@ int annotate_get_insn_location(struct arch *arch, struct disasm_line *dl,
return 0;
}
-static void symbol__ensure_annotate(struct map_symbol *ms, struct evsel *evsel)
-{
- struct annotation *notes = symbol__annotation(ms->sym);
-
- if (list_empty(&notes->src->source))
- symbol__annotate(ms, evsel, NULL);
-}
-
static struct disasm_line *find_disasm_line(struct symbol *sym, u64 ip,
bool allow_update)
{
@@ -2339,14 +2331,12 @@ struct annotated_data_type *hist_entry__get_data_type(struct hist_entry *he)
return NULL;
}
- if (evsel__get_arch(evsel, &arch) < 0) {
+ /* Make sure it has the disasm of the function */
+ if (symbol__annotate(ms, evsel, &arch) < 0) {
ann_data_stat.no_insn++;
return NULL;
}
- /* Make sure it runs objdump to get disasm of the function */
- symbol__ensure_annotate(ms, evsel);
-
/*
* Get a disasm to extract the location from the insn.
* This is too slow...