[PATCH] perf script: Add --[no-]-demangle/--[no-]-demangle-kernel

From: Mark Drayton
Date: Mon Feb 09 2015 - 12:21:37 EST

Summary: 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@xxxxxx>
tools/perf/Documentation/perf-script.txt | 7 +++++++
tools/perf/builtin-script.c | 4 ++++
2 files changed, 11 insertions(+)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 2149480..4b8a42e 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -209,6 +209,13 @@ OPTIONS
Display mmap related events (e.g. MMAP, MMAP2).

+ Demangle symbol names to human readable form. It's enabled by default,
+ disable with --no-demangle.
+ Demangle kernel symbol names to human readable form (for C++ kernels).
Show perf.data header.

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index ce304df..95d3cd9 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1570,6 +1570,10 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
"Show the fork/comm/exit events"),
OPT_BOOLEAN('\0', "show-mmap-events", &script.show_mmap_events,
"Show the mmap events"),
+ OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
+ "Enable symbol demangling"),
+ OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
+ "Enable kernel symbol demangling"),
const char * const script_usage[] = {

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/