aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-13 13:01:39 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-22 08:58:25 -0400
commitb5f875a92591d06c57e786b3c916e21e290ad844 (patch)
tree2fd262caf62b21ad54d8683a7c4bde8fd9001c07
parent1f2d30b5338f1adaac249707ae49f1c675049cfc (diff)
NFSv4: Add tracepoints for debugging getattr
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4proc.c7
-rw-r--r--fs/nfs/nfs4trace.h69
2 files changed, 74 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index cbbaee27bf82..bcfe3adb2057 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2697,6 +2697,7 @@ static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
2697 int err; 2697 int err;
2698 do { 2698 do {
2699 err = _nfs4_lookup_root(server, fhandle, info); 2699 err = _nfs4_lookup_root(server, fhandle, info);
2700 trace_nfs4_lookup_root(server, fhandle, info->fattr, err);
2700 switch (err) { 2701 switch (err) {
2701 case 0: 2702 case 0:
2702 case -NFS4ERR_WRONGSEC: 2703 case -NFS4ERR_WRONGSEC:
@@ -2906,8 +2907,9 @@ static int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
2906 struct nfs4_exception exception = { }; 2907 struct nfs4_exception exception = { };
2907 int err; 2908 int err;
2908 do { 2909 do {
2909 err = nfs4_handle_exception(server, 2910 err = _nfs4_proc_getattr(server, fhandle, fattr, label);
2910 _nfs4_proc_getattr(server, fhandle, fattr, label), 2911 trace_nfs4_getattr(server, fhandle, fattr, err);
2912 err = nfs4_handle_exception(server, err,
2911 &exception); 2913 &exception);
2912 } while (exception.retry); 2914 } while (exception.retry);
2913 return err; 2915 return err;
@@ -3760,6 +3762,7 @@ static int nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, str
3760 3762
3761 do { 3763 do {
3762 err = _nfs4_do_fsinfo(server, fhandle, fsinfo); 3764 err = _nfs4_do_fsinfo(server, fhandle, fsinfo);
3765 trace_nfs4_fsinfo(server, fhandle, fsinfo->fattr, err);
3763 if (err == 0) { 3766 if (err == 0) {
3764 struct nfs_client *clp = server->nfs_client; 3767 struct nfs_client *clp = server->nfs_client;
3765 3768
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
index f58edcf418bf..99d1b1e79650 100644
--- a/fs/nfs/nfs4trace.h
+++ b/fs/nfs/nfs4trace.h
@@ -174,6 +174,24 @@
174 { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \ 174 { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
175 { ((__force unsigned long)FMODE_EXEC), "EXEC" }) 175 { ((__force unsigned long)FMODE_EXEC), "EXEC" })
176 176
177#define show_nfs_fattr_flags(valid) \
178 __print_flags((unsigned long)valid, "|", \
179 { NFS_ATTR_FATTR_TYPE, "TYPE" }, \
180 { NFS_ATTR_FATTR_MODE, "MODE" }, \
181 { NFS_ATTR_FATTR_NLINK, "NLINK" }, \
182 { NFS_ATTR_FATTR_OWNER, "OWNER" }, \
183 { NFS_ATTR_FATTR_GROUP, "GROUP" }, \
184 { NFS_ATTR_FATTR_RDEV, "RDEV" }, \
185 { NFS_ATTR_FATTR_SIZE, "SIZE" }, \
186 { NFS_ATTR_FATTR_FSID, "FSID" }, \
187 { NFS_ATTR_FATTR_FILEID, "FILEID" }, \
188 { NFS_ATTR_FATTR_ATIME, "ATIME" }, \
189 { NFS_ATTR_FATTR_MTIME, "MTIME" }, \
190 { NFS_ATTR_FATTR_CTIME, "CTIME" }, \
191 { NFS_ATTR_FATTR_CHANGE, "CHANGE" }, \
192 { NFS_ATTR_FATTR_OWNER_NAME, "OWNER_NAME" }, \
193 { NFS_ATTR_FATTR_GROUP_NAME, "GROUP_NAME" })
194
177DECLARE_EVENT_CLASS(nfs4_clientid_event, 195DECLARE_EVENT_CLASS(nfs4_clientid_event,
178 TP_PROTO( 196 TP_PROTO(
179 const struct nfs_client *clp, 197 const struct nfs_client *clp,
@@ -627,6 +645,57 @@ DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label);
627DEFINE_NFS4_INODE_EVENT(nfs4_recall_delegation); 645DEFINE_NFS4_INODE_EVENT(nfs4_recall_delegation);
628DEFINE_NFS4_INODE_EVENT(nfs4_delegreturn); 646DEFINE_NFS4_INODE_EVENT(nfs4_delegreturn);
629 647
648DECLARE_EVENT_CLASS(nfs4_getattr_event,
649 TP_PROTO(
650 const struct nfs_server *server,
651 const struct nfs_fh *fhandle,
652 const struct nfs_fattr *fattr,
653 int error
654 ),
655
656 TP_ARGS(server, fhandle, fattr, error),
657
658 TP_STRUCT__entry(
659 __field(dev_t, dev)
660 __field(u32, fhandle)
661 __field(u64, fileid)
662 __field(unsigned int, valid)
663 __field(int, error)
664 ),
665
666 TP_fast_assign(
667 __entry->dev = server->s_dev;
668 __entry->valid = fattr->valid;
669 __entry->fhandle = nfs_fhandle_hash(fhandle);
670 __entry->fileid = (fattr->valid & NFS_ATTR_FATTR_FILEID) ? fattr->fileid : 0;
671 __entry->error = error;
672 ),
673
674 TP_printk(
675 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
676 "valid=%s",
677 __entry->error,
678 show_nfsv4_errors(__entry->error),
679 MAJOR(__entry->dev), MINOR(__entry->dev),
680 (unsigned long long)__entry->fileid,
681 __entry->fhandle,
682 show_nfs_fattr_flags(__entry->valid)
683 )
684);
685
686#define DEFINE_NFS4_GETATTR_EVENT(name) \
687 DEFINE_EVENT(nfs4_getattr_event, name, \
688 TP_PROTO( \
689 const struct nfs_server *server, \
690 const struct nfs_fh *fhandle, \
691 const struct nfs_fattr *fattr, \
692 int error \
693 ), \
694 TP_ARGS(server, fhandle, fattr, error))
695DEFINE_NFS4_GETATTR_EVENT(nfs4_getattr);
696DEFINE_NFS4_GETATTR_EVENT(nfs4_lookup_root);
697DEFINE_NFS4_GETATTR_EVENT(nfs4_fsinfo);
698
630DECLARE_EVENT_CLASS(nfs4_idmap_event, 699DECLARE_EVENT_CLASS(nfs4_idmap_event,
631 TP_PROTO( 700 TP_PROTO(
632 const char *name, 701 const char *name,