提交 8b0ad3d4 编写于 作者: T Trond Myklebust

NFS: Add tracepoints for debugging generic file create events

Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 6e0d0be7
...@@ -1612,7 +1612,9 @@ int nfs_create(struct inode *dir, struct dentry *dentry, ...@@ -1612,7 +1612,9 @@ int nfs_create(struct inode *dir, struct dentry *dentry,
attr.ia_mode = mode; attr.ia_mode = mode;
attr.ia_valid = ATTR_MODE; attr.ia_valid = ATTR_MODE;
trace_nfs_create_enter(dir, dentry, open_flags);
error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags); error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags);
trace_nfs_create_exit(dir, dentry, open_flags, error);
if (error != 0) if (error != 0)
goto out_err; goto out_err;
return 0; return 0;
......
...@@ -352,6 +352,76 @@ TRACE_EVENT(nfs_atomic_open_exit, ...@@ -352,6 +352,76 @@ TRACE_EVENT(nfs_atomic_open_exit,
) )
); );
TRACE_EVENT(nfs_create_enter,
TP_PROTO(
const struct inode *dir,
const struct dentry *dentry,
unsigned int flags
),
TP_ARGS(dir, dentry, flags),
TP_STRUCT__entry(
__field(unsigned int, flags)
__field(dev_t, dev)
__field(u64, dir)
__string(name, dentry->d_name.name)
),
TP_fast_assign(
__entry->dev = dir->i_sb->s_dev;
__entry->dir = NFS_FILEID(dir);
__entry->flags = flags;
__assign_str(name, dentry->d_name.name);
),
TP_printk(
"flags=%u (%s) name=%02x:%02x:%llu/%s",
__entry->flags,
show_open_flags(__entry->flags),
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->dir,
__get_str(name)
)
);
TRACE_EVENT(nfs_create_exit,
TP_PROTO(
const struct inode *dir,
const struct dentry *dentry,
unsigned int flags,
int error
),
TP_ARGS(dir, dentry, flags, error),
TP_STRUCT__entry(
__field(int, error)
__field(unsigned int, flags)
__field(dev_t, dev)
__field(u64, dir)
__string(name, dentry->d_name.name)
),
TP_fast_assign(
__entry->error = error;
__entry->dev = dir->i_sb->s_dev;
__entry->dir = NFS_FILEID(dir);
__entry->flags = flags;
__assign_str(name, dentry->d_name.name);
),
TP_printk(
"error=%d flags=%u (%s) name=%02x:%02x:%llu/%s",
__entry->error,
__entry->flags,
show_open_flags(__entry->flags),
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->dir,
__get_str(name)
)
);
#endif /* _TRACE_NFS_H */ #endif /* _TRACE_NFS_H */
#undef TRACE_INCLUDE_PATH #undef TRACE_INCLUDE_PATH
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册