Commit 2343172d authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

NFS: Clean up generic file read tracepoints

Clean up the generic file read tracepoints so they do pass the
full structures as arguments. Also ensure we report the number
of bytes actually read.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 0722dc9f
...@@ -820,75 +820,85 @@ TRACE_EVENT(nfs_sillyrename_unlink, ...@@ -820,75 +820,85 @@ TRACE_EVENT(nfs_sillyrename_unlink,
TRACE_EVENT(nfs_initiate_read, TRACE_EVENT(nfs_initiate_read,
TP_PROTO( TP_PROTO(
const struct inode *inode, const struct nfs_pgio_header *hdr
loff_t offset, unsigned long count
), ),
TP_ARGS(inode, offset, count), TP_ARGS(hdr),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(loff_t, offset)
__field(unsigned long, count)
__field(dev_t, dev) __field(dev_t, dev)
__field(u32, fhandle) __field(u32, fhandle)
__field(u64, fileid) __field(u64, fileid)
__field(loff_t, offset)
__field(u32, count)
), ),
TP_fast_assign( TP_fast_assign(
const struct inode *inode = hdr->inode;
const struct nfs_inode *nfsi = NFS_I(inode); const struct nfs_inode *nfsi = NFS_I(inode);
const struct nfs_fh *fh = hdr->args.fh ?
hdr->args.fh : &nfsi->fh;
__entry->offset = offset; __entry->offset = hdr->args.offset;
__entry->count = count; __entry->count = hdr->args.count;
__entry->dev = inode->i_sb->s_dev; __entry->dev = inode->i_sb->s_dev;
__entry->fileid = nfsi->fileid; __entry->fileid = nfsi->fileid;
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh); __entry->fhandle = nfs_fhandle_hash(fh);
), ),
TP_printk( TP_printk(
"fileid=%02x:%02x:%llu fhandle=0x%08x " "fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld count=%lu", "offset=%lld count=%u",
MAJOR(__entry->dev), MINOR(__entry->dev), MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->fileid, (unsigned long long)__entry->fileid,
__entry->fhandle, __entry->fhandle,
__entry->offset, __entry->count (long long)__entry->offset, __entry->count
) )
); );
TRACE_EVENT(nfs_readpage_done, TRACE_EVENT(nfs_readpage_done,
TP_PROTO( TP_PROTO(
const struct inode *inode, const struct rpc_task *task,
int status, loff_t offset, bool eof const struct nfs_pgio_header *hdr
), ),
TP_ARGS(inode, status, offset, eof), TP_ARGS(task, hdr),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(int, status)
__field(loff_t, offset)
__field(bool, eof)
__field(dev_t, dev) __field(dev_t, dev)
__field(u32, fhandle) __field(u32, fhandle)
__field(u64, fileid) __field(u64, fileid)
__field(loff_t, offset)
__field(u32, arg_count)
__field(u32, res_count)
__field(bool, eof)
__field(int, status)
), ),
TP_fast_assign( TP_fast_assign(
const struct inode *inode = hdr->inode;
const struct nfs_inode *nfsi = NFS_I(inode); const struct nfs_inode *nfsi = NFS_I(inode);
const struct nfs_fh *fh = hdr->args.fh ?
__entry->status = status; hdr->args.fh : &nfsi->fh;
__entry->offset = offset;
__entry->eof = eof; __entry->status = task->tk_status;
__entry->offset = hdr->args.offset;
__entry->arg_count = hdr->args.count;
__entry->res_count = hdr->res.count;
__entry->eof = hdr->res.eof;
__entry->dev = inode->i_sb->s_dev; __entry->dev = inode->i_sb->s_dev;
__entry->fileid = nfsi->fileid; __entry->fileid = nfsi->fileid;
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh); __entry->fhandle = nfs_fhandle_hash(fh);
), ),
TP_printk( TP_printk(
"fileid=%02x:%02x:%llu fhandle=0x%08x " "fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld status=%d%s", "offset=%lld count=%u res=%u status=%d%s",
MAJOR(__entry->dev), MINOR(__entry->dev), MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->fileid, (unsigned long long)__entry->fileid,
__entry->fhandle, __entry->fhandle,
__entry->offset, __entry->status, (long long)__entry->offset, __entry->arg_count,
__entry->res_count, __entry->status,
__entry->eof ? " eof" : "" __entry->eof ? " eof" : ""
) )
); );
......
...@@ -214,7 +214,7 @@ static void nfs_initiate_read(struct nfs_pgio_header *hdr, ...@@ -214,7 +214,7 @@ static void nfs_initiate_read(struct nfs_pgio_header *hdr,
task_setup_data->flags |= swap_flags; task_setup_data->flags |= swap_flags;
rpc_ops->read_setup(hdr, msg); rpc_ops->read_setup(hdr, msg);
trace_nfs_initiate_read(inode, hdr->io_start, hdr->good_bytes); trace_nfs_initiate_read(hdr);
} }
static void static void
...@@ -247,8 +247,7 @@ static int nfs_readpage_done(struct rpc_task *task, ...@@ -247,8 +247,7 @@ static int nfs_readpage_done(struct rpc_task *task,
return status; return status;
nfs_add_stats(inode, NFSIOS_SERVERREADBYTES, hdr->res.count); nfs_add_stats(inode, NFSIOS_SERVERREADBYTES, hdr->res.count);
trace_nfs_readpage_done(inode, task->tk_status, trace_nfs_readpage_done(task, hdr);
hdr->args.offset, hdr->res.eof);
if (task->tk_status == -ESTALE) { if (task->tk_status == -ESTALE) {
set_bit(NFS_INO_STALE, &NFS_I(inode)->flags); set_bit(NFS_INO_STALE, &NFS_I(inode)->flags);
......
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