@@ -564,12 +564,7 @@ nfsd3_proc_link(struct svc_rqst *rqstp)
struct nfsd3_linkargs *argp = rqstp->rq_argp;
struct nfsd3_linkres *resp = rqstp->rq_resp;
- dprintk("nfsd: LINK(3) %s ->\n",
- SVCFH_fmt(&argp->ffh));
- dprintk("nfsd: -> %s %.*s\n",
- SVCFH_fmt(&argp->tfh),
- argp->tlen,
- argp->tname);
+ trace_nfsd_proc_link(rqstp, &argp->ffh, &argp->tfh, argp->tname, argp->tlen);
fh_copy(&resp->fh, &argp->ffh);
fh_copy(&resp->tfh, &argp->tfh);
@@ -977,6 +977,9 @@ nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
struct nfsd4_link *link = &u->link;
__be32 status;
+ trace_nfsd4_link(rqstp, &cstate->save_fh, &cstate->current_fh,
+ link->li_name, link->li_namelen);
+
status = nfsd_link(rqstp, &cstate->current_fh,
link->li_name, link->li_namelen, &cstate->save_fh);
if (!status)
@@ -481,12 +481,7 @@ nfsd_proc_link(struct svc_rqst *rqstp)
struct nfsd_linkargs *argp = rqstp->rq_argp;
struct nfsd_stat *resp = rqstp->rq_resp;
- dprintk("nfsd: LINK %s ->\n",
- SVCFH_fmt(&argp->ffh));
- dprintk("nfsd: %s %.*s\n",
- SVCFH_fmt(&argp->tfh),
- argp->tlen,
- argp->tname);
+ trace_nfsd_proc_link(rqstp, &argp->ffh, &argp->tfh, argp->tname, argp->tlen);
resp->status = nfsd_link(rqstp, &argp->tfh, argp->tname, argp->tlen,
&argp->ffh);
@@ -2465,6 +2465,41 @@ DECLARE_EVENT_CLASS(nfsd_vfs_symlink_class,
DEFINE_NFSD_VFS_SYMLINK_EVENT(nfsd_proc_symlink);
DEFINE_NFSD_VFS_SYMLINK_EVENT(nfsd3_proc_symlink);
DEFINE_NFSD_VFS_SYMLINK_EVENT(nfsd4_symlink);
+
+DECLARE_EVENT_CLASS(nfsd_vfs_link_class,
+ TP_PROTO(struct svc_rqst *rqstp,
+ struct svc_fh *sfhp,
+ struct svc_fh *tfhp,
+ const char *name,
+ unsigned int namelen),
+ TP_ARGS(rqstp, sfhp, tfhp, name, namelen),
+ TP_STRUCT__entry(
+ SVC_RQST_ENDPOINT_FIELDS(rqstp)
+ __field(u32, sfh_hash)
+ __field(u32, tfh_hash)
+ __string_len(name, name, namelen)
+ ),
+ TP_fast_assign(
+ SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp);
+ __entry->sfh_hash = knfsd_fh_hash(&sfhp->fh_handle);
+ __entry->tfh_hash = knfsd_fh_hash(&tfhp->fh_handle);
+ __assign_str(name);
+ ),
+ TP_printk("xid=0x%08x src_fh=0x%08x tgt_fh=0x%08x name=%s",
+ __entry->xid, __entry->sfh_hash, __entry->tfh_hash,
+ __get_str(name))
+);
+
+#define DEFINE_NFSD_VFS_LINK_EVENT(__name) \
+ DEFINE_EVENT(nfsd_vfs_link_class, __name, \
+ TP_PROTO(struct svc_rqst *rqstp, struct svc_fh *sfhp, \
+ struct svc_fh *tfhp, const char *name, \
+ unsigned int namelen), \
+ TP_ARGS(rqstp, sfhp, tfhp, name, namelen))
+
+DEFINE_NFSD_VFS_LINK_EVENT(nfsd_proc_link);
+DEFINE_NFSD_VFS_LINK_EVENT(nfsd3_proc_link);
+DEFINE_NFSD_VFS_LINK_EVENT(nfsd4_link);
#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 | 7 +------ fs/nfsd/nfs4proc.c | 3 +++ fs/nfsd/nfsproc.c | 7 +------ fs/nfsd/trace.h | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 12 deletions(-)