From 16e5be155745f09e08c27e3d2fca39e54da10691 Mon Sep 17 00:00:00 2001 From: Chris Kirby Date: Wed, 14 Jan 2026 14:44:15 -0600 Subject: [PATCH] Improve tracing for get_file_block() Print the first and last entries, the entry_nr and entry_bytes. Signed-off-by: Chris Kirby --- kmod/src/scoutfs_trace.h | 28 ++++++++++++++++++++++++---- kmod/src/srch.c | 2 +- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/kmod/src/scoutfs_trace.h b/kmod/src/scoutfs_trace.h index c7157352..7da72738 100644 --- a/kmod/src/scoutfs_trace.h +++ b/kmod/src/scoutfs_trace.h @@ -2620,24 +2620,44 @@ TRACE_EVENT(scoutfs_block_dirty_ref, ); TRACE_EVENT(scoutfs_get_file_block, - TP_PROTO(struct super_block *sb, u64 blkno, int flags), + TP_PROTO(struct super_block *sb, u64 blkno, int flags, + struct scoutfs_srch_block *srb), - TP_ARGS(sb, blkno, flags), + TP_ARGS(sb, blkno, flags, srb), TP_STRUCT__entry( SCSB_TRACE_FIELDS __field(__u64, blkno) + __field(__u32, entry_nr) + __field(__u32, entry_bytes) __field(int, flags) + __field(__u64, first_hash) + __field(__u64, first_ino) + __field(__u64, first_id) + __field(__u64, last_hash) + __field(__u64, last_ino) + __field(__u64, last_id) ), TP_fast_assign( SCSB_TRACE_ASSIGN(sb); __entry->blkno = blkno; + __entry->entry_nr = __le32_to_cpu(srb->entry_nr); + __entry->entry_bytes = __le32_to_cpu(srb->entry_bytes); __entry->flags = flags; + __entry->first_hash = __le64_to_cpu(srb->first.hash); + __entry->first_ino = __le64_to_cpu(srb->first.ino); + __entry->first_id = __le64_to_cpu(srb->first.id); + __entry->last_hash = __le64_to_cpu(srb->last.hash); + __entry->last_ino = __le64_to_cpu(srb->last.ino); + __entry->last_id = __le64_to_cpu(srb->last.id); ), - TP_printk(SCSBF" blkno %llu flags 0x%x", - SCSB_TRACE_ARGS, __entry->blkno, __entry->flags) + TP_printk(SCSBF" blkno %llu nr %u bytes %u flags 0x%x first_hash 0x%llx first_ino %llu first_id 0x%llx last_hash 0x%llx last_ino %llu last_id 0x%llx", + SCSB_TRACE_ARGS, __entry->blkno, __entry->entry_nr, + __entry->entry_bytes, __entry->flags, + __entry->first_hash, __entry->first_ino, __entry->first_id, + __entry->last_hash, __entry->last_ino, __entry->last_id) ); TRACE_EVENT(scoutfs_block_stale, diff --git a/kmod/src/srch.c b/kmod/src/srch.c index e1b5fb90..c106027e 100644 --- a/kmod/src/srch.c +++ b/kmod/src/srch.c @@ -443,7 +443,7 @@ out: sfl->blocks = cpu_to_le64(blk + 1); if (bl) { - trace_scoutfs_get_file_block(sb, bl->blkno, flags); + trace_scoutfs_get_file_block(sb, bl->blkno, flags, bl->data); } *bl_ret = bl;