diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-11-04 12:14:32 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-11-12 08:20:53 -0300 |
commit | 5f0fef8ac3e7a5707751493293ba8ff2ffc0f8a4 (patch) | |
tree | 5976b7a548550703dcc4b07a6661626a87b74ec3 /tools/perf/util/evsel_fprintf.c | |
parent | c1529738f5eb5fe7c472e0374ad7954d52566df9 (diff) |
perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node'
To ease passing around map+symbol, just like done for other parts of the
tree recently.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evsel_fprintf.c')
-rw-r--r-- | tools/perf/util/evsel_fprintf.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c index 028df7afb0dc..3b4842840db0 100644 --- a/tools/perf/util/evsel_fprintf.c +++ b/tools/perf/util/evsel_fprintf.c @@ -125,13 +125,18 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, callchain_cursor_commit(cursor); while (1) { + struct symbol *sym; + struct map *map; u64 addr = 0; node = callchain_cursor_current(cursor); if (!node) break; - if (node->sym && node->sym->ignore && print_skip_ignored) + sym = node->ms.sym; + map = node->ms.map; + + if (sym && sym->ignore && print_skip_ignored) goto next; printed += fprintf(fp, "%-*.*s", left_alignment, left_alignment, " "); @@ -142,42 +147,42 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, if (print_ip) printed += fprintf(fp, "%c%16" PRIx64, s, node->ip); - if (node->map) - addr = node->map->map_ip(node->map, node->ip); + if (map) + addr = map->map_ip(map, node->ip); if (print_sym) { printed += fprintf(fp, " "); node_al.addr = addr; - node_al.map = node->map; + node_al.map = map; if (print_symoffset) { - printed += __symbol__fprintf_symname_offs(node->sym, &node_al, + printed += __symbol__fprintf_symname_offs(sym, &node_al, print_unknown_as_addr, true, fp); } else { - printed += __symbol__fprintf_symname(node->sym, &node_al, + printed += __symbol__fprintf_symname(sym, &node_al, print_unknown_as_addr, fp); } } - if (print_dso && (!node->sym || !node->sym->inlined)) { + if (print_dso && (!sym || !sym->inlined)) { printed += fprintf(fp, " ("); - printed += map__fprintf_dsoname(node->map, fp); + printed += map__fprintf_dsoname(map, fp); printed += fprintf(fp, ")"); } if (print_srcline) - printed += map__fprintf_srcline(node->map, addr, "\n ", fp); + printed += map__fprintf_srcline(map, addr, "\n ", fp); - if (node->sym && node->sym->inlined) + if (sym && sym->inlined) printed += fprintf(fp, " (inlined)"); if (!print_oneline) printed += fprintf(fp, "\n"); /* Add srccode here too? */ - if (bt_stop_list && node->sym && - strlist__has_entry(bt_stop_list, node->sym->name)) { + if (bt_stop_list && sym && + strlist__has_entry(bt_stop_list, sym->name)) { break; } |