linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd libtraceevent: Fix bprint '#' parsing
@ 2020-11-13 13:29 Vincent Whitchurch
  2020-11-13 14:25 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Whitchurch @ 2020-11-13 13:29 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, kernel, Vincent Whitchurch

Fix handling of '#' in bprint format specifiers.

For example, with this:

 trace_printk("jiffies %lu pending %#x\n", jiffies, pending);

Before:

  bprint: __do_softirq: jiffies 4294919108 pending x
  ...
  bprint: [FAILED TO PARSE] ip=... fmt=... buf=ARRAY[]

After:

  bprint: __do_softirq: jiffies 4294919108 pending 0x4
  ...
  bprint: __do_softirq: jiffies 4294919109 pending 0x4

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---
 lib/traceevent/event-parse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
index 06fa3dd..a62d2f7 100644
--- a/lib/traceevent/event-parse.c
+++ b/lib/traceevent/event-parse.c
@@ -4456,6 +4456,8 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
 				goto process_again;
 			case '.':
 				goto process_again;
+			case '#':
+				goto process_again;
 			case 'z':
 			case 'Z':
 				ls = 1;
-- 
2.28.0


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

* Re: [PATCH] trace-cmd libtraceevent: Fix bprint '#' parsing
  2020-11-13 13:29 [PATCH] trace-cmd libtraceevent: Fix bprint '#' parsing Vincent Whitchurch
@ 2020-11-13 14:25 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2020-11-13 14:25 UTC (permalink / raw)
  To: Vincent Whitchurch; +Cc: linux-trace-devel, kernel

On Fri, 13 Nov 2020 14:29:53 +0100
Vincent Whitchurch <vincent.whitchurch@axis.com> wrote:

> Fix handling of '#' in bprint format specifiers.
> 
> For example, with this:
> 
>  trace_printk("jiffies %lu pending %#x\n", jiffies, pending);
> 
> Before:
> 
>   bprint: __do_softirq: jiffies 4294919108 pending x
>   ...
>   bprint: [FAILED TO PARSE] ip=... fmt=... buf=ARRAY[]
> 
> After:
> 
>   bprint: __do_softirq: jiffies 4294919108 pending 0x4
>   ...
>   bprint: __do_softirq: jiffies 4294919109 pending 0x4

Thanks Vincent!

Note, I'll be adding this to both the trace-cmd tree and the
libtraceevent.git repo (I need to update the website to reflect this).

  git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git

-- Steve


> 
> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
> ---
>  lib/traceevent/event-parse.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
> index 06fa3dd..a62d2f7 100644
> --- a/lib/traceevent/event-parse.c
> +++ b/lib/traceevent/event-parse.c
> @@ -4456,6 +4456,8 @@ static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
>  				goto process_again;
>  			case '.':
>  				goto process_again;
> +			case '#':
> +				goto process_again;
>  			case 'z':
>  			case 'Z':
>  				ls = 1;


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

end of thread, other threads:[~2020-11-13 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-13 13:29 [PATCH] trace-cmd libtraceevent: Fix bprint '#' parsing Vincent Whitchurch
2020-11-13 14:25 ` Steven Rostedt

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).