Re: [PATCH 04/16] blktrace: add definitions for struct blk_io_trace2
Christoph Hellwig <[email protected]> Fri, 19 Sep 2025 17:08:47 +0200
| Newsgroups | org.kernel.vger.linux-btrace,org.kernel.vger.linux-block,org.kernel.vger.linux-kernel,org.kernel.vger.linux-trace-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Sep 09, 2025 at 01:05:59PM +0200, Johannes Thumshirn wrote:
> +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 */
> +};
This structure is not u64-aligned, which means it will have different
sizes for x86-32 vs all other architectures, making it a pain to handle.
Also maybe add some extra padding so that we can extend this?