All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Cc: Douglas Raillard <douglas.raillard@arm.com>,
	Valentin Schneider <vschneid@redhat.com>
Subject: [PATCH] libtraceevent: Calculate dynamic size for dynamic fields as well as arrays
Date: Tue, 13 Dec 2022 22:16:51 -0500	[thread overview]
Message-ID: <20221213221651.0d36897a@gandalf.local.home> (raw)

From 3a1c06828b67a31de01491a400fdc20674a0f95f Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Date: Tue, 13 Dec 2022 22:14:22 -0500
Subject: [PATCH] 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.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 src/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/event-parse.c b/src/event-parse.c
index d1363a5826d5..8ec95a2ac069 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)
-- 
2.35.1


                 reply	other threads:[~2022-12-14  3:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221213221651.0d36897a@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=douglas.raillard@arm.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.