Commit 8932f807 authored by Milian Wolff's avatar Milian Wolff Committed by Arnaldo Carvalho de Melo

perf callchain: Mark inlined frames in output by " (inlined)" suffix

The original patch that introduced inline frame output in the various
browsers used this suffix already. The new centralized approach that
uses fake symbols for inlined frames was missing this approach so far.

Instead of changing the symbol name itself, we only print the suffix
where needed. This allows us to efficiently lookup the symbol for a
given name without first having to append the suffix before the lookup.
Signed-off-by: default avatarMilian Wolff <milian.wolff@kdab.com>
Reviewed-by: default avatarJiri Olsa <jolsa@redhat.com>
Reviewed-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yao Jin <yao.jin@linux.intel.com>
Link: http://lkml.kernel.org/r/20171009203310.17362-8-milian.wolff@kdab.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent cbe50f61
...@@ -1111,11 +1111,15 @@ char *callchain_list__sym_name(struct callchain_list *cl, ...@@ -1111,11 +1111,15 @@ char *callchain_list__sym_name(struct callchain_list *cl,
int printed; int printed;
if (cl->ms.sym) { if (cl->ms.sym) {
const char *inlined = cl->ms.sym->inlined ? " (inlined)" : "";
if (show_srcline && cl->srcline) if (show_srcline && cl->srcline)
printed = scnprintf(bf, bfsize, "%s %s", printed = scnprintf(bf, bfsize, "%s %s%s",
cl->ms.sym->name, cl->srcline); cl->ms.sym->name, cl->srcline,
inlined);
else else
printed = scnprintf(bf, bfsize, "%s", cl->ms.sym->name); printed = scnprintf(bf, bfsize, "%s%s",
cl->ms.sym->name, inlined);
} else } else
printed = scnprintf(bf, bfsize, "%#" PRIx64, cl->ip); printed = scnprintf(bf, bfsize, "%#" PRIx64, cl->ip);
......
...@@ -283,6 +283,9 @@ static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym, ...@@ -283,6 +283,9 @@ static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym,
ret += repsep_snprintf(bf + ret, size - ret, "%.*s", ret += repsep_snprintf(bf + ret, size - ret, "%.*s",
width - ret, width - ret,
sym->name); sym->name);
if (sym->inlined)
ret += repsep_snprintf(bf + ret, size - ret,
" (inlined)");
} }
} else { } else {
size_t len = BITS_PER_LONG / 4; size_t len = BITS_PER_LONG / 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment