Messages in this thread Patch in this message | | | From | David Sharp <> | Subject | [PATCH perf 2/2] perf: trace-event-parse: support printing short fields | Date | Mon, 21 Mar 2011 15:34:06 -0700 |
| |
Handle "%hd" etc. in pretty_print()
Signed-off-by: David Sharp <dhsharp@google.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.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
| |