diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-01-17 13:49:23 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-02-01 21:00:59 -0500 |
commit | 495ceddac0cfbf4e859badd3619cb5d5bccbdb3d (patch) | |
tree | d828489dbc114b9ea911f465aef050db3a3effd4 | |
parent | 19293fe7beb005caad1dc139eab1094288df30e0 (diff) |
parse-events: Use arg field size to test for pointer
Using the "len" variable in print_str_arg() to test if the
value is an array when the arg field size is zero is incorrect.
When the arg field size is zero, the data is an dynamic value
regardless if FIELD_IS_ARRAY is set or not. It may not be set
for strings at the end of the record.
Only assume the data is a pointer if the arg->field.field->size
is sizeof long.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | parse-events.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/parse-events.c b/parse-events.c index 99c9593..70194a6 100644 --- a/parse-events.c +++ b/parse-events.c | |||
@@ -3128,7 +3128,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, | |||
3128 | * is a pointer. | 3128 | * is a pointer. |
3129 | */ | 3129 | */ |
3130 | if (!(arg->field.field->flags & FIELD_IS_ARRAY) && | 3130 | if (!(arg->field.field->flags & FIELD_IS_ARRAY) && |
3131 | len == pevent->long_size) { | 3131 | arg->field.field->size == pevent->long_size) { |
3132 | addr = *(unsigned long *)(data + arg->field.field->offset); | 3132 | addr = *(unsigned long *)(data + arg->field.field->offset); |
3133 | trace_seq_printf(s, "%lx", addr); | 3133 | trace_seq_printf(s, "%lx", addr); |
3134 | break; | 3134 | break; |