aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-01-17 13:49:23 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-02-01 21:00:59 -0500
commit495ceddac0cfbf4e859badd3619cb5d5bccbdb3d (patch)
treed828489dbc114b9ea911f465aef050db3a3effd4
parent19293fe7beb005caad1dc139eab1094288df30e0 (diff)
downloadtrace-cmd-495ceddac0cfbf4e859badd3619cb5d5bccbdb3d.tar.gz
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse-events.c b/parse-events.c
index 99c95932..70194a6e 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,
* is a pointer.
*/
if (!(arg->field.field->flags & FIELD_IS_ARRAY) &&
- len == pevent->long_size) {
+ arg->field.field->size == pevent->long_size) {
addr = *(unsigned long *)(data + arg->field.field->offset);
trace_seq_printf(s, "%lx", addr);
break;