[PATCH v3 05/17] nfsd: add tracepoint to nfsd_symlink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
 fs/nfsd/trace.h | 23 +++++++++++++++++++++++
 fs/nfsd/vfs.c   |  2 ++
 2 files changed, 25 insertions(+)

diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index 752d81629e04f805536295f00a16721f57272fbe..9f604eb23f6304d11223733cee38871a4c39001f 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -2416,6 +2416,29 @@ TRACE_EVENT(nfsd_vfs_create,
 		  show_fs_file_type(__entry->type), __get_str(name))
 );
 
+TRACE_EVENT(nfsd_vfs_symlink,
+	TP_PROTO(struct svc_rqst *rqstp,
+		 struct svc_fh *fhp,
+		 const char *name,
+		 unsigned int namelen,
+		 const char *tgt),
+	TP_ARGS(rqstp, fhp, name, namelen, tgt),
+	TP_STRUCT__entry(
+		SVC_RQST_ENDPOINT_FIELDS(rqstp)
+		__field(u32, fh_hash)
+		__string_len(name, name, namelen)
+		__string(tgt, tgt)
+	),
+	TP_fast_assign(
+		SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp);
+		__entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
+		__assign_str(name);
+		__assign_str(tgt);
+	),
+	TP_printk("xid=0x%08x fh_hash=0x%08x name=%s target=%s",
+		  __entry->xid, __entry->fh_hash,
+		  __get_str(name), __get_str(tgt))
+);
 #endif /* _NFSD_TRACE_H */
 
 #undef TRACE_INCLUDE_PATH
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 888572727d332dafd3e520f4801c4b0ca4e5c96c..44e9260410b2d9dc7e07b5af7a74b63bd0175998 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1676,6 +1676,8 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
 	__be32		err, cerr;
 	int		host_err;
 
+	trace_nfsd_vfs_symlink(rqstp, fhp, fname, flen, path);
+
 	err = nfserr_noent;
 	if (!flen || path[0] == '\0')
 		goto out;

-- 
2.49.0





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux