[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250925150427.67394-7-johannes.thumshirn@wdc.com>
Date: Thu, 25 Sep 2025 17:04:11 +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 06/22] blktrace: support protocol version 8
Also support protocol version 8 in conjunction with protocol version 7.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@....com>
---
blktrace.h | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/blktrace.h b/blktrace.h
index 74dfb48..3305fa0 100644
--- a/blktrace.h
+++ b/blktrace.h
@@ -69,6 +69,7 @@ extern struct timespec abs_start_time;
#define CHECK_MAGIC(t) (((t)->magic & 0xffffff00) == BLK_IO_TRACE_MAGIC)
#define SUPPORTED_VERSION (0x07)
+#define SUPPORTED_VERSION2 (0x08)
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define be16_to_cpu(x) __bswap_16(x)
@@ -90,13 +91,17 @@ extern struct timespec abs_start_time;
static inline int verify_trace(struct blk_io_trace *t)
{
+ u8 version;
+
if (!CHECK_MAGIC(t)) {
fprintf(stderr, "bad trace magic %x\n", t->magic);
return 1;
}
- if ((t->magic & 0xff) != SUPPORTED_VERSION) {
- fprintf(stderr, "unsupported trace version %x\n",
- t->magic & 0xff);
+
+ version = t->magic & 0xff;
+ if (version != SUPPORTED_VERSION &&
+ version != SUPPORTED_VERSION2) {
+ fprintf(stderr, "unsupported trace version %x\n", version);
return 1;
}
--
2.51.0
Powered by blists - more mailing lists