Commit 79e0b4e2 authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

nfsd: Record request byte count, not count of vectors

Byte count is more helpful to know than vector count.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent afa720a0
...@@ -15,26 +15,21 @@ DECLARE_EVENT_CLASS(nfsd_io_class, ...@@ -15,26 +15,21 @@ DECLARE_EVENT_CLASS(nfsd_io_class,
TP_PROTO(struct svc_rqst *rqstp, TP_PROTO(struct svc_rqst *rqstp,
struct svc_fh *fhp, struct svc_fh *fhp,
loff_t offset, loff_t offset,
int len), unsigned long len),
TP_ARGS(rqstp, fhp, offset, len), TP_ARGS(rqstp, fhp, offset, len),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(u32, xid) __field(u32, xid)
__field(u32, fh_hash) __field(u32, fh_hash)
__field(loff_t, offset) __field(loff_t, offset)
__field(int, len) __field(unsigned long, len)
), ),
TP_fast_assign( TP_fast_assign(
__entry->xid = be32_to_cpu(rqstp->rq_xid); __entry->xid = be32_to_cpu(rqstp->rq_xid);
do { __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
struct knfsd_fh fh;
fh_copy_shallow(&fh, &fhp->fh_handle);
__entry->fh_hash = knfsd_fh_hash(&fh);
} while (0);
__entry->offset = offset; __entry->offset = offset;
__entry->len = len; __entry->len = len;
), ),
TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld len=%d", TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld len=%lu",
__entry->xid, __entry->fh_hash, __entry->xid, __entry->fh_hash,
__entry->offset, __entry->len) __entry->offset, __entry->len)
) )
...@@ -44,7 +39,7 @@ DEFINE_EVENT(nfsd_io_class, name, \ ...@@ -44,7 +39,7 @@ DEFINE_EVENT(nfsd_io_class, name, \
TP_PROTO(struct svc_rqst *rqstp, \ TP_PROTO(struct svc_rqst *rqstp, \
struct svc_fh *fhp, \ struct svc_fh *fhp, \
loff_t offset, \ loff_t offset, \
int len), \ unsigned long len), \
TP_ARGS(rqstp, fhp, offset, len)) TP_ARGS(rqstp, fhp, offset, len))
DEFINE_NFSD_IO_EVENT(read_start); DEFINE_NFSD_IO_EVENT(read_start);
......
...@@ -1024,27 +1024,27 @@ __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1024,27 +1024,27 @@ __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
struct raparms *ra; struct raparms *ra;
__be32 err; __be32 err;
trace_read_start(rqstp, fhp, offset, vlen); trace_read_start(rqstp, fhp, offset, *count);
err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file);
if (err) if (err)
return err; return err;
ra = nfsd_init_raparms(file); ra = nfsd_init_raparms(file);
trace_read_opened(rqstp, fhp, offset, vlen); trace_read_opened(rqstp, fhp, offset, *count);
if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &rqstp->rq_flags)) if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &rqstp->rq_flags))
err = nfsd_splice_read(rqstp, file, offset, count); err = nfsd_splice_read(rqstp, file, offset, count);
else else
err = nfsd_readv(file, offset, vec, vlen, count); err = nfsd_readv(file, offset, vec, vlen, count);
trace_read_io_done(rqstp, fhp, offset, vlen); trace_read_io_done(rqstp, fhp, offset, *count);
if (ra) if (ra)
nfsd_put_raparams(file, ra); nfsd_put_raparams(file, ra);
fput(file); fput(file);
trace_read_done(rqstp, fhp, offset, vlen); trace_read_done(rqstp, fhp, offset, *count);
return err; return err;
} }
...@@ -1061,18 +1061,18 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -1061,18 +1061,18 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
struct file *file = NULL; struct file *file = NULL;
__be32 err = 0; __be32 err = 0;
trace_write_start(rqstp, fhp, offset, vlen); trace_write_start(rqstp, fhp, offset, *cnt);
err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file); err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file);
if (err) if (err)
goto out; goto out;
trace_write_opened(rqstp, fhp, offset, vlen); trace_write_opened(rqstp, fhp, offset, *cnt);
err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, cnt, stable); err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, cnt, stable);
trace_write_io_done(rqstp, fhp, offset, vlen); trace_write_io_done(rqstp, fhp, offset, *cnt);
fput(file); fput(file);
out: out:
trace_write_done(rqstp, fhp, offset, vlen); trace_write_done(rqstp, fhp, offset, *cnt);
return err; return err;
} }
......
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