@@ -592,9 +592,7 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp)
struct nfsd3_readdirres *resp = rqstp->rq_resp;
loff_t offset;
- dprintk("nfsd: READDIR(3) %s %d bytes at %d\n",
- SVCFH_fmt(&argp->fh),
- argp->count, (u32) argp->cookie);
+ trace_nfsd3_proc_readdir(rqstp, &argp->fh, argp->cookie, argp->count);
nfsd3_init_dirlist_pages(rqstp, resp, argp->count);
@@ -626,9 +624,7 @@ nfsd3_proc_readdirplus(struct svc_rqst *rqstp)
struct nfsd3_readdirres *resp = rqstp->rq_resp;
loff_t offset;
- dprintk("nfsd: READDIR+(3) %s %d bytes at %d\n",
- SVCFH_fmt(&argp->fh),
- argp->count, (u32) argp->cookie);
+ trace_nfsd3_proc_readdirplus(rqstp, &argp->fh, argp->cookie, argp->count);
nfsd3_init_dirlist_pages(rqstp, resp, argp->count);
@@ -1080,6 +1080,8 @@ nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
u64 cookie = readdir->rd_cookie;
static const nfs4_verifier zeroverf;
+ trace_nfsd4_readdir(rqstp, &cstate->current_fh, cookie, readdir->rd_dircount);
+
/* no need to check permission - this will be done in nfsd_readdir() */
if (readdir->rd_bmval[1] & NFSD_WRITEONLY_ATTRS_WORD1)
@@ -606,9 +606,7 @@ nfsd_proc_readdir(struct svc_rqst *rqstp)
struct nfsd_readdirres *resp = rqstp->rq_resp;
loff_t offset;
- dprintk("nfsd: READDIR %s %d bytes at %d\n",
- SVCFH_fmt(&argp->fh),
- argp->count, argp->cookie);
+ trace_nfsd_proc_readdir(rqstp, &argp->fh, argp->cookie, argp->count);
nfsd_init_dirlist_pages(rqstp, resp, argp->count);
@@ -2574,6 +2574,38 @@ DEFINE_NFSD_VFS_RENAME_EVENT(nfsd_proc_rename);
DEFINE_NFSD_VFS_RENAME_EVENT(nfsd3_proc_rename);
DEFINE_NFSD_VFS_RENAME_EVENT(nfsd4_rename);
+DECLARE_EVENT_CLASS(nfsd_vfs_readdir_class,
+ TP_PROTO(struct svc_rqst *rqstp,
+ struct svc_fh *fhp,
+ u64 cookie, u32 count),
+ TP_ARGS(rqstp, fhp, cookie, count),
+ TP_STRUCT__entry(
+ SVC_RQST_ENDPOINT_FIELDS(rqstp)
+ __field(u32, fh_hash)
+ __field(u64, cookie)
+ __field(u32, count)
+ ),
+ TP_fast_assign(
+ SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp);
+ __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
+ __entry->cookie = cookie;
+ __entry->count = count;
+ ),
+ TP_printk("xid=0x%08x fh_hash=0x%08x cookie=0x%llx count=%u",
+ __entry->xid, __entry->fh_hash, __entry->cookie, __entry->count)
+);
+
+#define DEFINE_NFSD_VFS_READDIR_EVENT(__name) \
+ DEFINE_EVENT(nfsd_vfs_readdir_class, __name, \
+ TP_PROTO(struct svc_rqst *rqstp, struct svc_fh *fhp, \
+ u64 cookie, u32 count), \
+ TP_ARGS(rqstp, fhp, cookie, count))
+
+DEFINE_NFSD_VFS_READDIR_EVENT(nfsd_proc_readdir);
+DEFINE_NFSD_VFS_READDIR_EVENT(nfsd3_proc_readdir);
+DEFINE_NFSD_VFS_READDIR_EVENT(nfsd3_proc_readdirplus);
+DEFINE_NFSD_VFS_READDIR_EVENT(nfsd4_readdir);
+
#endif /* _NFSD_TRACE_H */
#undef TRACE_INCLUDE_PATH
...and remove the legacy dprintks. Signed-off-by: Jeff Layton <jlayton@kernel.org> --- fs/nfsd/nfs3proc.c | 8 ++------ fs/nfsd/nfs4proc.c | 2 ++ fs/nfsd/nfsproc.c | 4 +--- fs/nfsd/trace.h | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 9 deletions(-)