summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2019-09-18 09:34:07 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-09-20 09:28:26 -0400
commitb295c3e39c1383e06ba1db4dd836018502e2ff3a (patch)
treeb776813b0e22845d91bcf4b14ee1d1e267c49734
parent055c67ed39887c5563e9540470a4617c1b772aec (diff)
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>
-rw-r--r--tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt10
-rw-r--r--tools/lib/traceevent/event-parse.c18
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 38bfea30a5f6..f6aca0df2151 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.
59 59
60The _tep_register_function()_ function registers a function name mapped to an 60The _tep_register_function()_ function registers a function name mapped to an
61address and (optional) module. This mapping is used in case the function tracer 61address and (optional) module. This mapping is used in case the function tracer
62or events have "%pF" or "%pS" parameter in its format string. It is common to 62or events have "%pS" parameter in its format string. It is common to pass in
63pass in the kallsyms function names with their corresponding addresses with this 63the kallsyms function names with their corresponding addresses with this
64function. The _tep_ argument is the trace event parser context. The _name_ is 64function. The _tep_ argument is the trace event parser context. The _name_ is
65the name of the function, the string is copied internally. The _addr_ is 65the name of the function, the string is copied internally. The _addr_ is the
66the start address of the function. The _mod_ is the kernel module 66start address of the function. The _mod_ is the kernel module the function may
67the function may be in (NULL for none). 67be in (NULL for none).
68 68
69The _tep_register_print_string()_ function registers a string by the address 69The _tep_register_print_string()_ function registers a string by the address
70it was stored in the kernel. Some strings internal to the kernel with static 70it 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 bb22238debfe..6f842af4550b 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
4367 switch (*ptr) { 4367 switch (*ptr) {
4368 case 's': 4368 case 's':
4369 case 'S': 4369 case 'S':
4370 case 'f':
4371 case 'F':
4372 case 'x': 4370 case 'x':
4373 break; 4371 break;
4372 case 'f':
4373 case 'F':
4374 /*
4375 * Pre-5.5 kernels use %pf and
4376 * %pF for printing symbols
4377 * while kernels since 5.5 use
4378 * %pfw for fwnodes. So check
4379 * %p[fF] isn't followed by 'w'.
4380 */
4381 if (ptr[1] != 'w')
4382 break;
4383 /* fall through */
4374 default: 4384 default:
4375 /* 4385 /*
4376 * Older kernels do not process 4386 * Older kernels do not process
@@ -4487,12 +4497,12 @@ get_bprint_format(void *data, int size __maybe_unused,
4487 4497
4488 printk = find_printk(tep, addr); 4498 printk = find_printk(tep, addr);
4489 if (!printk) { 4499 if (!printk) {
4490 if (asprintf(&format, "%%pf: (NO FORMAT FOUND at %llx)\n", addr) < 0) 4500 if (asprintf(&format, "%%ps: (NO FORMAT FOUND at %llx)\n", addr) < 0)
4491 return NULL; 4501 return NULL;
4492 return format; 4502 return format;
4493 } 4503 }
4494 4504
4495 if (asprintf(&format, "%s: %s", "%pf", printk->printk) < 0) 4505 if (asprintf(&format, "%s: %s", "%ps", printk->printk) < 0)
4496 return NULL; 4506 return NULL;
4497 4507
4498 return format; 4508 return format;