iomap: Add processed for iomap_iter
authorKassey Li <quic_yingangl@quicinc.com>
Mon, 19 Feb 2024 02:11:38 +0000 (10:11 +0800)
committerChristian Brauner <brauner@kernel.org>
Wed, 21 Feb 2024 07:37:50 +0000 (08:37 +0100)
processed: The number of bytes processed by the body in the
most recent  iteration, or a negative errno. 0 causes the iteration to
stop.

The processed is useful to check when the loop breaks.

Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
Link: https://lore.kernel.org/r/20240219021138.3481763-1-quic_yingangl@quicinc.com
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/iomap/trace.h

index 3ef694f..0a991c4 100644 (file)
@@ -206,6 +206,7 @@ TRACE_EVENT(iomap_iter,
                __field(u64, ino)
                __field(loff_t, pos)
                __field(u64, length)
+               __field(s64, processed)
                __field(unsigned int, flags)
                __field(const void *, ops)
                __field(unsigned long, caller)
@@ -215,15 +216,17 @@ TRACE_EVENT(iomap_iter,
                __entry->ino = iter->inode->i_ino;
                __entry->pos = iter->pos;
                __entry->length = iomap_length(iter);
+               __entry->processed = iter->processed;
                __entry->flags = iter->flags;
                __entry->ops = ops;
                __entry->caller = caller;
        ),
-       TP_printk("dev %d:%d ino 0x%llx pos 0x%llx length 0x%llx flags %s (0x%x) ops %ps caller %pS",
+       TP_printk("dev %d:%d ino 0x%llx pos 0x%llx length 0x%llx processed %lld flags %s (0x%x) ops %ps caller %pS",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                   __entry->ino,
                   __entry->pos,
                   __entry->length,
+                  __entry->processed,
                   __print_flags(__entry->flags, "|", IOMAP_FLAGS_STRINGS),
                   __entry->flags,
                   __entry->ops,