Commit 078ea3df authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Add tracepoints for debugging lookup/create operations

Set up basic tracepoints for debugging NFSv4 lookup, unlink/remove,
symlink, mkdir, mknod, fs_locations and secinfo.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent d1b748a5
...@@ -3026,6 +3026,7 @@ static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir, ...@@ -3026,6 +3026,7 @@ static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
int err; int err;
do { do {
err = _nfs4_proc_lookup(client, dir, name, fhandle, fattr, label); err = _nfs4_proc_lookup(client, dir, name, fhandle, fattr, label);
trace_nfs4_lookup(dir, name, err);
switch (err) { switch (err) {
case -NFS4ERR_BADNAME: case -NFS4ERR_BADNAME:
err = -ENOENT; err = -ENOENT;
...@@ -3261,8 +3262,9 @@ static int nfs4_proc_remove(struct inode *dir, struct qstr *name) ...@@ -3261,8 +3262,9 @@ static int nfs4_proc_remove(struct inode *dir, struct qstr *name)
struct nfs4_exception exception = { }; struct nfs4_exception exception = { };
int err; int err;
do { do {
err = nfs4_handle_exception(NFS_SERVER(dir), err = _nfs4_proc_remove(dir, name);
_nfs4_proc_remove(dir, name), trace_nfs4_remove(dir, name, err);
err = nfs4_handle_exception(NFS_SERVER(dir), err,
&exception); &exception);
} while (exception.retry); } while (exception.retry);
return err; return err;
...@@ -3291,7 +3293,8 @@ static void nfs4_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlin ...@@ -3291,7 +3293,8 @@ static void nfs4_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlin
static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir) static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{ {
struct nfs_removeres *res = task->tk_msg.rpc_resp; struct nfs_unlinkdata *data = task->tk_calldata;
struct nfs_removeres *res = &data->res;
if (!nfs4_sequence_done(task, &res->seq_res)) if (!nfs4_sequence_done(task, &res->seq_res))
return 0; return 0;
...@@ -3533,9 +3536,9 @@ static int nfs4_proc_symlink(struct inode *dir, struct dentry *dentry, ...@@ -3533,9 +3536,9 @@ static int nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
label = nfs4_label_init_security(dir, dentry, sattr, &l); label = nfs4_label_init_security(dir, dentry, sattr, &l);
do { do {
err = nfs4_handle_exception(NFS_SERVER(dir), err = _nfs4_proc_symlink(dir, dentry, page, len, sattr, label);
_nfs4_proc_symlink(dir, dentry, page, trace_nfs4_symlink(dir, &dentry->d_name, err);
len, sattr, label), err = nfs4_handle_exception(NFS_SERVER(dir), err,
&exception); &exception);
} while (exception.retry); } while (exception.retry);
...@@ -3572,8 +3575,9 @@ static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry, ...@@ -3572,8 +3575,9 @@ static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
sattr->ia_mode &= ~current_umask(); sattr->ia_mode &= ~current_umask();
do { do {
err = nfs4_handle_exception(NFS_SERVER(dir), err = _nfs4_proc_mkdir(dir, dentry, sattr, label);
_nfs4_proc_mkdir(dir, dentry, sattr, label), trace_nfs4_mkdir(dir, &dentry->d_name, err);
err = nfs4_handle_exception(NFS_SERVER(dir), err,
&exception); &exception);
} while (exception.retry); } while (exception.retry);
nfs4_label_release_security(label); nfs4_label_release_security(label);
...@@ -3680,8 +3684,9 @@ static int nfs4_proc_mknod(struct inode *dir, struct dentry *dentry, ...@@ -3680,8 +3684,9 @@ static int nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
sattr->ia_mode &= ~current_umask(); sattr->ia_mode &= ~current_umask();
do { do {
err = nfs4_handle_exception(NFS_SERVER(dir), err = _nfs4_proc_mknod(dir, dentry, sattr, label, rdev);
_nfs4_proc_mknod(dir, dentry, sattr, label, rdev), trace_nfs4_mknod(dir, &dentry->d_name, err);
err = nfs4_handle_exception(NFS_SERVER(dir), err,
&exception); &exception);
} while (exception.retry); } while (exception.retry);
...@@ -5801,8 +5806,10 @@ int nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir, ...@@ -5801,8 +5806,10 @@ int nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir,
struct nfs4_exception exception = { }; struct nfs4_exception exception = { };
int err; int err;
do { do {
err = nfs4_handle_exception(NFS_SERVER(dir), err = _nfs4_proc_fs_locations(client, dir, name,
_nfs4_proc_fs_locations(client, dir, name, fs_locations, page), fs_locations, page);
trace_nfs4_get_fs_locations(dir, name, err);
err = nfs4_handle_exception(NFS_SERVER(dir), err,
&exception); &exception);
} while (exception.retry); } while (exception.retry);
return err; return err;
...@@ -5841,8 +5848,9 @@ int nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, ...@@ -5841,8 +5848,9 @@ int nfs4_proc_secinfo(struct inode *dir, const struct qstr *name,
struct nfs4_exception exception = { }; struct nfs4_exception exception = { };
int err; int err;
do { do {
err = nfs4_handle_exception(NFS_SERVER(dir), err = _nfs4_proc_secinfo(dir, name, flavors);
_nfs4_proc_secinfo(dir, name, flavors), trace_nfs4_secinfo(dir, name, err);
err = nfs4_handle_exception(NFS_SERVER(dir), err,
&exception); &exception);
} while (exception.retry); } while (exception.retry);
return err; return err;
......
...@@ -411,6 +411,56 @@ DEFINE_NFS4_LOCK_EVENT(nfs4_lock_reclaim); ...@@ -411,6 +411,56 @@ DEFINE_NFS4_LOCK_EVENT(nfs4_lock_reclaim);
DEFINE_NFS4_LOCK_EVENT(nfs4_lock_expired); DEFINE_NFS4_LOCK_EVENT(nfs4_lock_expired);
DEFINE_NFS4_LOCK_EVENT(nfs4_unlock); DEFINE_NFS4_LOCK_EVENT(nfs4_unlock);
DECLARE_EVENT_CLASS(nfs4_lookup_event,
TP_PROTO(
const struct inode *dir,
const struct qstr *name,
int error
),
TP_ARGS(dir, name, error),
TP_STRUCT__entry(
__field(dev_t, dev)
__field(int, error)
__field(u64, dir)
__string(name, name->name)
),
TP_fast_assign(
__entry->dev = dir->i_sb->s_dev;
__entry->dir = NFS_FILEID(dir);
__entry->error = error;
__assign_str(name, name->name);
),
TP_printk(
"error=%d (%s) name=%02x:%02x:%llu/%s",
__entry->error,
show_nfsv4_errors(__entry->error),
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->dir,
__get_str(name)
)
);
#define DEFINE_NFS4_LOOKUP_EVENT(name) \
DEFINE_EVENT(nfs4_lookup_event, name, \
TP_PROTO( \
const struct inode *dir, \
const struct qstr *name, \
int error \
), \
TP_ARGS(dir, name, error))
DEFINE_NFS4_LOOKUP_EVENT(nfs4_lookup);
DEFINE_NFS4_LOOKUP_EVENT(nfs4_symlink);
DEFINE_NFS4_LOOKUP_EVENT(nfs4_mkdir);
DEFINE_NFS4_LOOKUP_EVENT(nfs4_mknod);
DEFINE_NFS4_LOOKUP_EVENT(nfs4_remove);
DEFINE_NFS4_LOOKUP_EVENT(nfs4_get_fs_locations);
DEFINE_NFS4_LOOKUP_EVENT(nfs4_secinfo);
#endif /* _TRACE_NFS4_H */ #endif /* _TRACE_NFS4_H */
#undef TRACE_INCLUDE_PATH #undef TRACE_INCLUDE_PATH
......
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