diff options
author | Vaibhav Nagarnaik <[email protected]> | 2012-04-06 00:48:03 +0200 |
---|---|---|
committer | Frederic Weisbecker <[email protected]> | 2012-04-25 13:35:38 +0200 |
commit | b48285980de2070948c8ac73629c605ad9202589 (patch) | |
tree | c2414ffe485d927abca7b3b73b3acae332114857 | |
parent | a2525a0852d81b1cf1155d75d1e3db9682fee191 (diff) |
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 <[email protected]>
Cc: David Sharp <[email protected]>
Signed-off-by: Vaibhav Nagarnaik <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Steven Rostedt <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Arun Sharma <[email protected]>
Cc: Namhyung Kim <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 12 |
1 files changed, 12 insertions, 0 deletions
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; |