Skip to contentSkip to conversation

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

PATCH Applied Yannick Brosseau 3 participants 3 messages Aug 26, 2015 – Aug 31, 2015 perf events

lore
Share & tools
lore
#0 lore raw

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

From: Mark Drayton <[email protected]>

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.

---
 tools/perf/Documentation/perf-script.txt | 7 +++++++
 tools/perf/builtin-script.c              | 4 ++++
 2 files changed, 11 insertions(+)
tools/perf/Documentation/perf-script.txt +7 -0
index c82df57..347c73a 100644
@@ -222,6 +222,13 @@ OPTIONS
 --show-mmap-events
 	Display mmap related events (e.g. MMAP, MMAP2).
 
+--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.
 
tools/perf/builtin-script.c +4 -0
index 24809787..f3b3ba0 100644
@@ -1622,6 +1622,10 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_CALLBACK_OPTARG(0, "itrace", &itrace_synth_opts, NULL, "opts",
 			    "Instruction Tracing options",
 			    itrace_parse_synth_opts),
+	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 };
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw

Em Wed, Aug 26, 2015 at 12:18:15PM -0700, Yannick Brosseau escreveu:

Quoted 8 lines

From: Mark Drayton <[email protected]>

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.

Thanks, applied after fixing up it wrt other changes in builtin-script.c, next time, for new features like this, make sure it applies to my perf/core branch at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git

- Arnaldo

Quoted 40 lines
---
 tools/perf/Documentation/perf-script.txt | 7 +++++++
 tools/perf/builtin-script.c              | 4 ++++
 2 files changed, 11 insertions(+)
tools/perf/Documentation/perf-script.txt +7 -0
index c82df57..347c73a 100644
@@ -222,6 +222,13 @@ OPTIONS
 --show-mmap-events
 	Display mmap related events (e.g. MMAP, MMAP2).
 
+--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.
 
tools/perf/builtin-script.c +4 -0
index 24809787..f3b3ba0 100644
@@ -1622,6 +1622,10 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
 	OPT_CALLBACK_OPTARG(0, "itrace", &itrace_synth_opts, NULL, "opts",
 			    "Instruction Tracing options",
 			    itrace_parse_synth_opts),
+	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 };
Signature · 1 line
2.1.4
#2 lore raw

[tip:perf/core] perf script: Add --[no-]-demangle/--[no-] -demangle-kernel

In reply to Yannick Brosseau
perf script: Add --[no-]-demangle/--[no-]-demangle-kernel
Commit-ID:  77e0070da41f76e1ebd15291fb0254b0c174adfa
Gitweb:     http://git.kernel.org/tip/77e0070da41f76e1ebd15291fb0254b0c174adfa
Author:     Mark Drayton <[email protected]>
AuthorDate: Wed, 26 Aug 2015 12:18:15 -0700
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 28 Aug 2015 11:47:40 -0300

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

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.

---
 tools/perf/Documentation/perf-script.txt | 7 +++++++
 tools/perf/builtin-script.c              | 5 +++++
 2 files changed, 12 insertions(+)
tools/perf/Documentation/perf-script.txt +7 -0
index c0d2479..614b2c7 100644
@@ -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.
 
tools/perf/builtin-script.c +5 -0
index 105332e..4430340 100644
@@ -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 };