aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-12 17:08:26 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-22 08:58:23 -0400
commitfbc6f7c233ff0a7e98f5dc2837b08adf03aa9376 (patch)
tree691fcc8c09c0188a6c70a4cb824e45d8eb500655
parentc1578b769a644fe1ff3e8324fc404b18f3f01fbe (diff)
NFSv4: Add tracepoints for debugging rename
Add tracepoints to debug renames. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4proc.c10
-rw-r--r--fs/nfs/nfs4trace.h43
2 files changed, 49 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index daf0854aa047..4b3ba92b0e10 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3329,7 +3329,8 @@ static void nfs4_proc_rename_rpc_prepare(struct rpc_task *task, struct nfs_renam
3329static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir, 3329static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
3330 struct inode *new_dir) 3330 struct inode *new_dir)
3331{ 3331{
3332 struct nfs_renameres *res = task->tk_msg.rpc_resp; 3332 struct nfs_renamedata *data = task->tk_calldata;
3333 struct nfs_renameres *res = &data->res;
3333 3334
3334 if (!nfs4_sequence_done(task, &res->seq_res)) 3335 if (!nfs4_sequence_done(task, &res->seq_res))
3335 return 0; 3336 return 0;
@@ -3375,9 +3376,10 @@ static int nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,
3375 struct nfs4_exception exception = { }; 3376 struct nfs4_exception exception = { };
3376 int err; 3377 int err;
3377 do { 3378 do {
3378 err = nfs4_handle_exception(NFS_SERVER(old_dir), 3379 err = _nfs4_proc_rename(old_dir, old_name,
3379 _nfs4_proc_rename(old_dir, old_name, 3380 new_dir, new_name);
3380 new_dir, new_name), 3381 trace_nfs4_rename(old_dir, old_name, new_dir, new_name, err);
3382 err = nfs4_handle_exception(NFS_SERVER(old_dir), err,
3381 &exception); 3383 &exception);
3382 } while (exception.retry); 3384 } while (exception.retry);
3383 return err; 3385 return err;
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
index 6bd65c2c820b..6388db847017 100644
--- a/fs/nfs/nfs4trace.h
+++ b/fs/nfs/nfs4trace.h
@@ -461,6 +461,49 @@ 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
464TRACE_EVENT(nfs4_rename,
465 TP_PROTO(
466 const struct inode *olddir,
467 const struct qstr *oldname,
468 const struct inode *newdir,
469 const struct qstr *newname,
470 int error
471 ),
472
473 TP_ARGS(olddir, oldname, newdir, newname, error),
474
475 TP_STRUCT__entry(
476 __field(dev_t, dev)
477 __field(int, error)
478 __field(u64, olddir)
479 __string(oldname, oldname->name)
480 __field(u64, newdir)
481 __string(newname, newname->name)
482 ),
483
484 TP_fast_assign(
485 __entry->dev = olddir->i_sb->s_dev;
486 __entry->olddir = NFS_FILEID(olddir);
487 __entry->newdir = NFS_FILEID(newdir);
488 __entry->error = error;
489 __assign_str(oldname, oldname->name);
490 __assign_str(newname, newname->name);
491 ),
492
493 TP_printk(
494 "error=%d (%s) oldname=%02x:%02x:%llu/%s "
495 "newname=%02x:%02x:%llu/%s",
496 __entry->error,
497 show_nfsv4_errors(__entry->error),
498 MAJOR(__entry->dev), MINOR(__entry->dev),
499 (unsigned long long)__entry->olddir,
500 __get_str(oldname),
501 MAJOR(__entry->dev), MINOR(__entry->dev),
502 (unsigned long long)__entry->newdir,
503 __get_str(newname)
504 )
505);
506
464DECLARE_EVENT_CLASS(nfs4_inode_event, 507DECLARE_EVENT_CLASS(nfs4_inode_event,
465 TP_PROTO( 508 TP_PROTO(
466 const struct inode *inode, 509 const struct inode *inode,