aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2022-12-13 22:16:51 -0500
committerSteven Rostedt (Google) <rostedt@goodmis.org>2022-12-13 22:24:02 -0500
commit4fb990a5a922d13dff847939a565a0adfa4e1b37 (patch)
tree3c4d36cbf988472187478dd64a33742f09ba3203
parentb458d28dd36cbb37d5eb54f15dc0a26b1d2575a1 (diff)
downloadlibtraceevent-4fb990a5a922d13dff847939a565a0adfa4e1b37.tar.gz
libtraceevent: Calculate dynamic size for dynamic fields as well as arrays
With the new "cpumask_t" field, which is dynamic and is denoted with "__data_loc", it needs to be processed as dynamic in size, and not as static. When calculating the field size, check for both the field being an array as well as being dynamic, as it can be dynamic without being an array. Link: https://lore.kernel.org/linux-trace-devel/20221213221651.0d36897a@gandalf.local.home Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--src/event-parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/event-parse.c b/src/event-parse.c
index d1363a5..8ec95a2 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -1927,7 +1927,7 @@ static int event_read_fields(struct tep_event *event, struct tep_format_field **
free_token(token);
- if (field->flags & TEP_FIELD_IS_ARRAY) {
+ if (field->flags & (TEP_FIELD_IS_ARRAY | TEP_FIELD_IS_DYNAMIC)) {
if (field->arraylen)
field->elementsize = field->size / field->arraylen;
else if (field->flags & TEP_FIELD_IS_DYNAMIC)