[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251015105435.527088-8-johannes.thumshirn@wdc.com>
Date: Wed, 15 Oct 2025 12:54:26 +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 v3 07/16] blktrace: add definitions for blk_user_trace_setup2
Add definitions for a version 2 of the blk_user_trace_setup ioctl. This
new ioctl will enable a different struct layout of the binary data passed
to user-space when using a new version of the blktrace utility requesting
the new struct layout.
Reviewed-by: Damien Le Moal <dlemoal@...nel.org>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@....com>
---
include/uapi/linux/blktrace_api.h | 16 ++++++++++++++++
include/uapi/linux/fs.h | 1 +
kernel/trace/blktrace.c | 3 +++
3 files changed, 20 insertions(+)
diff --git a/include/uapi/linux/blktrace_api.h b/include/uapi/linux/blktrace_api.h
index 1bfb635e309b..a6958708d477 100644
--- a/include/uapi/linux/blktrace_api.h
+++ b/include/uapi/linux/blktrace_api.h
@@ -129,6 +129,7 @@ enum {
};
#define BLKTRACE_BDEV_SIZE 32
+#define BLKTRACE_BDEV_SIZE2 64
/*
* User setup structure passed with BLKTRACESETUP
@@ -143,4 +144,19 @@ struct blk_user_trace_setup {
__u32 pid;
};
+/*
+ * User setup structure passed with BLKTRACESETUP2
+ */
+struct blk_user_trace_setup2 {
+ char name[BLKTRACE_BDEV_SIZE2]; /* output */
+ __u64 act_mask; /* input */
+ __u32 buf_size; /* input */
+ __u32 buf_nr; /* input */
+ __u64 start_lba;
+ __u64 end_lba;
+ __u32 pid;
+ __u32 flags; /* currently unused */
+ __u64 reserved[11];
+};
+
#endif /* _UAPIBLKTRACE_H */
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
index beb4c2d1e41c..957ce3343a4f 100644
--- a/include/uapi/linux/fs.h
+++ b/include/uapi/linux/fs.h
@@ -300,6 +300,7 @@ struct file_attr {
#define BLKGETDISKSEQ _IOR(0x12,128,__u64)
/* 130-136 are used by zoned block device ioctls (uapi/linux/blkzoned.h) */
/* 137-141 are used by blk-crypto ioctls (uapi/linux/blk-crypto.h) */
+#define BLKTRACESETUP2 _IOWR(0x12, 142, struct blk_user_trace_setup2)
#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
#define FIBMAP _IO(0x00,1) /* bmap access */
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index df90422ae613..c31b8f433116 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -1601,6 +1601,9 @@ static int __init init_blk_tracer(void)
return 1;
}
+ BUILD_BUG_ON(__alignof__(struct blk_user_trace_setup2) %
+ __alignof__(long));
+
return 0;
}
--
2.51.0
Powered by blists - more mailing lists