aboutsummaryrefslogtreecommitdiff
path: root/fs/nfsd/trace.h
diff options
context:
space:
mode:
authorGravatar Chuck Lever <chuck.lever@oracle.com> 2022-03-27 16:42:20 -0400
committerGravatar Chuck Lever <chuck.lever@oracle.com> 2022-05-23 11:06:29 -0400
commit0122e882119ddbd9efa6edfeeac3f5c704a7aeea (patch)
tree513311503e752b21d4da8b3721c14097780a0069 /fs/nfsd/trace.h
parentNFSD: Move documenting comment for nfsd4_process_open2() (diff)
downloadlinux-0122e882119ddbd9efa6edfeeac3f5c704a7aeea.tar.gz
linux-0122e882119ddbd9efa6edfeeac3f5c704a7aeea.tar.bz2
linux-0122e882119ddbd9efa6edfeeac3f5c704a7aeea.zip
NFSD: Trace filecache opens
Instrument calls to nfsd_open_verified() to get a sense of the filecache hit rate. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/trace.h')
-rw-r--r--fs/nfsd/trace.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index 242fa123e0e9..feb6e6f834b6 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -784,6 +784,34 @@ TRACE_EVENT(nfsd_file_acquire,
__entry->nf_file, __entry->status)
);
+TRACE_EVENT(nfsd_file_open,
+ TP_PROTO(struct nfsd_file *nf, __be32 status),
+ TP_ARGS(nf, status),
+ TP_STRUCT__entry(
+ __field(unsigned int, nf_hashval)
+ __field(void *, nf_inode) /* cannot be dereferenced */
+ __field(int, nf_ref)
+ __field(unsigned long, nf_flags)
+ __field(unsigned long, nf_may)
+ __field(void *, nf_file) /* cannot be dereferenced */
+ ),
+ TP_fast_assign(
+ __entry->nf_hashval = nf->nf_hashval;
+ __entry->nf_inode = nf->nf_inode;
+ __entry->nf_ref = refcount_read(&nf->nf_ref);
+ __entry->nf_flags = nf->nf_flags;
+ __entry->nf_may = nf->nf_may;
+ __entry->nf_file = nf->nf_file;
+ ),
+ TP_printk("hash=0x%x inode=%p ref=%d flags=%s may=%s file=%p",
+ __entry->nf_hashval,
+ __entry->nf_inode,
+ __entry->nf_ref,
+ show_nf_flags(__entry->nf_flags),
+ show_nfsd_may_flags(__entry->nf_may),
+ __entry->nf_file)
+)
+
DECLARE_EVENT_CLASS(nfsd_file_search_class,
TP_PROTO(struct inode *inode, unsigned int hash, int found),
TP_ARGS(inode, hash, found),