[PATCH 02/21] add definitions for BLKTRACESETUP2

Johannes Thumshirn posted 21 patches 3 weeks, 2 days ago
There is a newer version of this series
[PATCH 02/21] add definitions for BLKTRACESETUP2
Posted by Johannes Thumshirn 3 weeks, 2 days ago
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.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 */
+};
+
 #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)
 
 #endif
-- 
2.51.0
Re: [PATCH 02/21] add definitions for BLKTRACESETUP2
Posted by Chaitanya Kulkarni 1 week, 6 days ago
On 9/9/25 04:07, Johannes Thumshirn wrote:
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.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 */
> +};
> +
>   #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)
>   
>   #endif

This definitely needs a commit log explaining why you need setup2 struct and
what kind of problem it is solving.

-ck


Re: [PATCH 02/21] add definitions for BLKTRACESETUP2
Posted by Johannes Thumshirn 1 week, 6 days ago
On 9/19/25 9:53 AM, Chaitanya Kulkarni wrote:
> On 9/9/25 04:07, Johannes Thumshirn wrote:
>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.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 */
>> +};
>> +
>>    #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)
>>    
>>    #endif
> This definitely needs a commit log explaining why you need setup2 struct and
> what kind of problem it is solving.

Whoopsie, you're 100% right!