Commit fbc6f7c2 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Add tracepoints for debugging rename

Add tracepoints to debug renames.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent c1578b76
...@@ -3329,7 +3329,8 @@ static void nfs4_proc_rename_rpc_prepare(struct rpc_task *task, struct nfs_renam ...@@ -3329,7 +3329,8 @@ static void nfs4_proc_rename_rpc_prepare(struct rpc_task *task, struct nfs_renam
static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir, static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
struct inode *new_dir) struct inode *new_dir)
{ {
struct nfs_renameres *res = task->tk_msg.rpc_resp; struct nfs_renamedata *data = task->tk_calldata;
struct nfs_renameres *res = &data->res;
if (!nfs4_sequence_done(task, &res->seq_res)) if (!nfs4_sequence_done(task, &res->seq_res))
return 0; return 0;
...@@ -3375,9 +3376,10 @@ static int nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, ...@@ -3375,9 +3376,10 @@ static int nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,
struct nfs4_exception exception = { }; struct nfs4_exception exception = { };
int err; int err;
do { do {
err = nfs4_handle_exception(NFS_SERVER(old_dir), err = _nfs4_proc_rename(old_dir, old_name,
_nfs4_proc_rename(old_dir, old_name, new_dir, new_name);
new_dir, new_name), trace_nfs4_rename(old_dir, old_name, new_dir, new_name, err);
err = nfs4_handle_exception(NFS_SERVER(old_dir), err,
&exception); &exception);
} while (exception.retry); } while (exception.retry);
return err; return err;
......
...@@ -461,6 +461,49 @@ DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove); ...@@ -461,6 +461,49 @@ DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove);
DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations); DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations);
DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo); DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo);
TRACE_EVENT(nfs4_rename,
TP_PROTO(
const struct inode *olddir,
const struct qstr *oldname,
const struct inode *newdir,
const struct qstr *newname,
int error
),
TP_ARGS(olddir, oldname, newdir, newname, error),
TP_STRUCT__entry(
__field(dev_t, dev)
__field(int, error)
__field(u64, olddir)
__string(oldname, oldname->name)
__field(u64, newdir)
__string(newname, newname->name)
),
TP_fast_assign(
__entry->dev = olddir->i_sb->s_dev;
__entry->olddir = NFS_FILEID(olddir);
__entry->newdir = NFS_FILEID(newdir);
__entry->error = error;
__assign_str(oldname, oldname->name);
__assign_str(newname, newname->name);
),
TP_printk(
"error=%d (%s) oldname=%02x:%02x:%llu/%s "
"newname=%02x:%02x:%llu/%s",
__entry->error,
show_nfsv4_errors(__entry->error),
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->olddir,
__get_str(oldname),
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->newdir,
__get_str(newname)
)
);
DECLARE_EVENT_CLASS(nfs4_inode_event, DECLARE_EVENT_CLASS(nfs4_inode_event,
TP_PROTO( TP_PROTO(
const struct inode *inode, const struct inode *inode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment