perf script: Use thread__find_symbol() instead of ad-hoc equivalent

In dc323ce8 ("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.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 4546263d
...@@ -764,13 +764,8 @@ static int perf_sample__fprintf_brstacksym(struct perf_sample *sample, ...@@ -764,13 +764,8 @@ static int perf_sample__fprintf_brstacksym(struct perf_sample *sample,
from = br->entries[i].from; from = br->entries[i].from;
to = br->entries[i].to; to = br->entries[i].to;
thread__find_map(thread, sample->cpumode, from, &alf); thread__find_symbol(thread, sample->cpumode, from, &alf);
if (alf.map) thread__find_symbol(thread, sample->cpumode, to, &alt);
alf.sym = map__find_symbol(alf.map, alf.addr);
thread__find_map(thread, sample->cpumode, to, &alt);
if (alt.map)
alt.sym = map__find_symbol(alt.map, alt.addr);
printed += symbol__fprintf_symname_offs(alf.sym, &alf, fp); printed += symbol__fprintf_symname_offs(alf.sym, &alf, fp);
if (PRINT_FIELD(DSO)) { if (PRINT_FIELD(DSO)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册