linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 01/13] tools lib traceevent: Convert remaining %p[fF] users to %p[sS]
       [not found] <20190918133419.7969-1-sakari.ailus@linux.intel.com>
@ 2019-09-18 13:34 ` Sakari Ailus
  2019-09-18 13:58   ` Steven Rostedt
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sakari Ailus @ 2019-09-18 13:34 UTC (permalink / raw)
  To: Petr Mladek, linux-kernel, rafael
  Cc: Andy Shevchenko, linux-acpi, devicetree, Rob Herring,
	Heikki Krogerus, Joe Perches, Steven Rostedt,
	Arnaldo Carvalho de Melo, Tzvetomir Stoyanov, linux-trace-devel,
	Jiri Olsa, Namhyung Kim

There are no in-kernel %p[fF] users left. Convert the traceevent tool,
too, to align with the kernel.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: linux-trace-devel@vger.kernel.org
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
---
 .../Documentation/libtraceevent-func_apis.txt  | 10 +++++-----
 tools/lib/traceevent/event-parse.c             | 18 ++++++++++++++----
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt b/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
index 38bfea30a5f64..f6aca0df2151a 100644
--- a/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
+++ b/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
@@ -59,12 +59,12 @@ parser context.
 
 The _tep_register_function()_ function registers a function name mapped to an
 address and (optional) module. This mapping is used in case the function tracer
-or events have "%pF" or "%pS" parameter in its format string. It is common to
-pass in the kallsyms function names with their corresponding addresses with this
+or events have "%pS" parameter in its format string. It is common to pass in
+the kallsyms function names with their corresponding addresses with this
 function. The _tep_ argument is the trace event parser context. The _name_ is
-the name of the function, the string is copied internally. The _addr_ is
-the start address of the function. The _mod_ is the kernel module
-the function may be in (NULL for none).
+the name of the function, the string is copied internally. The _addr_ is the
+start address of the function. The _mod_ is the kernel module the function may
+be in (NULL for none).
 
 The _tep_register_print_string()_ function  registers a string by the address
 it was stored in the kernel. Some strings internal to the kernel with static
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index b36b536a9fcba..2189621b616bc 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4335,10 +4335,20 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
 					switch (*ptr) {
 					case 's':
 					case 'S':
-					case 'f':
-					case 'F':
 					case 'x':
 						break;
+					case 'f':
+					case 'F':
+						/*
+						 * Pre-5.5 kernels use %pf and
+						 * %pF for printing symbols
+						 * while kernels since 5.5 use
+						 * %pfw for fwnodes. So check
+						 * %p[fF] isn't followed by 'w'.
+						 */
+						if (ptr[1] != 'w')
+							break;
+						/* fall through */
 					default:
 						/*
 						 * Older kernels do not process
@@ -4455,12 +4465,12 @@ get_bprint_format(void *data, int size __maybe_unused,
 
 	printk = find_printk(tep, addr);
 	if (!printk) {
-		if (asprintf(&format, "%%pf: (NO FORMAT FOUND at %llx)\n", addr) < 0)
+		if (asprintf(&format, "%%ps: (NO FORMAT FOUND at %llx)\n", addr) < 0)
 			return NULL;
 		return format;
 	}
 
-	if (asprintf(&format, "%s: %s", "%pf", printk->printk) < 0)
+	if (asprintf(&format, "%s: %s", "%ps", printk->printk) < 0)
 		return NULL;
 
 	return format;
-- 
2.20.1


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

* Re: [PATCH v7 01/13] tools lib traceevent: Convert remaining %p[fF] users to %p[sS]
  2019-09-18 13:34 ` [PATCH v7 01/13] tools lib traceevent: Convert remaining %p[fF] users to %p[sS] Sakari Ailus
@ 2019-09-18 13:58   ` Steven Rostedt
  2019-09-18 15:22   ` Andy Shevchenko
  2019-09-20 16:20   ` [tip: perf/urgent] " tip-bot2 for Sakari Ailus
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2019-09-18 13:58 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Petr Mladek, linux-kernel, rafael, Andy Shevchenko, linux-acpi,
	devicetree, Rob Herring, Heikki Krogerus, Joe Perches,
	Arnaldo Carvalho de Melo, Tzvetomir Stoyanov, linux-trace-devel,
	Jiri Olsa, Namhyung Kim

On Wed, 18 Sep 2019 16:34:07 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> There are no in-kernel %p[fF] users left. Convert the traceevent tool,
> too, to align with the kernel.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> Cc: linux-trace-devel@vger.kernel.org
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> ---
>  .../Documentation/libtraceevent-func_apis.txt  | 10 +++++-----
>  tools/lib/traceevent/event-parse.c             | 18 ++++++++++++++----
>  2 files changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt b/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
> index 38bfea30a5f64..f6aca0df2151a 100644
> --- a/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
> +++ b/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
> @@ -59,12 +59,12 @@ parser context.
>  
>  The _tep_register_function()_ function registers a function name mapped to an
>  address and (optional) module. This mapping is used in case the function tracer
> -or events have "%pF" or "%pS" parameter in its format string. It is common to
> -pass in the kallsyms function names with their corresponding addresses with this
> +or events have "%pS" parameter in its format string. It is common to pass in
> +the kallsyms function names with their corresponding addresses with this
>  function. The _tep_ argument is the trace event parser context. The _name_ is
> -the name of the function, the string is copied internally. The _addr_ is
> -the start address of the function. The _mod_ is the kernel module
> -the function may be in (NULL for none).
> +the name of the function, the string is copied internally. The _addr_ is the
> +start address of the function. The _mod_ is the kernel module the function may
> +be in (NULL for none).
>  
>  The _tep_register_print_string()_ function  registers a string by the address
>  it was stored in the kernel. Some strings internal to the kernel with static
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index b36b536a9fcba..2189621b616bc 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -4335,10 +4335,20 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
>  					switch (*ptr) {
>  					case 's':
>  					case 'S':
> -					case 'f':
> -					case 'F':
>  					case 'x':
>  						break;
> +					case 'f':
> +					case 'F':
> +						/*
> +						 * Pre-5.5 kernels use %pf and
> +						 * %pF for printing symbols
> +						 * while kernels since 5.5 use
> +						 * %pfw for fwnodes. So check
> +						 * %p[fF] isn't followed by 'w'.
> +						 */

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

> +						if (ptr[1] != 'w')
> +							break;
> +						/* fall through */
>  					default:
>  						/*
>  						 * Older kernels do not process
> @@ -4455,12 +4465,12 @@ get_bprint_format(void *data, int size __maybe_unused,
>  
>  	printk = find_printk(tep, addr);
>  	if (!printk) {
> -		if (asprintf(&format, "%%pf: (NO FORMAT FOUND at %llx)\n", addr) < 0)
> +		if (asprintf(&format, "%%ps: (NO FORMAT FOUND at %llx)\n", addr) < 0)
>  			return NULL;
>  		return format;
>  	}
>  
> -	if (asprintf(&format, "%s: %s", "%pf", printk->printk) < 0)
> +	if (asprintf(&format, "%s: %s", "%ps", printk->printk) < 0)
>  		return NULL;
>  
>  	return format;


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

* Re: [PATCH v7 01/13] tools lib traceevent: Convert remaining %p[fF] users to %p[sS]
  2019-09-18 13:34 ` [PATCH v7 01/13] tools lib traceevent: Convert remaining %p[fF] users to %p[sS] Sakari Ailus
  2019-09-18 13:58   ` Steven Rostedt
@ 2019-09-18 15:22   ` Andy Shevchenko
  2019-09-20 16:20   ` [tip: perf/urgent] " tip-bot2 for Sakari Ailus
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2019-09-18 15:22 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Petr Mladek, linux-kernel, rafael, linux-acpi, devicetree,
	Rob Herring, Heikki Krogerus, Joe Perches, Steven Rostedt,
	Arnaldo Carvalho de Melo, Tzvetomir Stoyanov, linux-trace-devel,
	Jiri Olsa, Namhyung Kim

On Wed, Sep 18, 2019 at 04:34:07PM +0300, Sakari Ailus wrote:
> There are no in-kernel %p[fF] users left. Convert the traceevent tool,
> too, to align with the kernel.

>  function. The _tep_ argument is the trace event parser context. The _name_ is
> -the name of the function, the string is copied internally. The _addr_ is
> -the start address of the function. The _mod_ is the kernel module
> -the function may be in (NULL for none).
> +the name of the function, the string is copied internally. The _addr_ is the
> +start address of the function. The _mod_ is the kernel module the function may
> +be in (NULL for none).

I think this is unneeded churn (reformating string). But since maintainer Acked
this, I don't care much. But think about burden to the Git index in million of
instances around the world.

-- 
With Best Regards,
Andy Shevchenko



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

* [tip: perf/urgent] tools lib traceevent: Convert remaining %p[fF] users to %p[sS]
  2019-09-18 13:34 ` [PATCH v7 01/13] tools lib traceevent: Convert remaining %p[fF] users to %p[sS] Sakari Ailus
  2019-09-18 13:58   ` Steven Rostedt
  2019-09-18 15:22   ` Andy Shevchenko
@ 2019-09-20 16:20   ` tip-bot2 for Sakari Ailus
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Sakari Ailus @ 2019-09-20 16:20 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Sakari Ailus, Andy Shevchenko, devicetree, Heikki Krogerus,
	Jiri Olsa, Joe Perches, linux-acpi, linux-trace-devel,
	Namhyung Kim, Petr Mladek, Rafael J. Wysocki, Rob Herring,
	Steven Rostedt (VMware),
	Tzvetomir Stoyanov, Arnaldo Carvalho de Melo, Ingo Molnar,
	Borislav Petkov, linux-kernel

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     b295c3e39c1383e06ba1db4dd836018502e2ff3a
Gitweb:        https://git.kernel.org/tip/b295c3e39c1383e06ba1db4dd836018502e2ff3a
Author:        Sakari Ailus <sakari.ailus@linux.intel.com>
AuthorDate:    Wed, 18 Sep 2019 16:34:07 +03:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Fri, 20 Sep 2019 10:28:26 -03:00

tools lib traceevent: Convert remaining %p[fF] users to %p[sS]

There are no in-kernel %p[fF] users left. Convert the traceevent tool,
too, to align with the kernel.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: devicetree@vger.kernel.org
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: linux-acpi@vger.kernel.org
Cc: linux-trace-devel@vger.kernel.org
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Link: http://lore.kernel.org/lkml/20190918133419.7969-2-sakari.ailus@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt | 10 ++--
 tools/lib/traceevent/event-parse.c                             | 18 +++++--
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt b/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
index 38bfea3..f6aca0d 100644
--- a/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
+++ b/tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
@@ -59,12 +59,12 @@ parser context.
 
 The _tep_register_function()_ function registers a function name mapped to an
 address and (optional) module. This mapping is used in case the function tracer
-or events have "%pF" or "%pS" parameter in its format string. It is common to
-pass in the kallsyms function names with their corresponding addresses with this
+or events have "%pS" parameter in its format string. It is common to pass in
+the kallsyms function names with their corresponding addresses with this
 function. The _tep_ argument is the trace event parser context. The _name_ is
-the name of the function, the string is copied internally. The _addr_ is
-the start address of the function. The _mod_ is the kernel module
-the function may be in (NULL for none).
+the name of the function, the string is copied internally. The _addr_ is the
+start address of the function. The _mod_ is the kernel module the function may
+be in (NULL for none).
 
 The _tep_register_print_string()_ function  registers a string by the address
 it was stored in the kernel. Some strings internal to the kernel with static
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index bb22238..6f842af 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4367,10 +4367,20 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
 					switch (*ptr) {
 					case 's':
 					case 'S':
-					case 'f':
-					case 'F':
 					case 'x':
 						break;
+					case 'f':
+					case 'F':
+						/*
+						 * Pre-5.5 kernels use %pf and
+						 * %pF for printing symbols
+						 * while kernels since 5.5 use
+						 * %pfw for fwnodes. So check
+						 * %p[fF] isn't followed by 'w'.
+						 */
+						if (ptr[1] != 'w')
+							break;
+						/* fall through */
 					default:
 						/*
 						 * Older kernels do not process
@@ -4487,12 +4497,12 @@ get_bprint_format(void *data, int size __maybe_unused,
 
 	printk = find_printk(tep, addr);
 	if (!printk) {
-		if (asprintf(&format, "%%pf: (NO FORMAT FOUND at %llx)\n", addr) < 0)
+		if (asprintf(&format, "%%ps: (NO FORMAT FOUND at %llx)\n", addr) < 0)
 			return NULL;
 		return format;
 	}
 
-	if (asprintf(&format, "%s: %s", "%pf", printk->printk) < 0)
+	if (asprintf(&format, "%s: %s", "%ps", printk->printk) < 0)
 		return NULL;
 
 	return format;

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

end of thread, other threads:[~2019-09-20 16:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190918133419.7969-1-sakari.ailus@linux.intel.com>
2019-09-18 13:34 ` [PATCH v7 01/13] tools lib traceevent: Convert remaining %p[fF] users to %p[sS] Sakari Ailus
2019-09-18 13:58   ` Steven Rostedt
2019-09-18 15:22   ` Andy Shevchenko
2019-09-20 16:20   ` [tip: perf/urgent] " tip-bot2 for Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).