]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
perf callchain: Mark inlined frames in output by " (inlined)" suffix
authorMilian Wolff <milian.wolff@kdab.com>
Mon, 9 Oct 2017 20:33:01 +0000 (22:33 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 24 Oct 2017 12:59:56 +0000 (09:59 -0300)
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: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Reviewed-by: Namhyung 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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/callchain.c
tools/perf/util/sort.c

index 0f2ba493a7a3f57f321c82f18c8b265693c5397f..77031efdca5cc6e8e912f721efc9d65fb2dc8f14 100644 (file)
@@ -1111,11 +1111,15 @@ char *callchain_list__sym_name(struct callchain_list *cl,
        int printed;
 
        if (cl->ms.sym) {
+               const char *inlined = cl->ms.sym->inlined ? " (inlined)" : "";
+
                if (show_srcline && cl->srcline)
-                       printed = scnprintf(bf, bfsize, "%s %s",
-                                       cl->ms.sym->name, cl->srcline);
+                       printed = scnprintf(bf, bfsize, "%s %s%s",
+                                           cl->ms.sym->name, cl->srcline,
+                                           inlined);
                else
-                       printed = scnprintf(bf, bfsize, "%s", cl->ms.sym->name);
+                       printed = scnprintf(bf, bfsize, "%s%s",
+                                           cl->ms.sym->name, inlined);
        } else
                printed = scnprintf(bf, bfsize, "%#" PRIx64, cl->ip);
 
index eb3ab902a1c0869ad0b3431a82ba7bed49ec914d..acb9210fd18a34545dec9d133653e6d94824e218 100644 (file)
@@ -283,6 +283,9 @@ static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym,
                        ret += repsep_snprintf(bf + ret, size - ret, "%.*s",
                                               width - ret,
                                               sym->name);
+                       if (sym->inlined)
+                               ret += repsep_snprintf(bf + ret, size - ret,
+                                                      " (inlined)");
                }
        } else {
                size_t len = BITS_PER_LONG / 4;