Skip to content

Commit 927244f

Browse files
riteshharjaniaxboe
authored andcommitted
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) <[email protected]> Reviewed-by: Ojaswin Mujoo <[email protected]> Link: https://lore.kernel.org/r/44317cb2ec4588f6a2c1501a96684e6a1196e8ba.1747921498.git.ritesh.list@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 914e0dc commit 927244f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/trace/events/block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/tracepoint.h>
1212
#include <uapi/linux/ioprio.h>
1313

14-
#define RWBS_LEN 8
14+
#define RWBS_LEN 9
1515

1616
#define IOPRIO_CLASS_STRINGS \
1717
{ IOPRIO_CLASS_NONE, "none" }, \

kernel/trace/blktrace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,6 +1887,8 @@ void blk_fill_rwbs(char *rwbs, blk_opf_t opf)
18871887
rwbs[i++] = 'S';
18881888
if (opf & REQ_META)
18891889
rwbs[i++] = 'M';
1890+
if (opf & REQ_ATOMIC)
1891+
rwbs[i++] = 'U';
18901892

18911893
rwbs[i] = '\0';
18921894
}

0 commit comments

Comments
 (0)