[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250925150427.67394-8-johannes.thumshirn@wdc.com>
Date: Thu, 25 Sep 2025 17:04:12 +0200
From: Johannes Thumshirn <johannes.thumshirn@....com>
To: Jens Axboe <axboe@...nel.dk>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org,
linux-btrace@...r.kernel.org,
John Garry <john.g.garry@...cle.com>,
Hannes Reinecke <hare@...e.de>,
Damien Le Moal <dlemoal@...nel.org>,
Christoph Hellwig <hch@....de>,
Naohiro Aota <naohiro.aota@....com>,
Shinichiro Kawasaki <shinichiro.kawasaki@....com>,
Chaitanya Kulkarni <chaitanyak@...dia.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
Johannes Thumshirn <johannes.thumshirn@....com>
Subject: [PATCH blktrace v2 07/22] 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