public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf script: Add --[no-]-demangle/--[no-]-demangle-kernel
@ 2015-02-09 17:21 Mark Drayton
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Drayton @ 2015-02-09 17:21 UTC (permalink / raw)
  To: acme; +Cc: a.p.zijlstra, paulus, mingo, linux-kernel, kernel-team,
	Mark Drayton

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@fb.com>
---
 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
 --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.
 
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"),
 	OPT_END()
 	};
 	const char * const script_usage[] = {
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] perf script: Add --[no-]-demangle/--[no-]-demangle-kernel
@ 2015-08-26 19:18 Yannick Brosseau
  2015-08-27 14:13 ` Arnaldo Carvalho de Melo
  2015-08-31  8:30 ` [tip:perf/core] perf script: Add --[no-]-demangle/--[no-] -demangle-kernel tip-bot for Mark Drayton
  0 siblings, 2 replies; 4+ messages in thread
From: Yannick Brosseau @ 2015-08-26 19:18 UTC (permalink / raw)
  To: ak, acme, jolsa; +Cc: linux-kernel, Mark Drayton, Yannick Brosseau

From: Mark Drayton <mbd@fb.com>

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@fb.com>
Signed-off-by: Yannick Brosseau <scientist@fb.com>
---
 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 c82df57..347c73a 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -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.
 
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 24809787..f3b3ba0 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -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 };
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf script: Add --[no-]-demangle/--[no-]-demangle-kernel
  2015-08-26 19:18 [PATCH] perf script: Add --[no-]-demangle/--[no-]-demangle-kernel Yannick Brosseau
@ 2015-08-27 14:13 ` Arnaldo Carvalho de Melo
  2015-08-31  8:30 ` [tip:perf/core] perf script: Add --[no-]-demangle/--[no-] -demangle-kernel tip-bot for Mark Drayton
  1 sibling, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-08-27 14:13 UTC (permalink / raw)
  To: Yannick Brosseau; +Cc: ak, jolsa, linux-kernel, Mark Drayton

Em Wed, Aug 26, 2015 at 12:18:15PM -0700, Yannick Brosseau escreveu:
> From: Mark Drayton <mbd@fb.com>
> 
> 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@fb.com>
> Signed-off-by: Yannick Brosseau <scientist@fb.com>

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

> ---
>  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 c82df57..347c73a 100644
> --- a/tools/perf/Documentation/perf-script.txt
> +++ b/tools/perf/Documentation/perf-script.txt
> @@ -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.
>  
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 24809787..f3b3ba0 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -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 };
> -- 
> 2.1.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:perf/core] perf script: Add --[no-]-demangle/--[no-] -demangle-kernel
  2015-08-26 19:18 [PATCH] perf script: Add --[no-]-demangle/--[no-]-demangle-kernel Yannick Brosseau
  2015-08-27 14:13 ` Arnaldo Carvalho de Melo
@ 2015-08-31  8:30 ` tip-bot for Mark Drayton
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Mark Drayton @ 2015-08-31  8:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mbd, ak, scientist, linux-kernel, jolsa, hpa, tglx, acme, mingo

Commit-ID:  77e0070da41f76e1ebd15291fb0254b0c174adfa
Gitweb:     http://git.kernel.org/tip/77e0070da41f76e1ebd15291fb0254b0c174adfa
Author:     Mark Drayton <mbd@fb.com>
AuthorDate: Wed, 26 Aug 2015 12:18:15 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

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 | 7 +++++++
 tools/perf/builtin-script.c              | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index c0d2479..614b2c7 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -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.
 
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 105332e..4430340 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -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 };

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-31  8:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-26 19:18 [PATCH] perf script: Add --[no-]-demangle/--[no-]-demangle-kernel Yannick Brosseau
2015-08-27 14:13 ` Arnaldo Carvalho de Melo
2015-08-31  8:30 ` [tip:perf/core] perf script: Add --[no-]-demangle/--[no-] -demangle-kernel tip-bot for Mark Drayton
  -- strict thread matches above, loose matches on Subject: below --
2015-02-09 17:21 [PATCH] perf script: Add --[no-]-demangle/--[no-]-demangle-kernel Mark Drayton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox