mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 21:02:19 +00:00
7f155c7026
Highlights include: Stable bugfixes: - nfs: don't create zero-length requests - Several LAYOUTGET bugfixes Features: - Several performance related features - More aggressive caching when we can rely on close-to-open cache consistency - Remove serialisation of O_DIRECT reads and writes - Optimise several code paths to not flush to disk unnecessarily. However allow for the idiosyncracies of pNFS for those layout types that need to issue a LAYOUTCOMMIT before the metadata can be updated on the server. - SUNRPC updates to the client data receive path - pNFS/SCSI support RH/Fedora dm-mpath device nodes - pNFS files/flexfiles can now use unprivileged ports when the generic NFS mount options allow it. Bugfixes: - Don't use RDMA direct data placement together with data integrity or privacy security flavours - Remove the RDMA ALLPHYSICAL memory registration mode as it has potential security holes. - Several layout recall fixes to improve NFSv4.1 protocol compliance. - Fix an Oops in the pNFS files and flexfiles connection setup to the DS - Allow retry of operations that used a returned delegation stateid - Don't mark the inode as revalidated if a LAYOUTCOMMIT is outstanding - Fix writeback races in nfs4_copy_range() and nfs42_proc_deallocate() -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJXnSq8AAoJEGcL54qWCgDyn8cP/RCHLekUCq7Klh+NAnEsvuBi C7w9YpVHaC83/8Q0tR6LyFShSBJBWi/clWwO0IEomkNK/MuO77v4iyPujtEyqowK 0+eWFh/e8CsTf7mNGoi0avrHAZDB3deSuOQeYbwnNWHmd7qKVkB6tHus8LQjk852 eqwYmZ4kVr+eaCO6MttCCxJHf6datPnsbe0stiC9MpxmCzsdpZmFptfauidsFX+p 0U1IHi/ABN6zIFoc4R0iXXbaDb8ErxGw32SWIb8cnnWwdlSD8I0+Jqxs4opp23LY lAm9E0vtDJ49bJBllYl0dUmizdhJ3+NefK4aqPh5H5h3Csub+MLIsuQv/+r2AOhH qLBi5kThpspPhGHZ40VDmfV825+csUPTc8WkDaNLvb4f4UGIPakK/KBrBtxiqn+P 0etvYiWBuoBaqRVQpstawnyDdnBK0IMF/3LAULo+ozo7iTkpaZmOALYgPcBUYw2f d6pxZGeNN0GwWfjDmoUDGC07OpO/CSN5WouArgKsp5+VhjzPxjyaZLCnUhzHzXiM RV1oBytEs/iw2BLXX809noM9mqHYkdgSVmrZ9OvvDMslcLHaslpq6eaJKZSWqV2J fAws6rbcZdTFSnbAWr0OSxct6w6BijEjc3/uk+wWRtw9nkOhFqtlxI3y7k4odpW9 wVcEmRNkxfA0LlYNXWuL =WNyE -----END PGP SIGNATURE----- Merge tag 'nfs-for-4.8-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs Pull NFS client updates from Trond Myklebust: "Highlights include: Stable bugfixes: - nfs: don't create zero-length requests - several LAYOUTGET bugfixes Features: - several performance related features - more aggressive caching when we can rely on close-to-open cache consistency - remove serialisation of O_DIRECT reads and writes - optimise several code paths to not flush to disk unnecessarily. However allow for the idiosyncracies of pNFS for those layout types that need to issue a LAYOUTCOMMIT before the metadata can be updated on the server. - SUNRPC updates to the client data receive path - pNFS/SCSI support RH/Fedora dm-mpath device nodes - pNFS files/flexfiles can now use unprivileged ports when the generic NFS mount options allow it. Bugfixes: - Don't use RDMA direct data placement together with data integrity or privacy security flavours - Remove the RDMA ALLPHYSICAL memory registration mode as it has potential security holes. - Several layout recall fixes to improve NFSv4.1 protocol compliance. - Fix an Oops in the pNFS files and flexfiles connection setup to the DS - Allow retry of operations that used a returned delegation stateid - Don't mark the inode as revalidated if a LAYOUTCOMMIT is outstanding - Fix writeback races in nfs4_copy_range() and nfs42_proc_deallocate()" * tag 'nfs-for-4.8-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (104 commits) pNFS: Actively set attributes as invalid if LAYOUTCOMMIT is outstanding NFSv4: Clean up lookup of SECINFO_NO_NAME NFSv4.2: Fix warning "variable ‘stateids’ set but not used" NFSv4: Fix warning "no previous prototype for ‘nfs4_listxattr’" SUNRPC: Fix a compiler warning in fs/nfs/clnt.c pNFS: Remove redundant smp_mb() from pnfs_init_lseg() pNFS: Cleanup - do layout segment initialisation in one place pNFS: Remove redundant stateid invalidation pNFS: Remove redundant pnfs_mark_layout_returned_if_empty() pNFS: Clear the layout metadata if the server changed the layout stateid pNFS: Cleanup - don't open code pnfs_mark_layout_stateid_invalid() NFS: pnfs_mark_matching_lsegs_return() should match the layout sequence id pNFS: Do not set plh_return_seq for non-callback related layoutreturns pNFS: Ensure layoutreturn acts as a completion for layout callbacks pNFS: Fix CB_LAYOUTRECALL stateid verification pNFS: Always update the layout barrier seqid on LAYOUTGET pNFS: Always update the layout stateid if NFS_LAYOUT_INVALID_STID is set pNFS: Clear the layout return tracking on layout reinitialisation pNFS: LAYOUTRETURN should only update the stateid if the layout is valid nfs: don't create zero-length requests ...
729 lines
18 KiB
C
729 lines
18 KiB
C
/*
|
|
* Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com>
|
|
*/
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM nfs
|
|
|
|
#if !defined(_TRACE_NFS_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_NFS_H
|
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
#define nfs_show_file_type(ftype) \
|
|
__print_symbolic(ftype, \
|
|
{ DT_UNKNOWN, "UNKNOWN" }, \
|
|
{ DT_FIFO, "FIFO" }, \
|
|
{ DT_CHR, "CHR" }, \
|
|
{ DT_DIR, "DIR" }, \
|
|
{ DT_BLK, "BLK" }, \
|
|
{ DT_REG, "REG" }, \
|
|
{ DT_LNK, "LNK" }, \
|
|
{ DT_SOCK, "SOCK" }, \
|
|
{ DT_WHT, "WHT" })
|
|
|
|
#define nfs_show_cache_validity(v) \
|
|
__print_flags(v, "|", \
|
|
{ NFS_INO_INVALID_ATTR, "INVALID_ATTR" }, \
|
|
{ NFS_INO_INVALID_DATA, "INVALID_DATA" }, \
|
|
{ NFS_INO_INVALID_ATIME, "INVALID_ATIME" }, \
|
|
{ NFS_INO_INVALID_ACCESS, "INVALID_ACCESS" }, \
|
|
{ NFS_INO_INVALID_ACL, "INVALID_ACL" }, \
|
|
{ NFS_INO_REVAL_PAGECACHE, "REVAL_PAGECACHE" }, \
|
|
{ NFS_INO_REVAL_FORCED, "REVAL_FORCED" }, \
|
|
{ NFS_INO_INVALID_LABEL, "INVALID_LABEL" })
|
|
|
|
#define nfs_show_nfsi_flags(v) \
|
|
__print_flags(v, "|", \
|
|
{ 1 << NFS_INO_ADVISE_RDPLUS, "ADVISE_RDPLUS" }, \
|
|
{ 1 << NFS_INO_STALE, "STALE" }, \
|
|
{ 1 << NFS_INO_INVALIDATING, "INVALIDATING" }, \
|
|
{ 1 << NFS_INO_FSCACHE, "FSCACHE" }, \
|
|
{ 1 << NFS_INO_LAYOUTCOMMIT, "NEED_LAYOUTCOMMIT" }, \
|
|
{ 1 << NFS_INO_LAYOUTCOMMITTING, "LAYOUTCOMMIT" })
|
|
|
|
DECLARE_EVENT_CLASS(nfs_inode_event,
|
|
TP_PROTO(
|
|
const struct inode *inode
|
|
),
|
|
|
|
TP_ARGS(inode),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(dev_t, dev)
|
|
__field(u32, fhandle)
|
|
__field(u64, fileid)
|
|
__field(u64, version)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
__entry->fileid = nfsi->fileid;
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
__entry->version = inode->i_version;
|
|
),
|
|
|
|
TP_printk(
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu ",
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->fileid,
|
|
__entry->fhandle,
|
|
(unsigned long long)__entry->version
|
|
)
|
|
);
|
|
|
|
DECLARE_EVENT_CLASS(nfs_inode_event_done,
|
|
TP_PROTO(
|
|
const struct inode *inode,
|
|
int error
|
|
),
|
|
|
|
TP_ARGS(inode, error),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(int, error)
|
|
__field(dev_t, dev)
|
|
__field(u32, fhandle)
|
|
__field(unsigned char, type)
|
|
__field(u64, fileid)
|
|
__field(u64, version)
|
|
__field(loff_t, size)
|
|
__field(unsigned long, nfsi_flags)
|
|
__field(unsigned long, cache_validity)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
__entry->error = error;
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
__entry->fileid = nfsi->fileid;
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
__entry->type = nfs_umode_to_dtype(inode->i_mode);
|
|
__entry->version = inode->i_version;
|
|
__entry->size = i_size_read(inode);
|
|
__entry->nfsi_flags = nfsi->flags;
|
|
__entry->cache_validity = nfsi->cache_validity;
|
|
),
|
|
|
|
TP_printk(
|
|
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
"type=%u (%s) version=%llu size=%lld "
|
|
"cache_validity=%lu (%s) nfs_flags=%ld (%s)",
|
|
__entry->error,
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->fileid,
|
|
__entry->fhandle,
|
|
__entry->type,
|
|
nfs_show_file_type(__entry->type),
|
|
(unsigned long long)__entry->version,
|
|
(long long)__entry->size,
|
|
__entry->cache_validity,
|
|
nfs_show_cache_validity(__entry->cache_validity),
|
|
__entry->nfsi_flags,
|
|
nfs_show_nfsi_flags(__entry->nfsi_flags)
|
|
)
|
|
);
|
|
|
|
#define DEFINE_NFS_INODE_EVENT(name) \
|
|
DEFINE_EVENT(nfs_inode_event, name, \
|
|
TP_PROTO( \
|
|
const struct inode *inode \
|
|
), \
|
|
TP_ARGS(inode))
|
|
#define DEFINE_NFS_INODE_EVENT_DONE(name) \
|
|
DEFINE_EVENT(nfs_inode_event_done, name, \
|
|
TP_PROTO( \
|
|
const struct inode *inode, \
|
|
int error \
|
|
), \
|
|
TP_ARGS(inode, error))
|
|
DEFINE_NFS_INODE_EVENT(nfs_refresh_inode_enter);
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_refresh_inode_exit);
|
|
DEFINE_NFS_INODE_EVENT(nfs_revalidate_inode_enter);
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_revalidate_inode_exit);
|
|
DEFINE_NFS_INODE_EVENT(nfs_invalidate_mapping_enter);
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_invalidate_mapping_exit);
|
|
DEFINE_NFS_INODE_EVENT(nfs_getattr_enter);
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_getattr_exit);
|
|
DEFINE_NFS_INODE_EVENT(nfs_setattr_enter);
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_setattr_exit);
|
|
DEFINE_NFS_INODE_EVENT(nfs_writeback_page_enter);
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_page_exit);
|
|
DEFINE_NFS_INODE_EVENT(nfs_writeback_inode_enter);
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inode_exit);
|
|
DEFINE_NFS_INODE_EVENT(nfs_fsync_enter);
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit);
|
|
DEFINE_NFS_INODE_EVENT(nfs_access_enter);
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_access_exit);
|
|
|
|
#define show_lookup_flags(flags) \
|
|
__print_flags((unsigned long)flags, "|", \
|
|
{ LOOKUP_AUTOMOUNT, "AUTOMOUNT" }, \
|
|
{ LOOKUP_DIRECTORY, "DIRECTORY" }, \
|
|
{ LOOKUP_OPEN, "OPEN" }, \
|
|
{ LOOKUP_CREATE, "CREATE" }, \
|
|
{ LOOKUP_EXCL, "EXCL" })
|
|
|
|
DECLARE_EVENT_CLASS(nfs_lookup_event,
|
|
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_lookup_flags(__entry->flags),
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->dir,
|
|
__get_str(name)
|
|
)
|
|
);
|
|
|
|
#define DEFINE_NFS_LOOKUP_EVENT(name) \
|
|
DEFINE_EVENT(nfs_lookup_event, name, \
|
|
TP_PROTO( \
|
|
const struct inode *dir, \
|
|
const struct dentry *dentry, \
|
|
unsigned int flags \
|
|
), \
|
|
TP_ARGS(dir, dentry, flags))
|
|
|
|
DECLARE_EVENT_CLASS(nfs_lookup_event_done,
|
|
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->dev = dir->i_sb->s_dev;
|
|
__entry->dir = NFS_FILEID(dir);
|
|
__entry->error = error;
|
|
__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_lookup_flags(__entry->flags),
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->dir,
|
|
__get_str(name)
|
|
)
|
|
);
|
|
|
|
#define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \
|
|
DEFINE_EVENT(nfs_lookup_event_done, name, \
|
|
TP_PROTO( \
|
|
const struct inode *dir, \
|
|
const struct dentry *dentry, \
|
|
unsigned int flags, \
|
|
int error \
|
|
), \
|
|
TP_ARGS(dir, dentry, flags, error))
|
|
|
|
DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter);
|
|
DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit);
|
|
DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter);
|
|
DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit);
|
|
|
|
#define show_open_flags(flags) \
|
|
__print_flags((unsigned long)flags, "|", \
|
|
{ O_CREAT, "O_CREAT" }, \
|
|
{ O_EXCL, "O_EXCL" }, \
|
|
{ O_TRUNC, "O_TRUNC" }, \
|
|
{ O_APPEND, "O_APPEND" }, \
|
|
{ O_DSYNC, "O_DSYNC" }, \
|
|
{ O_DIRECT, "O_DIRECT" }, \
|
|
{ O_DIRECTORY, "O_DIRECTORY" })
|
|
|
|
#define show_fmode_flags(mode) \
|
|
__print_flags(mode, "|", \
|
|
{ ((__force unsigned long)FMODE_READ), "READ" }, \
|
|
{ ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
|
|
{ ((__force unsigned long)FMODE_EXEC), "EXEC" })
|
|
|
|
TRACE_EVENT(nfs_atomic_open_enter,
|
|
TP_PROTO(
|
|
const struct inode *dir,
|
|
const struct nfs_open_context *ctx,
|
|
unsigned int flags
|
|
),
|
|
|
|
TP_ARGS(dir, ctx, flags),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(unsigned int, flags)
|
|
__field(unsigned int, fmode)
|
|
__field(dev_t, dev)
|
|
__field(u64, dir)
|
|
__string(name, ctx->dentry->d_name.name)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
__entry->dir = NFS_FILEID(dir);
|
|
__entry->flags = flags;
|
|
__entry->fmode = (__force unsigned int)ctx->mode;
|
|
__assign_str(name, ctx->dentry->d_name.name);
|
|
),
|
|
|
|
TP_printk(
|
|
"flags=%u (%s) fmode=%s name=%02x:%02x:%llu/%s",
|
|
__entry->flags,
|
|
show_open_flags(__entry->flags),
|
|
show_fmode_flags(__entry->fmode),
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->dir,
|
|
__get_str(name)
|
|
)
|
|
);
|
|
|
|
TRACE_EVENT(nfs_atomic_open_exit,
|
|
TP_PROTO(
|
|
const struct inode *dir,
|
|
const struct nfs_open_context *ctx,
|
|
unsigned int flags,
|
|
int error
|
|
),
|
|
|
|
TP_ARGS(dir, ctx, flags, error),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(int, error)
|
|
__field(unsigned int, flags)
|
|
__field(unsigned int, fmode)
|
|
__field(dev_t, dev)
|
|
__field(u64, dir)
|
|
__string(name, ctx->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;
|
|
__entry->fmode = (__force unsigned int)ctx->mode;
|
|
__assign_str(name, ctx->dentry->d_name.name);
|
|
),
|
|
|
|
TP_printk(
|
|
"error=%d flags=%u (%s) fmode=%s "
|
|
"name=%02x:%02x:%llu/%s",
|
|
__entry->error,
|
|
__entry->flags,
|
|
show_open_flags(__entry->flags),
|
|
show_fmode_flags(__entry->fmode),
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->dir,
|
|
__get_str(name)
|
|
)
|
|
);
|
|
|
|
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)
|
|
)
|
|
);
|
|
|
|
DECLARE_EVENT_CLASS(nfs_directory_event,
|
|
TP_PROTO(
|
|
const struct inode *dir,
|
|
const struct dentry *dentry
|
|
),
|
|
|
|
TP_ARGS(dir, dentry),
|
|
|
|
TP_STRUCT__entry(
|
|
__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);
|
|
__assign_str(name, dentry->d_name.name);
|
|
),
|
|
|
|
TP_printk(
|
|
"name=%02x:%02x:%llu/%s",
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->dir,
|
|
__get_str(name)
|
|
)
|
|
);
|
|
|
|
#define DEFINE_NFS_DIRECTORY_EVENT(name) \
|
|
DEFINE_EVENT(nfs_directory_event, name, \
|
|
TP_PROTO( \
|
|
const struct inode *dir, \
|
|
const struct dentry *dentry \
|
|
), \
|
|
TP_ARGS(dir, dentry))
|
|
|
|
DECLARE_EVENT_CLASS(nfs_directory_event_done,
|
|
TP_PROTO(
|
|
const struct inode *dir,
|
|
const struct dentry *dentry,
|
|
int error
|
|
),
|
|
|
|
TP_ARGS(dir, dentry, error),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(int, error)
|
|
__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->error = error;
|
|
__assign_str(name, dentry->d_name.name);
|
|
),
|
|
|
|
TP_printk(
|
|
"error=%d name=%02x:%02x:%llu/%s",
|
|
__entry->error,
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->dir,
|
|
__get_str(name)
|
|
)
|
|
);
|
|
|
|
#define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) \
|
|
DEFINE_EVENT(nfs_directory_event_done, name, \
|
|
TP_PROTO( \
|
|
const struct inode *dir, \
|
|
const struct dentry *dentry, \
|
|
int error \
|
|
), \
|
|
TP_ARGS(dir, dentry, error))
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter);
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit);
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter);
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit);
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter);
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit);
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter);
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exit);
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter);
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit);
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter);
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit);
|
|
|
|
TRACE_EVENT(nfs_link_enter,
|
|
TP_PROTO(
|
|
const struct inode *inode,
|
|
const struct inode *dir,
|
|
const struct dentry *dentry
|
|
),
|
|
|
|
TP_ARGS(inode, dir, dentry),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(dev_t, dev)
|
|
__field(u64, fileid)
|
|
__field(u64, dir)
|
|
__string(name, dentry->d_name.name)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
__entry->dir = NFS_FILEID(dir);
|
|
__assign_str(name, dentry->d_name.name);
|
|
),
|
|
|
|
TP_printk(
|
|
"fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
__entry->fileid,
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->dir,
|
|
__get_str(name)
|
|
)
|
|
);
|
|
|
|
TRACE_EVENT(nfs_link_exit,
|
|
TP_PROTO(
|
|
const struct inode *inode,
|
|
const struct inode *dir,
|
|
const struct dentry *dentry,
|
|
int error
|
|
),
|
|
|
|
TP_ARGS(inode, dir, dentry, error),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(int, error)
|
|
__field(dev_t, dev)
|
|
__field(u64, fileid)
|
|
__field(u64, dir)
|
|
__string(name, dentry->d_name.name)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
__entry->dir = NFS_FILEID(dir);
|
|
__entry->error = error;
|
|
__assign_str(name, dentry->d_name.name);
|
|
),
|
|
|
|
TP_printk(
|
|
"error=%d fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
|
|
__entry->error,
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
__entry->fileid,
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->dir,
|
|
__get_str(name)
|
|
)
|
|
);
|
|
|
|
DECLARE_EVENT_CLASS(nfs_rename_event,
|
|
TP_PROTO(
|
|
const struct inode *old_dir,
|
|
const struct dentry *old_dentry,
|
|
const struct inode *new_dir,
|
|
const struct dentry *new_dentry
|
|
),
|
|
|
|
TP_ARGS(old_dir, old_dentry, new_dir, new_dentry),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(dev_t, dev)
|
|
__field(u64, old_dir)
|
|
__field(u64, new_dir)
|
|
__string(old_name, old_dentry->d_name.name)
|
|
__string(new_name, new_dentry->d_name.name)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->dev = old_dir->i_sb->s_dev;
|
|
__entry->old_dir = NFS_FILEID(old_dir);
|
|
__entry->new_dir = NFS_FILEID(new_dir);
|
|
__assign_str(old_name, old_dentry->d_name.name);
|
|
__assign_str(new_name, new_dentry->d_name.name);
|
|
),
|
|
|
|
TP_printk(
|
|
"old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s",
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->old_dir,
|
|
__get_str(old_name),
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->new_dir,
|
|
__get_str(new_name)
|
|
)
|
|
);
|
|
#define DEFINE_NFS_RENAME_EVENT(name) \
|
|
DEFINE_EVENT(nfs_rename_event, name, \
|
|
TP_PROTO( \
|
|
const struct inode *old_dir, \
|
|
const struct dentry *old_dentry, \
|
|
const struct inode *new_dir, \
|
|
const struct dentry *new_dentry \
|
|
), \
|
|
TP_ARGS(old_dir, old_dentry, new_dir, new_dentry))
|
|
|
|
DECLARE_EVENT_CLASS(nfs_rename_event_done,
|
|
TP_PROTO(
|
|
const struct inode *old_dir,
|
|
const struct dentry *old_dentry,
|
|
const struct inode *new_dir,
|
|
const struct dentry *new_dentry,
|
|
int error
|
|
),
|
|
|
|
TP_ARGS(old_dir, old_dentry, new_dir, new_dentry, error),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(dev_t, dev)
|
|
__field(int, error)
|
|
__field(u64, old_dir)
|
|
__string(old_name, old_dentry->d_name.name)
|
|
__field(u64, new_dir)
|
|
__string(new_name, new_dentry->d_name.name)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->dev = old_dir->i_sb->s_dev;
|
|
__entry->old_dir = NFS_FILEID(old_dir);
|
|
__entry->new_dir = NFS_FILEID(new_dir);
|
|
__entry->error = error;
|
|
__assign_str(old_name, old_dentry->d_name.name);
|
|
__assign_str(new_name, new_dentry->d_name.name);
|
|
),
|
|
|
|
TP_printk(
|
|
"error=%d old_name=%02x:%02x:%llu/%s "
|
|
"new_name=%02x:%02x:%llu/%s",
|
|
__entry->error,
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->old_dir,
|
|
__get_str(old_name),
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->new_dir,
|
|
__get_str(new_name)
|
|
)
|
|
);
|
|
#define DEFINE_NFS_RENAME_EVENT_DONE(name) \
|
|
DEFINE_EVENT(nfs_rename_event_done, name, \
|
|
TP_PROTO( \
|
|
const struct inode *old_dir, \
|
|
const struct dentry *old_dentry, \
|
|
const struct inode *new_dir, \
|
|
const struct dentry *new_dentry, \
|
|
int error \
|
|
), \
|
|
TP_ARGS(old_dir, old_dentry, new_dir, \
|
|
new_dentry, error))
|
|
|
|
DEFINE_NFS_RENAME_EVENT(nfs_rename_enter);
|
|
DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit);
|
|
|
|
DEFINE_NFS_RENAME_EVENT_DONE(nfs_sillyrename_rename);
|
|
|
|
TRACE_EVENT(nfs_sillyrename_unlink,
|
|
TP_PROTO(
|
|
const struct nfs_unlinkdata *data,
|
|
int error
|
|
),
|
|
|
|
TP_ARGS(data, error),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(dev_t, dev)
|
|
__field(int, error)
|
|
__field(u64, dir)
|
|
__dynamic_array(char, name, data->args.name.len + 1)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
struct inode *dir = d_inode(data->dentry->d_parent);
|
|
size_t len = data->args.name.len;
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
__entry->dir = NFS_FILEID(dir);
|
|
__entry->error = error;
|
|
memcpy(__get_str(name),
|
|
data->args.name.name, len);
|
|
__get_str(name)[len] = 0;
|
|
),
|
|
|
|
TP_printk(
|
|
"error=%d name=%02x:%02x:%llu/%s",
|
|
__entry->error,
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
(unsigned long long)__entry->dir,
|
|
__get_str(name)
|
|
)
|
|
);
|
|
#endif /* _TRACE_NFS_H */
|
|
|
|
#undef TRACE_INCLUDE_PATH
|
|
#define TRACE_INCLUDE_PATH .
|
|
#define TRACE_INCLUDE_FILE nfstrace
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|