From 406ef631b62f4fd0f22428282a1f6e5bc7f08488 Mon Sep 17 00:00:00 2001 From: Chris Kirby Date: Tue, 9 Sep 2025 13:38:52 -0500 Subject: [PATCH] Add tracing for get_file_block() and scoutfs_ioc_search_xattrs(). Signed-off-by: Chris Kirby --- kmod/src/scoutfs_trace.h | 42 ++++++++++++++++++++++++++++++++++++++++ kmod/src/srch.c | 6 ++++++ 2 files changed, 48 insertions(+) diff --git a/kmod/src/scoutfs_trace.h b/kmod/src/scoutfs_trace.h index 8494503f..56da1bff 100644 --- a/kmod/src/scoutfs_trace.h +++ b/kmod/src/scoutfs_trace.h @@ -2465,6 +2465,27 @@ TRACE_EVENT(scoutfs_block_dirty_ref, __entry->block_blkno, __entry->block_seq) ); +TRACE_EVENT(scoutfs_get_file_block, + TP_PROTO(struct super_block *sb, u64 blkno, int flags), + + TP_ARGS(sb, blkno, flags), + + TP_STRUCT__entry( + SCSB_TRACE_FIELDS + __field(__u64, blkno) + __field(int, flags) + ), + + TP_fast_assign( + SCSB_TRACE_ASSIGN(sb); + __entry->blkno = blkno; + __entry->flags = flags; + ), + + TP_printk(SCSBF" blkno %llu flags 0x%x", + SCSB_TRACE_ARGS, __entry->blkno, __entry->flags) +); + TRACE_EVENT(scoutfs_block_stale, TP_PROTO(struct super_block *sb, struct scoutfs_block_ref *ref, struct scoutfs_block_header *hdr, u32 magic, u32 crc), @@ -3062,6 +3083,27 @@ DEFINE_EVENT(scoutfs_srch_compact_class, scoutfs_srch_compact_client_recv, TP_ARGS(sb, sc) ); +TRACE_EVENT(scoutfs_ioc_search_xattrs, + TP_PROTO(struct super_block *sb, u64 ino, u64 last_ino), + + TP_ARGS(sb, ino, last_ino), + + TP_STRUCT__entry( + SCSB_TRACE_FIELDS + __field(u64, ino) + __field(u64, last_ino) + ), + + TP_fast_assign( + SCSB_TRACE_ASSIGN(sb); + __entry->ino = ino; + __entry->last_ino = last_ino; + ), + + TP_printk(SCSBF" ino %llu last_ino %llu", SCSB_TRACE_ARGS, + __entry->ino, __entry->last_ino) +); + #endif /* _TRACE_SCOUTFS_H */ /* This part must be outside protection */ diff --git a/kmod/src/srch.c b/kmod/src/srch.c index 39b0f595..455a523f 100644 --- a/kmod/src/srch.c +++ b/kmod/src/srch.c @@ -442,6 +442,10 @@ out: if (ret == 0 && (flags & GFB_INSERT) && blk >= le64_to_cpu(sfl->blocks)) sfl->blocks = cpu_to_le64(blk + 1); + if (bl) { + trace_scoutfs_get_file_block(sb, bl->blkno, flags); + } + *bl_ret = bl; return ret; } @@ -972,6 +976,8 @@ int scoutfs_srch_search_xattrs(struct super_block *sb, scoutfs_inc_counter(sb, srch_search_xattrs); + trace_scoutfs_ioc_search_xattrs(sb, ino, last_ino); + *done = false; srch_init_rb_root(sroot);