[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251015105658.527262-8-johannes.thumshirn@wdc.com>
Date: Wed, 15 Oct 2025 12:56:45 +0200
From: Johannes Thumshirn <johannes.thumshirn@....com>
To: axboe@...nel.dk
Cc: chaitanyak@...dia.com,
dlemoal@...nel.org,
hare@...e.de,
hch@....de,
john.g.garry@...cle.com,
linux-block@...r.kernel.org,
linux-btrace@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org,
martin.petersen@...cle.com,
mathieu.desnoyers@...icios.com,
mhiramat@...nel.org,
naohiro.aota@....com,
rostedt@...dmis.org,
shinichiro.kawasaki@....com,
Johannes Thumshirn <johannes.thumshirn@....com>
Subject: [PATCH blktrace v3 07/20] blkparse: pass magic to get_magic
Pass the magic value to get_magic() instead of the whole 'struct
blk_io_trace'.
This is a preparation for distinguishing between two different types of
blktrace protocol versions in blkparse.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@....com>
---
blkparse.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/blkparse.c b/blkparse.c
index 512a2d2..d58322c 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -2420,12 +2420,12 @@ static inline __u16 get_pdulen(struct blk_io_trace *bit)
return __bswap_16(bit->pdu_len);
}
-static inline __u32 get_magic(struct blk_io_trace *bit)
+static inline __u32 get_magic(__u32 magic)
{
if (data_is_native)
- return bit->magic;
+ return magic;
- return __bswap_32(bit->magic);
+ return __bswap_32(magic);
}
static int read_events(int fd, int always_block, int *fdblock)
@@ -2458,7 +2458,7 @@ static int read_events(int fd, int always_block, int *fdblock)
if (data_is_native == -1 && check_data_endianness(bit->magic))
break;
- magic = get_magic(bit);
+ magic = get_magic(bit->magic);
if ((magic & 0xffffff00) != BLK_IO_TRACE_MAGIC) {
fprintf(stderr, "Bad magic %x\n", magic);
break;
@@ -2604,7 +2604,7 @@ static int ms_prime(struct ms_stream *msp)
if (data_is_native == -1 && check_data_endianness(bit->magic))
goto err;
- magic = get_magic(bit);
+ magic = get_magic(bit->magic);
if ((magic & 0xffffff00) != BLK_IO_TRACE_MAGIC) {
fprintf(stderr, "Bad magic %x\n", magic);
goto err;
--
2.51.0
Powered by blists - more mailing lists