diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2016-02-26 18:13:28 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-03-01 16:58:15 -0500 |
commit | 0b012aab38f828e5c33f820d353c06eeff1e50c5 (patch) | |
tree | 70b9d5d98fe73606bfbb24f96d2c118c9eabf4e9 | |
parent | a6a8531330bcdff29477f9ccfefcacba34e24df9 (diff) | |
download | trace-cmd-0b012aab38f828e5c33f820d353c06eeff1e50c5.tar.gz |
tools lib traceevent: Add '~' operation within arg_num_eval()
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
Link: http://lkml.kernel.org/r/20160226181328.22f47129@gandalf.local.home
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | event-parse.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/event-parse.c b/event-parse.c index 65ac7cf1..d87c21b5 100644 --- a/event-parse.c +++ b/event-parse.c @@ -2398,6 +2398,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; |