[PATCH perf 2/2] perf: trace-event-parse: support printing short fields
From: David Sharp
Date: Thu Mar 10 2011 - 17:56:36 EST
Handle "%hd" etc. in pretty_print()
Signed-off-by: David Sharp <dhsharp@xxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/