All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Vaibhav Nagarnaik <vnagarnaik@google.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, vnagarnaik@google.com,
	hpa@zytor.com, mingo@kernel.org, peterz@infradead.org,
	dhsharp@google.com, namhyung.kim@lge.com, bp@alien8.de,
	jolsa@redhat.com, fweisbec@gmail.com, acme@infradead.org,
	mrubin@google.com, rostedt@goodmis.org, tglx@linutronix.de,
	asharma@fb.com
Subject: [tip:perf/core] parse-events: Support '+' opcode in print format
Date: Mon, 21 May 2012 02:41:32 -0700	[thread overview]
Message-ID: <tip-b48285980de2070948c8ac73629c605ad9202589@git.kernel.org> (raw)
In-Reply-To: <1310785241-3799-4-git-send-email-vnagarnaik@google.com>

Commit-ID:  b48285980de2070948c8ac73629c605ad9202589
Gitweb:     http://git.kernel.org/tip/b48285980de2070948c8ac73629c605ad9202589
Author:     Vaibhav Nagarnaik <vnagarnaik@google.com>
AuthorDate: Fri, 6 Apr 2012 00:48:03 +0200
Committer:  Frederic Weisbecker <fweisbec@gmail.com>
CommitDate: Wed, 25 Apr 2012 13:35:38 +0200

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>
---
 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 4d5092f..476626a 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;

  parent reply	other threads:[~2012-05-21  9:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-16  3:00 [PATCH 1/4] trace-cmd: Add parse error checking target Vaibhav Nagarnaik
2011-07-16  3:00 ` [PATCH 2/4] trace-cmd: Handle invalid opcode parsing gracefully Vaibhav Nagarnaik
2011-07-25 14:03   ` Steven Rostedt
2012-05-21  9:39   ` [tip:perf/core] parse-events: " tip-bot for Vaibhav Nagarnaik
2011-07-16  3:00 ` [PATCH 3/4] trace-cmd: Handle opcode parsing error Vaibhav Nagarnaik
2011-07-25 14:01   ` Steven Rostedt
2011-07-25 18:06     ` Vaibhav Nagarnaik
2011-07-25 18:40   ` Vaibhav Nagarnaik
2012-05-21  9:39     ` [tip:perf/core] parse-events: " tip-bot for Vaibhav Nagarnaik
2011-07-16  3:00 ` [PATCH 4/4] trace-cmd: Support '+' opcode in print format Vaibhav Nagarnaik
2011-07-25 14:02   ` Steven Rostedt
2012-05-21  9:41   ` tip-bot for Vaibhav Nagarnaik [this message]
2011-07-25 13:32 ` [PATCH 1/4] trace-cmd: Add parse error checking target Steven Rostedt
2011-07-25 18:06   ` Vaibhav Nagarnaik
2011-07-25 18:39 ` [PATCH v2 " Vaibhav Nagarnaik
2011-07-29 14:19   ` Steven Rostedt
2011-07-29 17:41     ` Vaibhav Nagarnaik
2011-07-29 17:53       ` Steven Rostedt
2011-07-29 19:07         ` Vaibhav Nagarnaik
2011-07-30  1:33           ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-b48285980de2070948c8ac73629c605ad9202589@git.kernel.org \
    --to=vnagarnaik@google.com \
    --cc=acme@infradead.org \
    --cc=asharma@fb.com \
    --cc=bp@alien8.de \
    --cc=dhsharp@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mrubin@google.com \
    --cc=namhyung.kim@lge.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.