Skip to content

Commit d1253c6

Browse files
riteshharjanibrauner
authored andcommitted
iomap: trace: Add missing flags to [IOMAP_|IOMAP_F_]FLAGS_STRINGS
This adds missing iomap flags to IOMAP_FLAGS_STRINGS & IOMAP_F_FLAGS_STRINGS for tracing. While we are at it, let's also print values of iomap->type & iomap->flags. e.g. trace for ATOMIC_BIO flag set xfs_io-1203 [000] ..... 183.001559: iomap_iter_dstmap: dev 8:32 ino 0xc bdev 8:32 addr 0x84200000 offset 0x0 length 0x10000 type MAPPED (0x2) flags DIRTY|ATOMIC_BIO (0x102) e.g. trace with DONTCACHE flag set xfs_io-1110 [007] ..... 238.780532: iomap_iter: dev 8:16 ino 0x83 pos 0x1000 length 0x1000 status 0 flags WRITE|DONTCACHE (0x401) ops xfs_buffered_write_iomap_ops caller iomap_file_buffered_write+0xab/0x0 Reviewed-by: "Darrick J. Wong" <[email protected]> Signed-off-by: "Ritesh Harjani (IBM)" <[email protected]> Link: https://lore.kernel.org/dcaff476004805544b6ad6d54d0c4adee1f7184f.1744432270.git.ritesh.list@gmail.com Reviewed-by: Ojaswin Mujoo <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 336bac5 commit d1253c6

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

fs/iomap/trace.h

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,26 @@ DEFINE_RANGE_EVENT(iomap_dio_rw_queued);
9999
{ IOMAP_FAULT, "FAULT" }, \
100100
{ IOMAP_DIRECT, "DIRECT" }, \
101101
{ IOMAP_NOWAIT, "NOWAIT" }, \
102-
{ IOMAP_ATOMIC, "ATOMIC" }
102+
{ IOMAP_OVERWRITE_ONLY, "OVERWRITE_ONLY" }, \
103+
{ IOMAP_UNSHARE, "UNSHARE" }, \
104+
{ IOMAP_DAX, "DAX" }, \
105+
{ IOMAP_ATOMIC, "ATOMIC" }, \
106+
{ IOMAP_DONTCACHE, "DONTCACHE" }
103107

104108
#define IOMAP_F_FLAGS_STRINGS \
105109
{ IOMAP_F_NEW, "NEW" }, \
106110
{ IOMAP_F_DIRTY, "DIRTY" }, \
107111
{ IOMAP_F_SHARED, "SHARED" }, \
108112
{ IOMAP_F_MERGED, "MERGED" }, \
109113
{ IOMAP_F_BUFFER_HEAD, "BH" }, \
110-
{ IOMAP_F_SIZE_CHANGED, "SIZE_CHANGED" }
114+
{ IOMAP_F_XATTR, "XATTR" }, \
115+
{ IOMAP_F_BOUNDARY, "BOUNDARY" }, \
116+
{ IOMAP_F_ANON_WRITE, "ANON_WRITE" }, \
117+
{ IOMAP_F_ATOMIC_BIO, "ATOMIC_BIO" }, \
118+
{ IOMAP_F_PRIVATE, "PRIVATE" }, \
119+
{ IOMAP_F_SIZE_CHANGED, "SIZE_CHANGED" }, \
120+
{ IOMAP_F_STALE, "STALE" }
121+
111122

112123
#define IOMAP_DIO_STRINGS \
113124
{IOMAP_DIO_FORCE_WAIT, "DIO_FORCE_WAIT" }, \
@@ -138,15 +149,17 @@ DECLARE_EVENT_CLASS(iomap_class,
138149
__entry->bdev = iomap->bdev ? iomap->bdev->bd_dev : 0;
139150
),
140151
TP_printk("dev %d:%d ino 0x%llx bdev %d:%d addr 0x%llx offset 0x%llx "
141-
"length 0x%llx type %s flags %s",
152+
"length 0x%llx type %s (0x%x) flags %s (0x%x)",
142153
MAJOR(__entry->dev), MINOR(__entry->dev),
143154
__entry->ino,
144155
MAJOR(__entry->bdev), MINOR(__entry->bdev),
145156
__entry->addr,
146157
__entry->offset,
147158
__entry->length,
148159
__print_symbolic(__entry->type, IOMAP_TYPE_STRINGS),
149-
__print_flags(__entry->flags, "|", IOMAP_F_FLAGS_STRINGS))
160+
__entry->type,
161+
__print_flags(__entry->flags, "|", IOMAP_F_FLAGS_STRINGS),
162+
__entry->flags)
150163
)
151164

152165
#define DEFINE_IOMAP_EVENT(name) \
@@ -185,7 +198,7 @@ TRACE_EVENT(iomap_writepage_map,
185198
__entry->bdev = iomap->bdev ? iomap->bdev->bd_dev : 0;
186199
),
187200
TP_printk("dev %d:%d ino 0x%llx bdev %d:%d pos 0x%llx dirty len 0x%llx "
188-
"addr 0x%llx offset 0x%llx length 0x%llx type %s flags %s",
201+
"addr 0x%llx offset 0x%llx length 0x%llx type %s (0x%x) flags %s (0x%x)",
189202
MAJOR(__entry->dev), MINOR(__entry->dev),
190203
__entry->ino,
191204
MAJOR(__entry->bdev), MINOR(__entry->bdev),
@@ -195,7 +208,9 @@ TRACE_EVENT(iomap_writepage_map,
195208
__entry->offset,
196209
__entry->length,
197210
__print_symbolic(__entry->type, IOMAP_TYPE_STRINGS),
198-
__print_flags(__entry->flags, "|", IOMAP_F_FLAGS_STRINGS))
211+
__entry->type,
212+
__print_flags(__entry->flags, "|", IOMAP_F_FLAGS_STRINGS),
213+
__entry->flags)
199214
);
200215

201216
TRACE_EVENT(iomap_iter,

0 commit comments

Comments
 (0)