All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sharp <dhsharp@google.com>
To: linux-kernel@vger.kernel.org
Cc: David Sharp <dhsharp@google.com>,
	Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>,
	Stephane Eranian <eranian@google.com>
Subject: [PATCH perf 2/2] perf: trace-event-parse: support printing short fields
Date: Thu, 10 Mar 2011 14:55:56 -0800	[thread overview]
Message-ID: <1299797756-13546-3-git-send-email-dhsharp@google.com> (raw)
In-Reply-To: <1299797756-13546-1-git-send-email-dhsharp@google.com>

Handle "%hd" etc. in pretty_print()

Signed-off-by: David Sharp <dhsharp@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Stephane Eranian <eranian@google.com>
---
 tools/perf/util/trace-event-parse.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 67fe01a..0cf4366 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -2534,6 +2534,9 @@ static void pretty_print(void *data, int size, struct event *event)
 			case '%':
 				printf("%%");
 				break;
+			case 'h':
+				ls--;
+				goto cont_process;
 			case 'l':
 				ls++;
 				goto cont_process;
@@ -2589,6 +2592,12 @@ static void pretty_print(void *data, int size, struct event *event)
 					}
 				}
 				switch (ls) {
+				case -2:
+					printf(format, (char)val);
+					break;
+				case -1:
+					printf(format, (short)val);
+					break;
 				case 0:
 					printf(format, (int)val);
 					break;
-- 
1.7.3.1


  parent reply	other threads:[~2011-03-10 22:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 22:55 [PATCH perf 0/2] perf: trace-event-parse: support more operators and print formats David Sharp
2011-03-10 22:55 ` [PATCH perf 1/2] perf: trace-event-parse: support additional operators: '!', '~', and '!=' David Sharp
2011-03-10 22:55 ` David Sharp [this message]
2011-03-10 23:17 ` [PATCH perf 0/2] perf: trace-event-parse: support more operators and print formats Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2011-03-21 22:34 David Sharp
2011-03-21 22:34 ` [PATCH perf 2/2] perf: trace-event-parse: support printing short fields David Sharp

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=1299797756-13546-3-git-send-email-dhsharp@google.com \
    --to=dhsharp@google.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /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.