aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-12 16:58:42 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-22 08:58:23 -0400
commitc1578b769a644fe1ff3e8324fc404b18f3f01fbe (patch)
treece9cd39742f3834148a002c010071785d3bc1a41
parent078ea3dfe396b18ccf608c71a9585b6f7e519bb1 (diff)
NFSv4: Add tracepoints for debugging inode manipulations
Set up basic tracepoints for debugging NFSv4 setattr, access, readlink, readdir, get_acl set_acl get_security_label, and set_security_label. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4proc.c36
-rw-r--r--fs/nfs/nfs4trace.h51
2 files changed, 73 insertions, 14 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 323475856d88..daf0854aa047 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2315,6 +2315,7 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
2315 int err; 2315 int err;
2316 do { 2316 do {
2317 err = _nfs4_do_setattr(inode, cred, fattr, sattr, state, ilabel, olabel); 2317 err = _nfs4_do_setattr(inode, cred, fattr, sattr, state, ilabel, olabel);
2318 trace_nfs4_setattr(inode, err);
2318 switch (err) { 2319 switch (err) {
2319 case -NFS4ERR_OPENMODE: 2320 case -NFS4ERR_OPENMODE:
2320 if (!(sattr->ia_valid & ATTR_SIZE)) { 2321 if (!(sattr->ia_valid & ATTR_SIZE)) {
@@ -3143,8 +3144,9 @@ static int nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry)
3143 struct nfs4_exception exception = { }; 3144 struct nfs4_exception exception = { };
3144 int err; 3145 int err;
3145 do { 3146 do {
3146 err = nfs4_handle_exception(NFS_SERVER(inode), 3147 err = _nfs4_proc_access(inode, entry);
3147 _nfs4_proc_access(inode, entry), 3148 trace_nfs4_access(inode, err);
3149 err = nfs4_handle_exception(NFS_SERVER(inode), err,
3148 &exception); 3150 &exception);
3149 } while (exception.retry); 3151 } while (exception.retry);
3150 return err; 3152 return err;
@@ -3197,8 +3199,9 @@ static int nfs4_proc_readlink(struct inode *inode, struct page *page,
3197 struct nfs4_exception exception = { }; 3199 struct nfs4_exception exception = { };
3198 int err; 3200 int err;
3199 do { 3201 do {
3200 err = nfs4_handle_exception(NFS_SERVER(inode), 3202 err = _nfs4_proc_readlink(inode, page, pgbase, pglen);
3201 _nfs4_proc_readlink(inode, page, pgbase, pglen), 3203 trace_nfs4_readlink(inode, err);
3204 err = nfs4_handle_exception(NFS_SERVER(inode), err,
3202 &exception); 3205 &exception);
3203 } while (exception.retry); 3206 } while (exception.retry);
3204 return err; 3207 return err;
@@ -3630,9 +3633,10 @@ static int nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
3630 struct nfs4_exception exception = { }; 3633 struct nfs4_exception exception = { };
3631 int err; 3634 int err;
3632 do { 3635 do {
3633 err = nfs4_handle_exception(NFS_SERVER(dentry->d_inode), 3636 err = _nfs4_proc_readdir(dentry, cred, cookie,
3634 _nfs4_proc_readdir(dentry, cred, cookie, 3637 pages, count, plus);
3635 pages, count, plus), 3638 trace_nfs4_readdir(dentry->d_inode, err);
3639 err = nfs4_handle_exception(NFS_SERVER(dentry->d_inode), err,
3636 &exception); 3640 &exception);
3637 } while (exception.retry); 3641 } while (exception.retry);
3638 return err; 3642 return err;
@@ -4333,6 +4337,7 @@ static ssize_t nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bufl
4333 ssize_t ret; 4337 ssize_t ret;
4334 do { 4338 do {
4335 ret = __nfs4_get_acl_uncached(inode, buf, buflen); 4339 ret = __nfs4_get_acl_uncached(inode, buf, buflen);
4340 trace_nfs4_get_acl(inode, ret);
4336 if (ret >= 0) 4341 if (ret >= 0)
4337 break; 4342 break;
4338 ret = nfs4_handle_exception(NFS_SERVER(inode), ret, &exception); 4343 ret = nfs4_handle_exception(NFS_SERVER(inode), ret, &exception);
@@ -4412,8 +4417,9 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen
4412 struct nfs4_exception exception = { }; 4417 struct nfs4_exception exception = { };
4413 int err; 4418 int err;
4414 do { 4419 do {
4415 err = nfs4_handle_exception(NFS_SERVER(inode), 4420 err = __nfs4_proc_set_acl(inode, buf, buflen);
4416 __nfs4_proc_set_acl(inode, buf, buflen), 4421 trace_nfs4_set_acl(inode, err);
4422 err = nfs4_handle_exception(NFS_SERVER(inode), err,
4417 &exception); 4423 &exception);
4418 } while (exception.retry); 4424 } while (exception.retry);
4419 return err; 4425 return err;
@@ -4466,8 +4472,9 @@ static int nfs4_get_security_label(struct inode *inode, void *buf,
4466 return -EOPNOTSUPP; 4472 return -EOPNOTSUPP;
4467 4473
4468 do { 4474 do {
4469 err = nfs4_handle_exception(NFS_SERVER(inode), 4475 err = _nfs4_get_security_label(inode, buf, buflen);
4470 _nfs4_get_security_label(inode, buf, buflen), 4476 trace_nfs4_get_security_label(inode, err);
4477 err = nfs4_handle_exception(NFS_SERVER(inode), err,
4471 &exception); 4478 &exception);
4472 } while (exception.retry); 4479 } while (exception.retry);
4473 return err; 4480 return err;
@@ -4519,9 +4526,10 @@ static int nfs4_do_set_security_label(struct inode *inode,
4519 int err; 4526 int err;
4520 4527
4521 do { 4528 do {
4522 err = nfs4_handle_exception(NFS_SERVER(inode), 4529 err = _nfs4_do_set_security_label(inode, ilabel,
4523 _nfs4_do_set_security_label(inode, ilabel, 4530 fattr, olabel);
4524 fattr, olabel), 4531 trace_nfs4_set_security_label(inode, err);
4532 err = nfs4_handle_exception(NFS_SERVER(inode), err,
4525 &exception); 4533 &exception);
4526 } while (exception.retry); 4534 } while (exception.retry);
4527 return err; 4535 return err;
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
index 2646a50a8208..6bd65c2c820b 100644
--- a/fs/nfs/nfs4trace.h
+++ b/fs/nfs/nfs4trace.h
@@ -461,6 +461,57 @@ DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove);
461DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations); 461DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations);
462DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo); 462DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo);
463 463
464DECLARE_EVENT_CLASS(nfs4_inode_event,
465 TP_PROTO(
466 const struct inode *inode,
467 int error
468 ),
469
470 TP_ARGS(inode, error),
471
472 TP_STRUCT__entry(
473 __field(dev_t, dev)
474 __field(u32, fhandle)
475 __field(u64, fileid)
476 __field(int, error)
477 ),
478
479 TP_fast_assign(
480 __entry->dev = inode->i_sb->s_dev;
481 __entry->fileid = NFS_FILEID(inode);
482 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
483 __entry->error = error;
484 ),
485
486 TP_printk(
487 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x",
488 __entry->error,
489 show_nfsv4_errors(__entry->error),
490 MAJOR(__entry->dev), MINOR(__entry->dev),
491 (unsigned long long)__entry->fileid,
492 __entry->fhandle
493 )
494);
495
496#define DEFINE_NFS4_INODE_EVENT(name) \
497 DEFINE_EVENT(nfs4_inode_event, name, \
498 TP_PROTO( \
499 const struct inode *inode, \
500 int error \
501 ), \
502 TP_ARGS(inode, error))
503
504DEFINE_NFS4_INODE_EVENT(nfs4_setattr);
505DEFINE_NFS4_INODE_EVENT(nfs4_access);
506DEFINE_NFS4_INODE_EVENT(nfs4_readlink);
507DEFINE_NFS4_INODE_EVENT(nfs4_readdir);
508DEFINE_NFS4_INODE_EVENT(nfs4_get_acl);
509DEFINE_NFS4_INODE_EVENT(nfs4_set_acl);
510#ifdef CONFIG_NFS_V4_SECURITY_LABEL
511DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label);
512DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label);
513#endif /* CONFIG_NFS_V4_SECURITY_LABEL */
514
464#endif /* _TRACE_NFS4_H */ 515#endif /* _TRACE_NFS4_H */
465 516
466#undef TRACE_INCLUDE_PATH 517#undef TRACE_INCLUDE_PATH