Re: [PATCH] erofs: add folio order to trace_erofs_read_folio

From: Gao Xiang

Date: Wed Jun 17 2026 - 03:25:48 EST


Hi Xusheng,

On 2026/6/17 15:16, Zhan Xusheng wrote:
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.

Signed-off-by: Zhan Xusheng <zhanxusheng@xxxxxxxxxx>
---
include/trace/events/erofs.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h
index cd0e3fd8c23f..73d3bfd8b673 100644
--- a/include/trace/events/erofs.h
+++ b/include/trace/events/erofs.h
@@ -90,6 +90,7 @@ TRACE_EVENT(erofs_read_folio,
__field(erofs_nid_t, nid )
__field(int, dir )
__field(pgoff_t, index )
+ __field(unsigned int, order )
__field(int, uptodate)
__field(bool, raw )
),
@@ -99,15 +100,17 @@ TRACE_EVENT(erofs_read_folio,
__entry->nid = EROFS_I(inode)->nid;
__entry->dir = S_ISDIR(inode->i_mode);
__entry->index = folio->index;
+ __entry->order = folio_order(folio);
__entry->uptodate = folio_test_uptodate(folio);

I guess uptodate is unneeded, it should be always !uptodate.

__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, "
+ "uptodate = %d raw = %d",

Just a nit, can we rearrange the message into one line
in this patch?

i.e.
"dev = (%d,%d), nid = %llu, %s, index = %lu, order = %u, raw = %d",

Thanks,
Gao Xiang

show_dev_nid(__entry),
show_file_type(__entry->dir),
(unsigned long)__entry->index,
+ __entry->order,
__entry->uptodate,
__entry->raw)
);