Re: [PATCH] trace-cmd libtraceevent: Fix bprint '#' parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 Nov 2020 14:29:53 +0100
Vincent Whitchurch <vincent.whitchurch@xxxxxxxx> 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@xxxxxxxx>
> ---
>  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;




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux