NFSD: Trace filecache opens
[ Upstream commit 0122e882119ddbd9efa6edfeeac3f5c704a7aeea ] Instrument calls to nfsd_open_verified() to get a sense of the filecache hit rate. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
09e30c0ad5
commit
47ef8b0821
2 changed files with 31 additions and 2 deletions
|
@ -996,10 +996,11 @@ open_file:
|
||||||
|
|
||||||
nf->nf_mark = nfsd_file_mark_find_or_create(nf);
|
nf->nf_mark = nfsd_file_mark_find_or_create(nf);
|
||||||
if (nf->nf_mark) {
|
if (nf->nf_mark) {
|
||||||
if (open)
|
if (open) {
|
||||||
status = nfsd_open_verified(rqstp, fhp, may_flags,
|
status = nfsd_open_verified(rqstp, fhp, may_flags,
|
||||||
&nf->nf_file);
|
&nf->nf_file);
|
||||||
else
|
trace_nfsd_file_open(nf, status);
|
||||||
|
} else
|
||||||
status = nfs_ok;
|
status = nfs_ok;
|
||||||
} else
|
} else
|
||||||
status = nfserr_jukebox;
|
status = nfserr_jukebox;
|
||||||
|
|
|
@ -795,6 +795,34 @@ TRACE_EVENT(nfsd_file_acquire,
|
||||||
__entry->nf_file, __entry->status)
|
__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,
|
DECLARE_EVENT_CLASS(nfsd_file_search_class,
|
||||||
TP_PROTO(struct inode *inode, unsigned int hash, int found),
|
TP_PROTO(struct inode *inode, unsigned int hash, int found),
|
||||||
TP_ARGS(inode, hash, found),
|
TP_ARGS(inode, hash, found),
|
||||||
|
|
Loading…
Add table
Reference in a new issue