]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
erofs: add folio order to trace_erofs_read_folio
authorZhan Xusheng <zhanxusheng@xiaomi.com>
Wed, 17 Jun 2026 07:43:34 +0000 (15:43 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 18 Jun 2026 08:19:33 +0000 (16:19 +0800)
erofs supports large folios for reads, but the actual folio order
instantiated in the page cache may be lower due to allocation
constraints such as memory fragmentation.

trace_erofs_read_folio already receives the folio being read but
currently records only its index. Add folio_order() to the tracepoint
so that users can observe the realized folio order and verify the
effectiveness of large folio reads.

Also drop the uptodate field: read_folio() is only called for a
non-uptodate folio, so it is always 0.

Suggested-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
include/trace/events/erofs.h

index cd0e3fd8c23f18e6e40420ee1f13b2cc74ca233d..0a178cb10fb1e3cd0c4729d47b0fffdea021ba5e 100644 (file)
@@ -90,7 +90,7 @@ TRACE_EVENT(erofs_read_folio,
                __field(erofs_nid_t,    nid     )
                __field(int,            dir     )
                __field(pgoff_t,        index   )
-               __field(int,            uptodate)
+               __field(unsigned int,   order   )
                __field(bool,           raw     )
        ),
 
@@ -99,16 +99,15 @@ TRACE_EVENT(erofs_read_folio,
                __entry->nid    = EROFS_I(inode)->nid;
                __entry->dir    = S_ISDIR(inode->i_mode);
                __entry->index  = folio->index;
-               __entry->uptodate = folio_test_uptodate(folio);
+               __entry->order  = folio_order(folio);
                __entry->raw = raw;
        ),
 
-       TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, uptodate = %d "
-               "raw = %d",
+       TP_printk("dev = (%d,%d), nid = %llu, %s, index = %lu, order = %u, raw = %d",
                show_dev_nid(__entry),
                show_file_type(__entry->dir),
                (unsigned long)__entry->index,
-               __entry->uptodate,
+               __entry->order,
                __entry->raw)
 );