aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorVaibhav Nagarnaik <vnagarnaik@google.com>2012-04-05 18:48:03 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2012-04-25 07:35:38 -0400
commitb48285980de2070948c8ac73629c605ad9202589 (patch)
treec2414ffe485d927abca7b3b73b3acae332114857 /tools
parenta2525a0852d81b1cf1155d75d1e3db9682fee191 (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 <mrubin@google.com> Cc: David Sharp <dhsharp@google.com> Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com> Link: http://lkml.kernel.org/r/1310785241-3799-4-git-send-email-vnagarnaik@google.com Signed-off-by: Steven 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: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/traceevent/event-parse.c12
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)
2047 break; 2047 break;
2048 *val = left - right; 2048 *val = left - right;
2049 break; 2049 break;
2050 case '+':
2051 if (arg->op.left->type == PRINT_NULL)
2052 left = 0;
2053 else
2054 ret = arg_num_eval(arg->op.left, &left);
2055 if (!ret)
2056 break;
2057 ret = arg_num_eval(arg->op.right, &right);
2058 if (!ret)
2059 break;
2060 *val = left + right;
2061 break;
2050 default: 2062 default:
2051 do_warning("unknown op '%s'", arg->op.op); 2063 do_warning("unknown op '%s'", arg->op.op);
2052 ret = 0; 2064 ret = 0;