summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-04-24 10:32:30 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-04-26 12:47:08 -0400
commitcc5f02f2be8d3354986bad5703ee8a983872f140 (patch)
tree0ed511be0a3c982637b5a83b9b5052606c80f05e /tools/perf/builtin-script.c
parent4546263d72e22ea84b49dafad26d8ca679d5e83d (diff)
perf script: Use thread__find_symbol() instead of ad-hoc equivalent
In dc323ce8e72d ("perf script: Enable printing of branch stack") it first tries to find the map for an address, then the symbol in the DSO backing that map, for that address, well, this is what thread__find_symbol() does, so just use it and make the code shorter. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-03nx3aod955yqnf9l06im28j@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 5ec1c73bbfaf..ffd02faee87b 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -764,13 +764,8 @@ static int perf_sample__fprintf_brstacksym(struct perf_sample *sample,
764 from = br->entries[i].from; 764 from = br->entries[i].from;
765 to = br->entries[i].to; 765 to = br->entries[i].to;
766 766
767 thread__find_map(thread, sample->cpumode, from, &alf); 767 thread__find_symbol(thread, sample->cpumode, from, &alf);
768 if (alf.map) 768 thread__find_symbol(thread, sample->cpumode, to, &alt);
769 alf.sym = map__find_symbol(alf.map, alf.addr);
770
771 thread__find_map(thread, sample->cpumode, to, &alt);
772 if (alt.map)
773 alt.sym = map__find_symbol(alt.map, alt.addr);
774 769
775 printed += symbol__fprintf_symname_offs(alf.sym, &alf, fp); 770 printed += symbol__fprintf_symname_offs(alf.sym, &alf, fp);
776 if (PRINT_FIELD(DSO)) { 771 if (PRINT_FIELD(DSO)) {