linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bastien Curutchet <bastien.curutchet@bootlin.com>
To: linux-trace-devel@vger.kernel.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 Bastien Curutchet <bastien.curutchet@bootlin.com>
Subject: [PATCH] kbuffer: fix endianness flags for big-endian host
Date: Tue, 04 Nov 2025 09:45:00 +0100	[thread overview]
Message-ID: <20251104-fix-parse-v1-1-5af9b8965886@bootlin.com> (raw)

When KBUFFER_ENDIAN_SAME_AS_HOST is set on a big-endian host, the
KBUFFER_FL_BIG_ENDIAN flag is added to the local flags variable instead
of the kbuf->flags. Since the local flags variable has already been
copied to kbuf->flags at that time, the KBUFFER_FL_BIG_ENDIAN flag is
lost when we leave the function.

Add KBUFFER_FL_BIG_ENDIAN to the kbuf->flags when
KBUFFER_ENDIAN_SAME_AS_HOST is used on a big-endian host.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Fixes: 5f2aa8497c5b ("libtraceevent kbuffer: Add SAME_AS_HOST for endian and size")
---
 src/kbuffer-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kbuffer-parse.c b/src/kbuffer-parse.c
index 71291adf0860b8392e6cfa0b0640c6472def422c..232d1688934a946e19f52886c2d25e4c73637b4c 100644
--- a/src/kbuffer-parse.c
+++ b/src/kbuffer-parse.c
@@ -247,7 +247,7 @@ kbuffer_alloc(enum kbuffer_long_size size, enum kbuffer_endian endian)
 
 	if (host_is_bigendian()) {
 		if (endian == KBUFFER_ENDIAN_SAME_AS_HOST)
-			flags |= KBUFFER_FL_BIG_ENDIAN;
+			kbuf->flags |= KBUFFER_FL_BIG_ENDIAN;
 		kbuf->flags |= KBUFFER_FL_HOST_BIG_ENDIAN;
 	}
 

---
base-commit: b3f5849527ae226b88342ef80fc42c66ab206f99
change-id: 20251028-fix-parse-7395a8571b72

Best regards,
-- 
Bastien Curutchet <bastien.curutchet@bootlin.com>


                 reply	other threads:[~2025-11-04  8:45 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=20251104-fix-parse-v1-1-5af9b8965886@bootlin.com \
    --to=bastien.curutchet@bootlin.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).