[PATCH trace-cmd 1/3] parse-events: Add support for printing short fields.

From: David Sharp
Date: Wed Mar 09 2011 - 19:06:08 EST


Handle "%hd" etc. in pretty_print()

Signed-off-by: David Sharp <dhsharp@xxxxxxxxxx>
Google-Bug-Id: 3501052
---
parse-events.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/parse-events.c b/parse-events.c
index 3d59d92..bfb7ff5 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -3607,6 +3607,9 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
case '#':
/* FIXME: need to handle properly */
goto cont_process;
+ case 'h':
+ ls--;
+ goto cont_process;
case 'l':
ls++;
goto cont_process;
@@ -3687,6 +3690,18 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
strcpy(format, "0x%llx");
}
switch (ls) {
+ case -2:
+ if (len_as_arg)
+ trace_seq_printf(s, format, len_arg, (char)val);
+ else
+ trace_seq_printf(s, format, (char)val);
+ break;
+ case -1:
+ if (len_as_arg)
+ trace_seq_printf(s, format, len_arg, (short)val);
+ else
+ trace_seq_printf(s, format, (short)val);
+ break;
case 0:
if (len_as_arg)
trace_seq_printf(s, format, len_arg, (int)val);
--
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/