Messages in this thread Patch in this message | | | From | David Sharp <> | Subject | [PATCH trace-cmd 1/3] parse-events: Add support for printing short fields. | Date | Wed, 9 Mar 2011 15:58:55 -0800 |
| |
Handle "%hd" etc. in pretty_print()
Signed-off-by: David Sharp <dhsharp@google.com> 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
| |