Commit b4828598 authored by Vaibhav Nagarnaik's avatar Vaibhav Nagarnaik Committed by Frederic Weisbecker

parse-events: Support '+' opcode in print format

The '+' opcode is not supported in the arguments for the print format.
This patch adds support for it.

Cc: Michael Rubin <mrubin@google.com>
Cc: David Sharp <dhsharp@google.com>
Signed-off-by: default avatarVaibhav Nagarnaik <vnagarnaik@google.com>
Link: http://lkml.kernel.org/r/1310785241-3799-4-git-send-email-vnagarnaik@google.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
parent a2525a08
...@@ -2047,6 +2047,18 @@ static int arg_num_eval(struct print_arg *arg, long long *val) ...@@ -2047,6 +2047,18 @@ static int arg_num_eval(struct print_arg *arg, long long *val)
break; break;
*val = left - right; *val = left - right;
break; break;
case '+':
if (arg->op.left->type == PRINT_NULL)
left = 0;
else
ret = arg_num_eval(arg->op.left, &left);
if (!ret)
break;
ret = arg_num_eval(arg->op.right, &right);
if (!ret)
break;
*val = left + 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment