All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf annotate: add --demangle and --demangle-kernel
@ 2021-02-22  8:29 Martin Liška
  2021-02-23 19:49 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Liška @ 2021-02-22  8:29 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users; +Cc: Arnaldo Carvalho de Melo

Perf annotate supports --symbol but it's impossible to filter
a C++ symbol. With --no-demangle one can filter easily by
mangled function name.

Signed-off-by: Martin Liška <mliska@suse.cz>
---
  tools/perf/Documentation/perf-annotate.txt | 7 +++++++
  tools/perf/builtin-annotate.c              | 4 ++++
  2 files changed, 11 insertions(+)

diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
index 1b5042f134a8..80c1be5d566c 100644
--- a/tools/perf/Documentation/perf-annotate.txt
+++ b/tools/perf/Documentation/perf-annotate.txt
@@ -124,6 +124,13 @@ OPTIONS
  --group::
  	Show event group information together
  
+--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).
+
  --percent-type::
  	Set annotation percent type from following choices:
  	  global-period, local-period, global-hits, local-hits
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index a23ba6bb99b6..ef70a17b9b5b 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv)
  		    "Strip first N entries of source file path name in programs (with --prefix)"),
  	OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path",
  		   "objdump binary to use for disassembly and annotations"),
+	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
+		    "Disable symbol demangling"),
+	OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
+		    "Enable kernel symbol demangling"),
  	OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
  		    "Show event group information together"),
  	OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
-- 
2.30.1


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

* Re: [PATCH] perf annotate: add --demangle and --demangle-kernel
  2021-02-22  8:29 [PATCH] perf annotate: add --demangle and --demangle-kernel Martin Liška
@ 2021-02-23 19:49 ` Arnaldo Carvalho de Melo
  2021-02-26 10:01   ` Martin Liška
  2021-02-26 10:03   ` [PATCH] perf config: add annotate.demangle{,_kernel} Martin Liška
  0 siblings, 2 replies; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-02-23 19:49 UTC (permalink / raw)
  To: Martin Liška; +Cc: linux-kernel, linux-perf-users

Em Mon, Feb 22, 2021 at 09:29:22AM +0100, Martin Liška escreveu:
> Perf annotate supports --symbol but it's impossible to filter
> a C++ symbol. With --no-demangle one can filter easily by
> mangled function name.
> 
> Signed-off-by: Martin Liška <mliska@suse.cz>
> ---
>  tools/perf/Documentation/perf-annotate.txt | 7 +++++++
>  tools/perf/builtin-annotate.c              | 4 ++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
> index 1b5042f134a8..80c1be5d566c 100644
> --- a/tools/perf/Documentation/perf-annotate.txt
> +++ b/tools/perf/Documentation/perf-annotate.txt
> @@ -124,6 +124,13 @@ OPTIONS
>  --group::
>  	Show event group information together
> +--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).
> +
>  --percent-type::
>  	Set annotation percent type from following choices:
>  	  global-period, local-period, global-hits, local-hits
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> index a23ba6bb99b6..ef70a17b9b5b 100644
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv)
>  		    "Strip first N entries of source file path name in programs (with --prefix)"),
>  	OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path",
>  		   "objdump binary to use for disassembly and annotations"),
> +	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
> +		    "Disable symbol demangling"),

Nope, this _enables_ demangling, i.e.:

	perf annotate --demangle

Asks for symbol demangling, while:

	perf annotate --no-demangle

As you correctly wrote in your commit message and on the
--demangle-kernel case, enables demangling.

Please consider making this configurable (if not already) via
~/.perfconfig, 'perf config', sure in a followup patch.

Thanks,

- Arnaldo

> +	OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
> +		    "Enable kernel symbol demangling"),
>  	OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
>  		    "Show event group information together"),
>  	OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
> -- 
> 2.30.1
> 

-- 

- Arnaldo

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

* Re: [PATCH] perf annotate: add --demangle and --demangle-kernel
  2021-02-23 19:49 ` Arnaldo Carvalho de Melo
@ 2021-02-26 10:01   ` Martin Liška
  2021-03-07 19:23     ` Martin Liška
  2021-02-26 10:03   ` [PATCH] perf config: add annotate.demangle{,_kernel} Martin Liška
  1 sibling, 1 reply; 12+ messages in thread
From: Martin Liška @ 2021-02-26 10:01 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, linux-perf-users

[-- Attachment #1: Type: text/plain, Size: 2589 bytes --]

On 2/23/21 8:49 PM, Arnaldo Carvalho de Melo wrote:
> Em Mon, Feb 22, 2021 at 09:29:22AM +0100, Martin Liška escreveu:
>> Perf annotate supports --symbol but it's impossible to filter
>> a C++ symbol. With --no-demangle one can filter easily by
>> mangled function name.
>>
>> Signed-off-by: Martin Liška <mliska@suse.cz>
>> ---
>>   tools/perf/Documentation/perf-annotate.txt | 7 +++++++
>>   tools/perf/builtin-annotate.c              | 4 ++++
>>   2 files changed, 11 insertions(+)
>>
>> diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
>> index 1b5042f134a8..80c1be5d566c 100644
>> --- a/tools/perf/Documentation/perf-annotate.txt
>> +++ b/tools/perf/Documentation/perf-annotate.txt
>> @@ -124,6 +124,13 @@ OPTIONS
>>   --group::
>>   	Show event group information together
>> +--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).
>> +
>>   --percent-type::
>>   	Set annotation percent type from following choices:
>>   	  global-period, local-period, global-hits, local-hits
>> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
>> index a23ba6bb99b6..ef70a17b9b5b 100644
>> --- a/tools/perf/builtin-annotate.c
>> +++ b/tools/perf/builtin-annotate.c
>> @@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv)
>>   		    "Strip first N entries of source file path name in programs (with --prefix)"),
>>   	OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path",
>>   		   "objdump binary to use for disassembly and annotations"),
>> +	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
>> +		    "Disable symbol demangling"),
> 
> Nope, this _enables_ demangling, i.e.:
> 
> 	perf annotate --demangle

Oh, yeah, you are right.

> 
> Asks for symbol demangling, while:
> 
> 	perf annotate --no-demangle
> 
> As you correctly wrote in your commit message and on the
> --demangle-kernel case, enables demangling.

Fixed that in V2.

Martin

> 
> Please consider making this configurable (if not already) via
> ~/.perfconfig, 'perf config', sure in a followup patch.
> 
> Thanks,
> 
> - Arnaldo
> 
>> +	OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
>> +		    "Enable kernel symbol demangling"),
>>   	OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
>>   		    "Show event group information together"),
>>   	OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
>> -- 
>> 2.30.1
>>
> 


[-- Attachment #2: 0001-perf-annotate-add-demangle-and-demangle-kernel.patch --]
[-- Type: text/x-patch, Size: 2157 bytes --]

From 336233abae5c539d7b2730cbbe35d0c7528bccc2 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Mon, 22 Feb 2021 09:24:22 +0100
Subject: [PATCH] perf annotate: add --demangle and --demangle-kernel
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Perf annotate supports --symbol but it's impossible to filter
a C++ symbol. With --no-demangle one can filter easily by
mangled function name.

Signed-off-by: Martin Liška <mliska@suse.cz>
---
 tools/perf/Documentation/perf-annotate.txt | 7 +++++++
 tools/perf/builtin-annotate.c              | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
index 1b5042f134a8..80c1be5d566c 100644
--- a/tools/perf/Documentation/perf-annotate.txt
+++ b/tools/perf/Documentation/perf-annotate.txt
@@ -124,6 +124,13 @@ OPTIONS
 --group::
 	Show event group information together
 
+--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).
+
 --percent-type::
 	Set annotation percent type from following choices:
 	  global-period, local-period, global-hits, local-hits
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index a23ba6bb99b6..ea05d9f927cb 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv)
 		    "Strip first N entries of source file path name in programs (with --prefix)"),
 	OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path",
 		   "objdump binary to use for disassembly and annotations"),
+	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
+		    "Enable symbol demangling"),
+	OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
+		    "Enable kernel symbol demangling"),
 	OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
 		    "Show event group information together"),
 	OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
-- 
2.30.1


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

* [PATCH] perf config: add annotate.demangle{,_kernel}
  2021-02-23 19:49 ` Arnaldo Carvalho de Melo
  2021-02-26 10:01   ` Martin Liška
@ 2021-02-26 10:03   ` Martin Liška
  2021-02-26 10:08     ` Martin Liška
  1 sibling, 1 reply; 12+ messages in thread
From: Martin Liška @ 2021-02-26 10:03 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, linux-perf-users

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

On 2/23/21 8:49 PM, Arnaldo Carvalho de Melo wrote:
> Please consider making this configurable (if not already) via
> ~/.perfconfig, 'perf config', sure in a followup patch.

I'm doing that in the following patch.

Thanks,
Martin

[-- Attachment #2: 0001-perf-config-add-annotate.demangle-_kernel.patch --]
[-- Type: text/x-patch, Size: 1861 bytes --]

From 797fcd73a3ecdabdf40ae054c1d4c2530fcf8203 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Fri, 26 Feb 2021 11:01:24 +0100
Subject: [PATCH] perf config: add annotate.demangle{,_kernel}
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Martin Liška <mliska@suse.cz>
---
 tools/perf/Documentation/perf-config.txt | 6 ++++++
 tools/perf/util/annotate.c               | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index 153bde14bbe0..154a1ced72b2 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -393,6 +393,12 @@ annotate.*::
 
 		This option works with tui, stdio2 browsers.
 
+	annotate.demangle::
+		Demangle symbol names to human readable form. Default is 'true'.
+
+	annotate.demangle_kernel::
+		Demangle kernel symbol names to human readable form. Default is 'true'.
+
 hist.*::
 	hist.percentage::
 		This option control the way to calculate overhead of filtered entries -
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 80542012ec1b..6e9db717c3d8 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -3142,6 +3142,10 @@ static int annotation__config(const char *var, const char *value, void *data)
 		opt->use_offset = perf_config_bool("use_offset", value);
 	} else if (!strcmp(var, "annotate.disassembler_style")) {
 		opt->disassembler_style = value;
+	} else if (!strcmp(var, "annotate.demangle")) {
+		symbol_conf.demangle = perf_config_bool("demangle", value);
+	} else if (!strcmp(var, "annotate.demangle_kernel")) {
+		symbol_conf.demangle = perf_config_bool("demangle_kernel", value);
 	} else {
 		pr_debug("%s variable unknown, ignoring...", var);
 	}
-- 
2.30.1


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

* Re: [PATCH] perf config: add annotate.demangle{,_kernel}
  2021-02-26 10:03   ` [PATCH] perf config: add annotate.demangle{,_kernel} Martin Liška
@ 2021-02-26 10:08     ` Martin Liška
  2021-03-06 13:22       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Liška @ 2021-02-26 10:08 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, linux-perf-users

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]

On 2/26/21 11:03 AM, Martin Liška wrote:
> On 2/23/21 8:49 PM, Arnaldo Carvalho de Melo wrote:
>> Please consider making this configurable (if not already) via
>> ~/.perfconfig, 'perf config', sure in a followup patch.
> 
> I'm doing that in the following patch.

The patch contained a typo, fixed in the V2.

Martin

> 
> Thanks,
> Martin


[-- Attachment #2: 0001-perf-config-add-annotate.demangle-_kernel.patch --]
[-- Type: text/x-patch, Size: 1868 bytes --]

From a29a6d3ae717f19774a430ccf9a63a452376f359 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Fri, 26 Feb 2021 11:01:24 +0100
Subject: [PATCH] perf config: add annotate.demangle{,_kernel}
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Martin Liška <mliska@suse.cz>
---
 tools/perf/Documentation/perf-config.txt | 6 ++++++
 tools/perf/util/annotate.c               | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index 153bde14bbe0..154a1ced72b2 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -393,6 +393,12 @@ annotate.*::
 
 		This option works with tui, stdio2 browsers.
 
+	annotate.demangle::
+		Demangle symbol names to human readable form. Default is 'true'.
+
+	annotate.demangle_kernel::
+		Demangle kernel symbol names to human readable form. Default is 'true'.
+
 hist.*::
 	hist.percentage::
 		This option control the way to calculate overhead of filtered entries -
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 80542012ec1b..e35d56608986 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -3142,6 +3142,10 @@ static int annotation__config(const char *var, const char *value, void *data)
 		opt->use_offset = perf_config_bool("use_offset", value);
 	} else if (!strcmp(var, "annotate.disassembler_style")) {
 		opt->disassembler_style = value;
+	} else if (!strcmp(var, "annotate.demangle")) {
+		symbol_conf.demangle = perf_config_bool("demangle", value);
+	} else if (!strcmp(var, "annotate.demangle_kernel")) {
+		symbol_conf.demangle_kernel = perf_config_bool("demangle_kernel", value);
 	} else {
 		pr_debug("%s variable unknown, ignoring...", var);
 	}
-- 
2.30.1


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

* Re: [PATCH] perf config: add annotate.demangle{,_kernel}
  2021-02-26 10:08     ` Martin Liška
@ 2021-03-06 13:22       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-03-06 13:22 UTC (permalink / raw)
  To: Martin Liška; +Cc: linux-kernel, linux-perf-users

Em Fri, Feb 26, 2021 at 11:08:12AM +0100, Martin Liška escreveu:
> On 2/26/21 11:03 AM, Martin Liška wrote:
> > On 2/23/21 8:49 PM, Arnaldo Carvalho de Melo wrote:
> > > Please consider making this configurable (if not already) via
> > > ~/.perfconfig, 'perf config', sure in a followup patch.
> > 
> > I'm doing that in the following patch.
> 
> The patch contained a typo, fixed in the V2.



Thanks, applied.

And expanded that commit log a bit:

Author: Martin Liska <mliska@suse.cz>
Date:   Fri Feb 26 11:01:24 2021 +0100

    perf config: Add annotate.demangle{,_kernel}
    
    Committer notes:
    
    This allows setting this in from the command line:
    
      $ perf config annotate.demangle
      $ perf config annotate.demangle=yes
      $ perf config annotate.demangle
      annotate.demangle=yes
      $ cat ~/.perfconfig
      # this file is auto-generated.
      [report]
            sort-order = srcline
      [annotate]
            demangle = yes
      $
      $
      $ perf config annotate.demangle_kernel
      $ perf config annotate.demangle_kernel=yes
      $ perf config annotate.demangle_kernel
      annotate.demangle_kernel=yes
      $ cat ~/.perfconfig
      # this file is auto-generated.
      [report]
            sort-order = srcline
      [annotate]
            demangle = yes
            demangle_kernel = yes
      $
    
    Signed-off-by: Martin Liška <mliska@suse.cz>
    Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Link: https://lore.kernel.org/r/c96aabe7-791f-9503-295f-3147a9d19b60@suse.cz
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

- Arnaldo

 
> Martin
> 
> > 
> > Thanks,
> > Martin
> 

> From a29a6d3ae717f19774a430ccf9a63a452376f359 Mon Sep 17 00:00:00 2001
> From: Martin Liska <mliska@suse.cz>
> Date: Fri, 26 Feb 2021 11:01:24 +0100
> Subject: [PATCH] perf config: add annotate.demangle{,_kernel}
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> Signed-off-by: Martin Liška <mliska@suse.cz>
> ---
>  tools/perf/Documentation/perf-config.txt | 6 ++++++
>  tools/perf/util/annotate.c               | 4 ++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
> index 153bde14bbe0..154a1ced72b2 100644
> --- a/tools/perf/Documentation/perf-config.txt
> +++ b/tools/perf/Documentation/perf-config.txt
> @@ -393,6 +393,12 @@ annotate.*::
>  
>  		This option works with tui, stdio2 browsers.
>  
> +	annotate.demangle::
> +		Demangle symbol names to human readable form. Default is 'true'.
> +
> +	annotate.demangle_kernel::
> +		Demangle kernel symbol names to human readable form. Default is 'true'.
> +
>  hist.*::
>  	hist.percentage::
>  		This option control the way to calculate overhead of filtered entries -
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index 80542012ec1b..e35d56608986 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -3142,6 +3142,10 @@ static int annotation__config(const char *var, const char *value, void *data)
>  		opt->use_offset = perf_config_bool("use_offset", value);
>  	} else if (!strcmp(var, "annotate.disassembler_style")) {
>  		opt->disassembler_style = value;
> +	} else if (!strcmp(var, "annotate.demangle")) {
> +		symbol_conf.demangle = perf_config_bool("demangle", value);
> +	} else if (!strcmp(var, "annotate.demangle_kernel")) {
> +		symbol_conf.demangle_kernel = perf_config_bool("demangle_kernel", value);
>  	} else {
>  		pr_debug("%s variable unknown, ignoring...", var);
>  	}
> -- 
> 2.30.1
> 


-- 

- Arnaldo

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

* Re: [PATCH] perf annotate: add --demangle and --demangle-kernel
  2021-02-26 10:01   ` Martin Liška
@ 2021-03-07 19:23     ` Martin Liška
  2021-03-30  7:41       ` Martin Liška
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Liška @ 2021-03-07 19:23 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, linux-perf-users

Hello.

May I please remind this patch. Apparently, you applied the perf-config
counterpart of the patch as 804fd30c6bd9aec7859a0503581312834fb197f1
(in tmp.perf/core branch), but we miss setting the same via options.

Thank you,
Martin

On 2/26/21 11:01 AM, Martin Liška wrote:
> On 2/23/21 8:49 PM, Arnaldo Carvalho de Melo wrote:
>> Em Mon, Feb 22, 2021 at 09:29:22AM +0100, Martin Liška escreveu:
>>> Perf annotate supports --symbol but it's impossible to filter
>>> a C++ symbol. With --no-demangle one can filter easily by
>>> mangled function name.
>>>
>>> Signed-off-by: Martin Liška <mliska@suse.cz>
>>> ---
>>>   tools/perf/Documentation/perf-annotate.txt | 7 +++++++
>>>   tools/perf/builtin-annotate.c              | 4 ++++
>>>   2 files changed, 11 insertions(+)
>>>
>>> diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
>>> index 1b5042f134a8..80c1be5d566c 100644
>>> --- a/tools/perf/Documentation/perf-annotate.txt
>>> +++ b/tools/perf/Documentation/perf-annotate.txt
>>> @@ -124,6 +124,13 @@ OPTIONS
>>>   --group::
>>>       Show event group information together
>>> +--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).
>>> +
>>>   --percent-type::
>>>       Set annotation percent type from following choices:
>>>         global-period, local-period, global-hits, local-hits
>>> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
>>> index a23ba6bb99b6..ef70a17b9b5b 100644
>>> --- a/tools/perf/builtin-annotate.c
>>> +++ b/tools/perf/builtin-annotate.c
>>> @@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv)
>>>               "Strip first N entries of source file path name in programs (with --prefix)"),
>>>       OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path",
>>>              "objdump binary to use for disassembly and annotations"),
>>> +    OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
>>> +            "Disable symbol demangling"),
>>
>> Nope, this _enables_ demangling, i.e.:
>>
>>     perf annotate --demangle
> 
> Oh, yeah, you are right.
> 
>>
>> Asks for symbol demangling, while:
>>
>>     perf annotate --no-demangle
>>
>> As you correctly wrote in your commit message and on the
>> --demangle-kernel case, enables demangling.
> 
> Fixed that in V2.
> 
> Martin
> 
>>
>> Please consider making this configurable (if not already) via
>> ~/.perfconfig, 'perf config', sure in a followup patch.
>>
>> Thanks,
>>
>> - Arnaldo
>>
>>> +    OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
>>> +            "Enable kernel symbol demangling"),
>>>       OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
>>>               "Show event group information together"),
>>>       OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
>>> -- 
>>> 2.30.1
>>>
>>
> 


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

* Re: [PATCH] perf annotate: add --demangle and --demangle-kernel
  2021-03-07 19:23     ` Martin Liška
@ 2021-03-30  7:41       ` Martin Liška
  2021-03-30 15:42         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Liška @ 2021-03-30  7:41 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, linux-perf-users

PING^2

On 3/7/21 8:23 PM, Martin Liška wrote:
> Hello.
> 
> May I please remind this patch. Apparently, you applied the perf-config
> counterpart of the patch as 804fd30c6bd9aec7859a0503581312834fb197f1
> (in tmp.perf/core branch), but we miss setting the same via options.
> 
> Thank you,
> Martin
> 
> On 2/26/21 11:01 AM, Martin Liška wrote:
>> On 2/23/21 8:49 PM, Arnaldo Carvalho de Melo wrote:
>>> Em Mon, Feb 22, 2021 at 09:29:22AM +0100, Martin Liška escreveu:
>>>> Perf annotate supports --symbol but it's impossible to filter
>>>> a C++ symbol. With --no-demangle one can filter easily by
>>>> mangled function name.
>>>>
>>>> Signed-off-by: Martin Liška <mliska@suse.cz>
>>>> ---
>>>>   tools/perf/Documentation/perf-annotate.txt | 7 +++++++
>>>>   tools/perf/builtin-annotate.c              | 4 ++++
>>>>   2 files changed, 11 insertions(+)
>>>>
>>>> diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
>>>> index 1b5042f134a8..80c1be5d566c 100644
>>>> --- a/tools/perf/Documentation/perf-annotate.txt
>>>> +++ b/tools/perf/Documentation/perf-annotate.txt
>>>> @@ -124,6 +124,13 @@ OPTIONS
>>>>   --group::
>>>>       Show event group information together
>>>> +--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).
>>>> +
>>>>   --percent-type::
>>>>       Set annotation percent type from following choices:
>>>>         global-period, local-period, global-hits, local-hits
>>>> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
>>>> index a23ba6bb99b6..ef70a17b9b5b 100644
>>>> --- a/tools/perf/builtin-annotate.c
>>>> +++ b/tools/perf/builtin-annotate.c
>>>> @@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv)
>>>>               "Strip first N entries of source file path name in programs (with --prefix)"),
>>>>       OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path",
>>>>              "objdump binary to use for disassembly and annotations"),
>>>> +    OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
>>>> +            "Disable symbol demangling"),
>>>
>>> Nope, this _enables_ demangling, i.e.:
>>>
>>>     perf annotate --demangle
>>
>> Oh, yeah, you are right.
>>
>>>
>>> Asks for symbol demangling, while:
>>>
>>>     perf annotate --no-demangle
>>>
>>> As you correctly wrote in your commit message and on the
>>> --demangle-kernel case, enables demangling.
>>
>> Fixed that in V2.
>>
>> Martin
>>
>>>
>>> Please consider making this configurable (if not already) via
>>> ~/.perfconfig, 'perf config', sure in a followup patch.
>>>
>>> Thanks,
>>>
>>> - Arnaldo
>>>
>>>> +    OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
>>>> +            "Enable kernel symbol demangling"),
>>>>       OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
>>>>               "Show event group information together"),
>>>>       OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
>>>> -- 
>>>> 2.30.1
>>>>
>>>
>>
> 


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

* Re: [PATCH] perf annotate: add --demangle and --demangle-kernel
  2021-03-30  7:41       ` Martin Liška
@ 2021-03-30 15:42         ` Arnaldo Carvalho de Melo
  2021-03-30 18:19           ` Martin Liška
  0 siblings, 1 reply; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-03-30 15:42 UTC (permalink / raw)
  To: Martin Liška; +Cc: linux-kernel, linux-perf-users

Em Tue, Mar 30, 2021 at 09:41:33AM +0200, Martin Liška escreveu:
> PING^2
> 
> On 3/7/21 8:23 PM, Martin Liška wrote:
> > Hello.
> > 
> > May I please remind this patch. Apparently, you applied the perf-config
> > counterpart of the patch as 804fd30c6bd9aec7859a0503581312834fb197f1
> > (in tmp.perf/core branch), but we miss setting the same via options.
> > 
> > Thank you,
> > Martin
> > 
> > On 2/26/21 11:01 AM, Martin Liška wrote:
> > > On 2/23/21 8:49 PM, Arnaldo Carvalho de Melo wrote:
> > > > Em Mon, Feb 22, 2021 at 09:29:22AM +0100, Martin Liška escreveu:
> > > > > Perf annotate supports --symbol but it's impossible to filter
> > > > > a C++ symbol. With --no-demangle one can filter easily by
> > > > > mangled function name.
> > > > > 
> > > > > Signed-off-by: Martin Liška <mliska@suse.cz>
> > > > > ---
> > > > >   tools/perf/Documentation/perf-annotate.txt | 7 +++++++
> > > > >   tools/perf/builtin-annotate.c              | 4 ++++
> > > > >   2 files changed, 11 insertions(+)
> > > > > 
> > > > > diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
> > > > > index 1b5042f134a8..80c1be5d566c 100644
> > > > > --- a/tools/perf/Documentation/perf-annotate.txt
> > > > > +++ b/tools/perf/Documentation/perf-annotate.txt
> > > > > @@ -124,6 +124,13 @@ OPTIONS
> > > > >   --group::
> > > > >       Show event group information together
> > > > > +--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).
> > > > > +
> > > > >   --percent-type::
> > > > >       Set annotation percent type from following choices:
> > > > >         global-period, local-period, global-hits, local-hits
> > > > > diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> > > > > index a23ba6bb99b6..ef70a17b9b5b 100644
> > > > > --- a/tools/perf/builtin-annotate.c
> > > > > +++ b/tools/perf/builtin-annotate.c
> > > > > @@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv)
> > > > >               "Strip first N entries of source file path name in programs (with --prefix)"),
> > > > >       OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path",
> > > > >              "objdump binary to use for disassembly and annotations"),
> > > > > +    OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
> > > > > +            "Disable symbol demangling"),
> > > > 
> > > > Nope, this _enables_ demangling, i.e.:
> > > > 
> > > >     perf annotate --demangle
> > > 
> > > Oh, yeah, you are right.
> > > 
> > > > 
> > > > Asks for symbol demangling, while:
> > > > 
> > > >     perf annotate --no-demangle
> > > > 
> > > > As you correctly wrote in your commit message and on the
> > > > --demangle-kernel case, enables demangling.
> > > 
> > > Fixed that in V2.

Trying to find V2

- Arnaldo

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

* Re: [PATCH] perf annotate: add --demangle and --demangle-kernel
  2021-03-30 15:42         ` Arnaldo Carvalho de Melo
@ 2021-03-30 18:19           ` Martin Liška
  2021-03-30 18:23             ` Arnaldo Carvalho de Melo
  2021-03-30 18:33             ` Martin Liška
  0 siblings, 2 replies; 12+ messages in thread
From: Martin Liška @ 2021-03-30 18:19 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, linux-perf-users

On 3/30/21 5:42 PM, Arnaldo Carvalho de Melo wrote:
> Trying to find V2

It's this email:
https://lore.kernel.org/lkml/deb2af9e-25dd-ac72-29f4-ab90c2b24237@suse.cz/

Subject: Re: [PATCH] perf config: add annotate.demangle{,_kernel}
From:   =?UTF-8?Q?Martin_Li=c5=a1ka?= <mliska@suse.cz>
To:     Arnaldo Carvalho de Melo <acme@kernel.org>
Cc:     linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
References: <deb2af9e-25dd-ac72-29f4-ab90c2b24237@suse.cz>
  <YDVcZJscuKIgShsm@kernel.org> <a4e687b9-f611-1b24-ae7c-2ecd93c42ea8@suse.cz>
Message-ID: <c96aabe7-791f-9503-295f-3147a9d19b60@suse.cz>
Date:   Fri, 26 Feb 2021 11:08:12 +0100


Cheers,
Martin

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

* Re: [PATCH] perf annotate: add --demangle and --demangle-kernel
  2021-03-30 18:19           ` Martin Liška
@ 2021-03-30 18:23             ` Arnaldo Carvalho de Melo
  2021-03-30 18:33             ` Martin Liška
  1 sibling, 0 replies; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-03-30 18:23 UTC (permalink / raw)
  To: Martin Liška; +Cc: linux-kernel, linux-perf-users

Em Tue, Mar 30, 2021 at 08:19:10PM +0200, Martin Liška escreveu:
> On 3/30/21 5:42 PM, Arnaldo Carvalho de Melo wrote:
> > Trying to find V2

You said you would resend fixing up this:

+	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
+		    "Disable symbol demangling"),
                     ^^^^^^^



+	OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
+		    "Enable kernel symbol demangling"),
 
> It's this email:
> https://lore.kernel.org/lkml/deb2af9e-25dd-ac72-29f4-ab90c2b24237@suse.cz/
> 
> Subject: Re: [PATCH] perf config: add annotate.demangle{,_kernel}
> From:   =?UTF-8?Q?Martin_Li=c5=a1ka?= <mliska@suse.cz>
> To:     Arnaldo Carvalho de Melo <acme@kernel.org>
> Cc:     linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
> References: <deb2af9e-25dd-ac72-29f4-ab90c2b24237@suse.cz>
>  <YDVcZJscuKIgShsm@kernel.org> <a4e687b9-f611-1b24-ae7c-2ecd93c42ea8@suse.cz>
> Message-ID: <c96aabe7-791f-9503-295f-3147a9d19b60@suse.cz>
> Date:   Fri, 26 Feb 2021 11:08:12 +0100
> 
> 
> Cheers,
> Martin

-- 

- Arnaldo

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

* [PATCH] perf annotate: add --demangle and --demangle-kernel
  2021-03-30 18:19           ` Martin Liška
  2021-03-30 18:23             ` Arnaldo Carvalho de Melo
@ 2021-03-30 18:33             ` Martin Liška
  1 sibling, 0 replies; 12+ messages in thread
From: Martin Liška @ 2021-03-30 18:33 UTC (permalink / raw)
  To: linux-perf-users, lkml; +Cc: Arnaldo Carvalho de Melo

Perf annotate supports --symbol but it's impossible to filter
a C++ symbol. With --no-demangle one can filter easily by
mangled function name.

Signed-off-by: Martin Liška <mliska@suse.cz>
---
  tools/perf/Documentation/perf-annotate.txt | 7 +++++++
  tools/perf/builtin-annotate.c              | 4 ++++
  2 files changed, 11 insertions(+)

diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
index 1b5042f134a8..80c1be5d566c 100644
--- a/tools/perf/Documentation/perf-annotate.txt
+++ b/tools/perf/Documentation/perf-annotate.txt
@@ -124,6 +124,13 @@ OPTIONS
  --group::
  	Show event group information together
  
+--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).
+
  --percent-type::
  	Set annotation percent type from following choices:
  	  global-period, local-period, global-hits, local-hits
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 0f3a196e5d6e..021d974c978e 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -538,6 +538,10 @@ int cmd_annotate(int argc, const char **argv)
  		    "Strip first N entries of source file path name in programs (with --prefix)"),
  	OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path",
  		   "objdump binary to use for disassembly and annotations"),
+	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
+		    "Enable symbol demangling"),
+	OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
+		    "Enable kernel symbol demangling"),
  	OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
  		    "Show event group information together"),
  	OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
-- 
2.30.2


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

end of thread, other threads:[~2021-03-30 18:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22  8:29 [PATCH] perf annotate: add --demangle and --demangle-kernel Martin Liška
2021-02-23 19:49 ` Arnaldo Carvalho de Melo
2021-02-26 10:01   ` Martin Liška
2021-03-07 19:23     ` Martin Liška
2021-03-30  7:41       ` Martin Liška
2021-03-30 15:42         ` Arnaldo Carvalho de Melo
2021-03-30 18:19           ` Martin Liška
2021-03-30 18:23             ` Arnaldo Carvalho de Melo
2021-03-30 18:33             ` Martin Liška
2021-02-26 10:03   ` [PATCH] perf config: add annotate.demangle{,_kernel} Martin Liška
2021-02-26 10:08     ` Martin Liška
2021-03-06 13:22       ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.