diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-02-20 03:09:21 +0300 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-03-02 16:43:39 +0300 |
commit | 11d03d0a1ed8dbdabab1b5ab21861ad5cad4aef2 (patch) | |
tree | a24511916a63c257ca71b92cbe7d6bb0c222b182 /fs/nfs/nfstrace.h | |
parent | eace45a18ccb34a746c3060601103aa14ca29923 (diff) | |
download | linux-11d03d0a1ed8dbdabab1b5ab21861ad5cad4aef2.tar.xz |
NFS: Trace effects of the readdirplus heuristic
Enable tracking of when the readdirplus heuristic causes a page cache
invalidation.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/nfstrace.h')
-rw-r--r-- | fs/nfs/nfstrace.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h index 7c1102b991d0..ec2645d20abf 100644 --- a/fs/nfs/nfstrace.h +++ b/fs/nfs/nfstrace.h @@ -273,6 +273,56 @@ DEFINE_NFS_UPDATE_SIZE_EVENT(wcc); DEFINE_NFS_UPDATE_SIZE_EVENT(update); DEFINE_NFS_UPDATE_SIZE_EVENT(grow); +DECLARE_EVENT_CLASS(nfs_inode_range_event, + TP_PROTO( + const struct inode *inode, + loff_t range_start, + loff_t range_end + ), + + TP_ARGS(inode, range_start, range_end), + + TP_STRUCT__entry( + __field(dev_t, dev) + __field(u32, fhandle) + __field(u64, fileid) + __field(u64, version) + __field(loff_t, range_start) + __field(loff_t, range_end) + ), + + TP_fast_assign( + const struct nfs_inode *nfsi = NFS_I(inode); + + __entry->dev = inode->i_sb->s_dev; + __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); + __entry->fileid = nfsi->fileid; + __entry->version = inode_peek_iversion_raw(inode); + __entry->range_start = range_start; + __entry->range_end = range_end; + ), + + TP_printk( + "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu " + "range=[%lld, %lld]", + MAJOR(__entry->dev), MINOR(__entry->dev), + (unsigned long long)__entry->fileid, + __entry->fhandle, __entry->version, + __entry->range_start, __entry->range_end + ) +); + +#define DEFINE_NFS_INODE_RANGE_EVENT(name) \ + DEFINE_EVENT(nfs_inode_range_event, name, \ + TP_PROTO( \ + const struct inode *inode, \ + loff_t range_start, \ + loff_t range_end \ + ), \ + TP_ARGS(inode, range_start, range_end)) + +DEFINE_NFS_INODE_RANGE_EVENT(nfs_readdir_invalidate_cache_range); + DECLARE_EVENT_CLASS(nfs_readdir_event, TP_PROTO( const struct file *file, |