NFSv4: List stateid information in the callback tracepoints
The stateid is extremely valuable when debugging. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
@@ -982,7 +982,6 @@ DEFINE_NFS4_INODE_EVENT(nfs4_set_acl);
|
||||
DEFINE_NFS4_INODE_EVENT(nfs4_get_security_label);
|
||||
DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label);
|
||||
#endif /* CONFIG_NFS_V4_SECURITY_LABEL */
|
||||
DEFINE_NFS4_INODE_EVENT(nfs4_recall_delegation);
|
||||
|
||||
DECLARE_EVENT_CLASS(nfs4_inode_stateid_event,
|
||||
TP_PROTO(
|
||||
@@ -1145,8 +1144,74 @@ DECLARE_EVENT_CLASS(nfs4_inode_callback_event,
|
||||
), \
|
||||
TP_ARGS(clp, fhandle, inode, error))
|
||||
DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_getattr);
|
||||
DEFINE_NFS4_INODE_CALLBACK_EVENT(nfs4_cb_layoutrecall_inode);
|
||||
|
||||
DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event,
|
||||
TP_PROTO(
|
||||
const struct nfs_client *clp,
|
||||
const struct nfs_fh *fhandle,
|
||||
const struct inode *inode,
|
||||
const nfs4_stateid *stateid,
|
||||
int error
|
||||
),
|
||||
|
||||
TP_ARGS(clp, fhandle, inode, stateid, error),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(int, error)
|
||||
__field(dev_t, dev)
|
||||
__field(u32, fhandle)
|
||||
__field(u64, fileid)
|
||||
__string(dstaddr, clp ?
|
||||
rpc_peeraddr2str(clp->cl_rpcclient,
|
||||
RPC_DISPLAY_ADDR) : "unknown")
|
||||
__field(int, stateid_seq)
|
||||
__field(u32, stateid_hash)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->error = error;
|
||||
__entry->fhandle = nfs_fhandle_hash(fhandle);
|
||||
if (inode != NULL) {
|
||||
__entry->fileid = NFS_FILEID(inode);
|
||||
__entry->dev = inode->i_sb->s_dev;
|
||||
} else {
|
||||
__entry->fileid = 0;
|
||||
__entry->dev = 0;
|
||||
}
|
||||
__assign_str(dstaddr, clp ?
|
||||
rpc_peeraddr2str(clp->cl_rpcclient,
|
||||
RPC_DISPLAY_ADDR) : "unknown")
|
||||
__entry->stateid_seq =
|
||||
be32_to_cpu(stateid->seqid);
|
||||
__entry->stateid_hash =
|
||||
nfs_stateid_hash(stateid);
|
||||
),
|
||||
|
||||
TP_printk(
|
||||
"error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
||||
"stateid=%d:0x%08x dstaddr=%s",
|
||||
__entry->error,
|
||||
show_nfsv4_errors(__entry->error),
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
(unsigned long long)__entry->fileid,
|
||||
__entry->fhandle,
|
||||
__entry->stateid_seq, __entry->stateid_hash,
|
||||
__get_str(dstaddr)
|
||||
)
|
||||
);
|
||||
|
||||
#define DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(name) \
|
||||
DEFINE_EVENT(nfs4_inode_stateid_callback_event, name, \
|
||||
TP_PROTO( \
|
||||
const struct nfs_client *clp, \
|
||||
const struct nfs_fh *fhandle, \
|
||||
const struct inode *inode, \
|
||||
const nfs4_stateid *stateid, \
|
||||
int error \
|
||||
), \
|
||||
TP_ARGS(clp, fhandle, inode, stateid, error))
|
||||
DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_recall);
|
||||
DEFINE_NFS4_INODE_STATEID_CALLBACK_EVENT(nfs4_cb_layoutrecall_file);
|
||||
|
||||
DECLARE_EVENT_CLASS(nfs4_idmap_event,
|
||||
TP_PROTO(
|
||||
|
Reference in New Issue
Block a user