diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2010-05-25 10:16:16 -0400 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2010-05-25 10:16:16 -0400 |
| commit | f2bda4634ff4deda253ab91f1b91c8006e3f95c4 (patch) | |
| tree | a90a0dbb7c2f7469f393f7cbbdc9302e045f8335 | |
| parent | 0a346bad14855356892142f6f2a683f63827a757 (diff) | |
parse-events: Let dynamic arrays have element size 1 for strings
If a dynamic array is a string set its element size to 1. We can later
handle shorts and ints.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -rw-r--r-- | parse-events.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/parse-events.c b/parse-events.c index 91d6788..9a5380c 100644 --- a/parse-events.c +++ b/parse-events.c | |||
| @@ -1379,6 +1379,8 @@ static int event_read_fields(struct event_format *event, struct format_field **f | |||
| 1379 | if (field->flags & FIELD_IS_ARRAY) { | 1379 | if (field->flags & FIELD_IS_ARRAY) { |
| 1380 | if (field->arraylen) | 1380 | if (field->arraylen) |
| 1381 | field->elementsize = field->size / field->arraylen; | 1381 | field->elementsize = field->size / field->arraylen; |
| 1382 | else if (field->flags & FIELD_IS_STRING) | ||
| 1383 | field->elementsize = 1; | ||
| 1382 | else | 1384 | else |
| 1383 | field->elementsize = event->pevent->long_size; | 1385 | field->elementsize = event->pevent->long_size; |
| 1384 | } else | 1386 | } else |
| @@ -2894,6 +2896,8 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg | |||
| 2894 | offset = pevent_read_number(pevent, | 2896 | offset = pevent_read_number(pevent, |
| 2895 | data + larg->dynarray.field->offset, | 2897 | data + larg->dynarray.field->offset, |
| 2896 | larg->dynarray.field->size); | 2898 | larg->dynarray.field->size); |
| 2899 | if (larg->dynarray.field->elementsize) | ||
| 2900 | field_size = larg->dynarray.field->elementsize; | ||
| 2897 | /* | 2901 | /* |
| 2898 | * The actual length of the dynamic array is stored | 2902 | * The actual length of the dynamic array is stored |
| 2899 | * in the top half of the field, and the offset | 2903 | * in the top half of the field, and the offset |
