From: Vaibhav Nagarnaik Date: Thu, 5 Apr 2012 22:48:03 +0000 (+0200) Subject: parse-events: Support '+' opcode in print format X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b48285980de2070948c8ac73629c605ad9202589;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: David Sharp Signed-off-by: Vaibhav Nagarnaik Link: http://lkml.kernel.org/r/1310785241-3799-4-git-send-email-vnagarnaik@google.com Signed-off-by: Steven Rostedt Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Steven Rostedt Cc: Borislav Petkov Cc: Jiri Olsa Cc: Arun Sharma Cc: Namhyung Kim Signed-off-by: Frederic Weisbecker --- diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 4d5092f67167..476626af7317 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -2047,6 +2047,18 @@ static int arg_num_eval(struct print_arg *arg, long long *val) break; *val = left - right; 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: do_warning("unknown op '%s'", arg->op.op); ret = 0;