perf script: Add --[no-]-demangle/--[no-]-demangle-kernel
authorMark Drayton <mbd@fb.com>
Wed, 26 Aug 2015 19:18:15 +0000 (12:18 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 28 Aug 2015 14:47:40 +0000 (11:47 -0300)
Sometimes when post-processing output from `perf script` one does not
want to demangle C++ symbol names. Add an option to allow this.

Also add --[no-]demangle-kernel to be consistent with top/report/probe.

Signed-off-by: Mark Drayton <mbd@fb.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/1440616695-32340-1-git-send-email-scientist@fb.com
Signed-off-by: Yannick Brosseau <scientist@fb.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-script.txt
tools/perf/builtin-script.c

index c0d24791a7f35856d7d6fef8b7f9ce8b80f11faf..614b2c7b0293efc69bbf3a734f54b1915dd0b008 100644 (file)
@@ -226,6 +226,13 @@ OPTIONS
        Display context switch events i.e. events of type PERF_RECORD_SWITCH or
        PERF_RECORD_SWITCH_CPU_WIDE.
 
+--demangle::
+       Demangle symbol names to human readable form. It's enabled by default,
+       disable with --no-demangle.
+
+--demangle-kernel::
+       Demangle kernel symbol names to human readable form (for C++ kernels).
+
 --header
        Show perf.data header.
 
index 105332e950a9ac44a8b394ca198912a1f741cbee..4430340292c052c396083293b07ba836a0ab91b0 100644 (file)
@@ -1671,6 +1671,11 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
                            itrace_parse_synth_opts),
        OPT_BOOLEAN(0, "full-source-path", &srcline_full_filename,
                        "Show full source file name path for source lines"),
+       OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
+                       "Enable symbol demangling"),
+       OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
+                       "Enable kernel symbol demangling"),
+
        OPT_END()
        };
        const char * const script_subcommands[] = { "record", "report", NULL };