提交 9eb42dee 编写于 作者: S Steven Rostedt 提交者: Arnaldo Carvalho de Melo

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
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: NDavid Ahern <dsahern@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20160226181328.22f47129@gandalf.local.homeSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 ea8f75f9
...@@ -2398,6 +2398,12 @@ static int arg_num_eval(struct print_arg *arg, long long *val) ...@@ -2398,6 +2398,12 @@ static int arg_num_eval(struct print_arg *arg, long long *val)
break; break;
*val = left + right; *val = left + right;
break; break;
case '~':
ret = arg_num_eval(arg->op.right, &right);
if (!ret)
break;
*val = ~right;
break;
default: default:
do_warning("unknown op '%s'", arg->op.op); do_warning("unknown op '%s'", arg->op.op);
ret = 0; ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册