From: Steven Rostedt <rostedt@goodmis.org>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Petr Mladek <pmladek@suse.com>,
linux-kernel@vger.kernel.org, rafael@kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-acpi@vger.kernel.org, devicetree@vger.kernel.org,
Rob Herring <robh@kernel.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Joe Perches <joe@perches.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Tzvetomir Stoyanov <tstoyanov@vmware.com>,
linux-trace-devel@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>,
Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH v7 01/13] tools lib traceevent: Convert remaining %p[fF] users to %p[sS]
Date: Wed, 18 Sep 2019 09:58:58 -0400 [thread overview]
Message-ID: <20190918095858.58d9d949@gandalf.local.home> (raw)
In-Reply-To: <20190918133419.7969-2-sakari.ailus@linux.intel.com>
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;
next prev parent reply other threads:[~2019-09-18 13:59 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 13:34 [PATCH v7 00/13] Device property improvements, add %pfw format specifier Sakari Ailus
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 [this message]
2019-09-18 15:22 ` Andy Shevchenko
2019-09-20 16:20 ` [tip: perf/urgent] " tip-bot2 for Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 02/13] software node: Get reference to parent swnode in get_parent op Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 03/13] software node: Make argument to to_software_node const Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 04/13] device property: Move fwnode_get_parent() up Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 05/13] device property: Add functions for accessing node's parents Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 06/13] device property: Add fwnode_get_name for returning the name of a node Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 07/13] device property: Add a function to obtain a node's prefix Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 08/13] lib/vsprintf: Remove support for %pF and %pf in favour of %pS and %ps Sakari Ailus
2019-09-19 7:58 ` Rafael J. Wysocki
2019-09-24 10:38 ` Petr Mladek
2019-10-02 12:06 ` Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 09/13] lib/vsprintf: Add a note on re-using %pf or %pF Sakari Ailus
2019-09-18 14:00 ` Steven Rostedt
2019-09-18 14:29 ` Sakari Ailus
2019-09-24 10:45 ` Petr Mladek
2019-10-02 12:02 ` Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 10/13] lib/vsprintf: Make use of fwnode API to obtain node names and separators Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 11/13] lib/vsprintf: OF nodes are first and foremost, struct device_nodes Sakari Ailus
2019-09-18 13:34 ` [PATCH v7 12/13] lib/vsprintf: Add %pfw conversion specifier for printing fwnode names Sakari Ailus
2019-09-24 12:47 ` Petr Mladek
2019-09-18 13:34 ` [PATCH v7 13/13] lib/test_printf: Add tests for %pfw printk modifier Sakari Ailus
2019-09-24 12:54 ` Petr Mladek
2019-09-19 8:00 ` [PATCH v7 00/13] Device property improvements, add %pfw format specifier Rafael J. Wysocki
2019-09-19 8:29 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190918095858.58d9d949@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=acme@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=joe@perches.com \
--cc=jolsa@redhat.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=pmladek@suse.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tstoyanov@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).