public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Namhyung Kim <namhyung@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Andi Kleen <andi@firstfloor.org>,
	Stephane Eranian <eranian@google.com>,
	Wang Nan <wangnan0@huawei.com>
Subject: Re: [PATCH] tools lib traceevent: Add '~' operation within arg_num_eval()
Date: Fri, 26 Feb 2016 20:39:13 -0300	[thread overview]
Message-ID: <20160226233913.GD8720@kernel.org> (raw)
In-Reply-To: <20160226181328.22f47129@gandalf.local.home>

Em Fri, Feb 26, 2016 at 06:13:28PM -0500, Steven Rostedt escreveu:
> When evaluating values for print flags, if the value included a '~'
> operator, the parsing would fail. This broke kmalloc's parsing of:
> 
> __print_flags(REC->gfp_flags, "|", {(unsigned
> long)((((((( gfp_t)(0x400000u|0x2000000u)) | (( gfp_t)0x40u) |
> (( gfp_t)0x80u) | (( gfp_t)0x20000u)) | (( gfp_t)0x02u)) |
> (( gfp_t)0x08u)) | (( gfp_t)0x4000u) | (( gfp_t)0x10000u) |
> (( gfp_t)0x1000u) | (( gfp_t)0x200u)) & ~(( gfp_t)0x2000000u))
>                                         ^
>                                         |
>                                       here

Thanks, I'll test this later.

- Arnaldo
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index c3bd294a63d1..557d8edf07f3 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -2397,6 +2397,12 @@ static int arg_num_eval(struct print_arg *arg, long long *val)
>  				break;
>  			*val = left + right;
>  			break;
> +		case '~':
> +			ret = arg_num_eval(arg->op.right, &right);
> +			if (!ret)
> +				break;
> +			*val = ~right;
> +			break;
>  		default:
>  			do_warning("unknown op '%s'", arg->op.op);
>  			ret = 0;

  reply	other threads:[~2016-02-26 23:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 18:52 [PATCH 1/5] perf report: Fix comparing of dynamic entries Namhyung Kim
2016-02-26 18:52 ` [PATCH 2/5] perf report: Fix indentation of dynamic entries in hierarchy Namhyung Kim
2016-02-27  9:43   ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-26 18:52 ` [PATCH 3/5] perf report: Left align " Namhyung Kim
2016-02-27  9:43   ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-26 18:52 ` [PATCH 4/5] perf report: Fix dynamic entry display " Namhyung Kim
2016-02-26 21:43   ` Arnaldo Carvalho de Melo
2016-02-26 21:45     ` Arnaldo Carvalho de Melo
2016-02-26 22:08       ` Arnaldo Carvalho de Melo
2016-02-26 22:24         ` Arnaldo Carvalho de Melo
2016-02-26 22:26         ` Steven Rostedt
2016-02-26 22:37           ` Arnaldo Carvalho de Melo
2016-02-26 23:12             ` Jiri Olsa
2016-02-26 23:13               ` Jiri Olsa
2016-02-26 23:13         ` [PATCH] tools lib traceevent: Add '~' operation within arg_num_eval() Steven Rostedt
2016-02-26 23:39           ` Arnaldo Carvalho de Melo [this message]
2016-02-26 23:45           ` David Ahern
2016-03-10 16:16             ` David Ahern
2016-03-10 19:28               ` Arnaldo Carvalho de Melo
2016-03-11  8:47           ` [tip:perf/core] " tip-bot for Steven Rostedt
2016-02-27  9:44   ` [tip:perf/core] perf hists: Fix dynamic entry display in hierarchy tip-bot for Namhyung Kim
2016-02-26 18:52 ` [PATCH 5/5] perf report: Update column width of dynamic entries Namhyung Kim
2016-02-26 22:43   ` Arnaldo Carvalho de Melo
2016-02-27  9:44   ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-26 21:23 ` [PATCH 1/5] perf report: Fix comparing " Jiri Olsa
2016-02-27  9:43 ` [tip:perf/core] perf hists: " tip-bot for Namhyung Kim

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=20160226233913.GD8720@kernel.org \
    --to=acme@kernel.org \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=wangnan0@huawei.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