[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fb62594c-d881-4f06-9cf0-ca44968e5d3b@kernel.org>
Date: Wed, 1 Oct 2025 16:48:10 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Johannes Thumshirn <johannes.thumshirn@....com>,
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>,
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>
Subject: Re: [PATCH blktrace v2 03/22] blktrace: add definitions for
BLKTRACESETUP2
On 9/26/25 00:04, Johannes Thumshirn wrote:
> Add definitions for a new BLKTRACESETUP2 ioctl(2).
>
> This new ioctl(2) will request a new, updated structure layout from the
> kernel which enhances the storage size of the 'action' field in order to
> store additional tracepoints.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@....com>
> ---
> blktrace_api.h | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/blktrace_api.h b/blktrace_api.h
> index 172b4c2..9f435a5 100644
> --- a/blktrace_api.h
> +++ b/blktrace_api.h
> @@ -139,9 +139,24 @@ struct blk_user_trace_setup {
> __u32 pid;
> };
>
> +/*
> + * User setup structure passed with BLKTRACESETUP2
> + */
> +struct blk_user_trace_setup2 {
> + char name[32]; /* output */
> + __u64 act_mask; /* input */
> + __u32 buf_size; /* input */
> + __u32 buf_nr; /* input */
> + __u64 start_lba;
> + __u64 end_lba;
> + __u32 pid;
> + __u32 reserved; /* for futute use */
> +};
Kernel side defined:
+struct blk_user_trace_setup2 {
+ char name[32]; /* 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[7];
+};
So not the same struct fields and size...
Why not use the definition in include/uapi/linux/blktrace_api.h ?
> +
> #define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
> #define BLKTRACESTART _IO(0x12,116)
> #define BLKTRACESTOP _IO(0x12,117)
> #define BLKTRACETEARDOWN _IO(0x12,118)
> +#define BLKTRACESETUP2 _IOWR(0x12, 142, struct blk_user_trace_setup2)
Same here. This is in include/uapi/linux/fs.h, so why duplicate it ?
>
> #endif
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists