* [PATCH] kbuffer: fix endianness flags for big-endian host
@ 2025-11-04 8:45 Bastien Curutchet
2025-11-27 14:44 ` Bastien Curutchet
0 siblings, 1 reply; 3+ messages in thread
From: Bastien Curutchet @ 2025-11-04 8:45 UTC (permalink / raw)
To: linux-trace-devel; +Cc: Thomas Petazzoni, Bastien Curutchet
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>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] kbuffer: fix endianness flags for big-endian host
2025-11-04 8:45 [PATCH] kbuffer: fix endianness flags for big-endian host Bastien Curutchet
@ 2025-11-27 14:44 ` Bastien Curutchet
2025-11-28 3:24 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Bastien Curutchet @ 2025-11-27 14:44 UTC (permalink / raw)
To: linux-trace-devel; +Cc: Thomas Petazzoni
Hi all,
Gentle ping here, has anyone had the chance to take a look at it ?
Best regards,
Bastien
On 11/4/25 9:45 AM, Bastien Curutchet wrote:
> 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,
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-28 3:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-04 8:45 [PATCH] kbuffer: fix endianness flags for big-endian host Bastien Curutchet
2025-11-27 14:44 ` Bastien Curutchet
2025-11-28 3:24 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox