traceevent/block: Add REQ_ATOMIC flag to block trace events
authorRitesh Harjani (IBM) <ritesh.list@gmail.com>
Thu, 22 May 2025 13:51:10 +0000 (19:21 +0530)
committerJens Axboe <axboe@kernel.dk>
Fri, 23 May 2025 15:18:48 +0000 (09:18 -0600)
commit927244f6efff6df5f8f2ab58c7d1eec9f90cc3f2
treed3f95a7ca9269ed17876af5e64f8e8f72f3fecf2
parent914e0dc5082a335ea5e7d905e99e1a1cde001369
traceevent/block: Add REQ_ATOMIC flag to block trace events

Filesystems like XFS can implement atomic write I/O using either
REQ_ATOMIC flag set in the bio or via CoW operation. It will be useful
if we have a flag in trace events to distinguish between the two. This
patch adds char 'U' (Untorn writes) to rwbs field of the trace events
if REQ_ATOMIC flag is set in the bio.

<W/ REQ_ATOMIC>
=================
xfs_io-4238    [009] .....  4148.126843: block_rq_issue: 259,0 WFSU 16384 () 768 + 32 none,0,0 [xfs_io]
<idle>-0       [009] d.h1.  4148.129864: block_rq_complete: 259,0 WFSU () 768 + 32 none,0,0 [0]

<W/O REQ_ATOMIC>
===============
xfs_io-4237    [010] .....  4143.325616: block_rq_issue: 259,0 WS 16384 () 768 + 32 none,0,0 [xfs_io]
<idle>-0       [010] d.H1.  4143.329138: block_rq_complete: 259,0 WS () 768 + 32 none,0,0 [0]

Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/44317cb2ec4588f6a2c1501a96684e6a1196e8ba.1747921498.git.ritesh.list@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/trace/events/block.h
kernel/trace/blktrace.c