[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250925150427.67394-6-johannes.thumshirn@wdc.com>
Date: Thu, 25 Sep 2025 17:04:10 +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 05/22] blktrace: add definitions for blk_io_trace2
Add 'struct blk_io_trace2' which represents the extended version of the
blktrace protocol.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@....com>
---
blktrace_api.h | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/blktrace_api.h b/blktrace_api.h
index 9f435a5..bbf075f 100644
--- a/blktrace_api.h
+++ b/blktrace_api.h
@@ -27,8 +27,19 @@ enum {
BLK_TC_END = 1 << 15, /* we've run out of bits! */
};
+enum blktrace_cat2 {
+ BLK_TC_ZONE_APPEND = 1 << 1ull, /* zone append */
+ BLK_TC_ZONE_RESET = 1 << 2ull, /* zone reset */
+ BLK_TC_ZONE_RESET_ALL = 1 << 3ull, /* zone reset all */
+ BLK_TC_ZONE_FINISH = 1 << 4ull, /* zone finish */
+ BLK_TC_ZONE_OPEN = 1 << 5ull, /* zone open */
+ BLK_TC_ZONE_CLOSE = 1 << 6ull, /* zone close */
+};
+
#define BLK_TC_SHIFT (16)
#define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT)
+#define BLK_TC_SHIFT2 (32)
+#define BLK_TC_ACT2(act) ((__u64)(act) << BLK_TC_SHIFT2)
/*
* Basic trace actions
@@ -51,6 +62,7 @@ enum {
__BLK_TA_REMAP, /* bio was remapped */
__BLK_TA_ABORT, /* request aborted */
__BLK_TA_DRV_DATA, /* binary driver data */
+ __BLK_TA_ZONE_MGMT, /* zone management command was issued */
__BLK_TA_CGROUP = 1 << 8,
};
@@ -85,12 +97,20 @@ enum blktrace_notify {
#define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
#define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
+#define BLK_TA_ZONE_APPEND (__BLK_TA_COMPLETE |\
+ BLK_TC_ACT2(BLK_TC_ZONE_APPEND))
+#define BLK_TA_ZONE_MGMT __BLK_TA_ZONE_MGMT
+#define BLK_TA_ZONE_PLUG (__BLK_TA_ZONE_PLUG | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_ZONE_UNPLUG (__BLK_TA_ZONE_UNPLUG |\
+ BLK_TC_ACT(BLK_TC_QUEUE))
+
#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
#define BLK_TN_MESSAGE (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY))
#define BLK_IO_TRACE_MAGIC 0x65617400
#define BLK_IO_TRACE_VERSION 0x07
+#define BLK_IO_TRACE2_VERSION 0x08
/*
* The trace itself
@@ -118,6 +138,21 @@ struct blk_io_trace_remap {
__u64 sector_from;
};
+struct blk_io_trace2 {
+ __u32 magic; /* MAGIC << 8 | BLK_IO_TRACE2_VERSION */
+ __u32 sequence; /* event number */
+ __u64 time; /* in nanoseconds */
+ __u64 sector; /* disk offset */
+ __u32 bytes; /* transfer length */
+ __u32 pid; /* who did it */
+ __u64 action; /* what happened */
+ __u32 device; /* device number */
+ __u32 cpu; /* on what cpu did it happen */
+ __u16 error; /* completion error */
+ __u16 pdu_len; /* length of data after this trace */
+ /* cgroup id will be stored here if exists */
+};
+
/*
* Payload with originating cgroup info
*/
--
2.51.0
Powered by blists - more mailing lists