lkml.org 
[lkml]   [2011]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] trace-cmd: Support '+' opcode in print format
Date
The '+' opcode is not supported in the arguments for the print format.
This patch adds support for it.

Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
---
parse-events.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/parse-events.c b/parse-events.c
index 068c77f..2e39415 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -2033,6 +2033,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;
--
1.7.3.1


\
 
 \ /
  Last update: 2011-07-16 05:03    [W:0.845 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site