]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nfs: add cache_validity to the nfs_inode_event tracepoints
authorJeff Layton <jlayton@kernel.org>
Wed, 18 Jun 2025 13:19:12 +0000 (09:19 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 14 Jul 2025 22:20:27 +0000 (15:20 -0700)
Managing the cache_validity flags is the deep voodoo of NFS cache
coherency. Let's have a little extra visibility into that value via the
nfs_inode_event tracepoints.

Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20250618-nfs-tracepoints-v2-1-540c9fb48da2@kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfstrace.h

index f49f064c5ee571463c6596bf08a4a148acae50a7..96b1323318c2f54251dfd104183c47929f08c801 100644 (file)
@@ -57,6 +57,7 @@ DECLARE_EVENT_CLASS(nfs_inode_event,
                        __field(u32, fhandle)
                        __field(u64, fileid)
                        __field(u64, version)
+                       __field(unsigned long, cache_validity)
                ),
 
                TP_fast_assign(
@@ -65,14 +66,17 @@ DECLARE_EVENT_CLASS(nfs_inode_event,
                        __entry->fileid = nfsi->fileid;
                        __entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
                        __entry->version = inode_peek_iversion_raw(inode);
+                       __entry->cache_validity = nfsi->cache_validity;
                ),
 
                TP_printk(
-                       "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu ",
+                       "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu cache_validity=0x%lx (%s)",
                        MAJOR(__entry->dev), MINOR(__entry->dev),
                        (unsigned long long)__entry->fileid,
                        __entry->fhandle,
-                       (unsigned long long)__entry->version
+                       (unsigned long long)__entry->version,
+                       __entry->cache_validity,
+                       nfs_show_cache_validity(__entry->cache_validity)
                )
 );