diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2018-03-27 10:53:27 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2018-04-03 15:08:15 -0400 |
commit | d890be159a71395bd4ceca09233a8a56d7da69ee (patch) | |
tree | c8e7089ab7e52770d57842ecd189275de08bd789 /fs/nfsd/trace.h | |
parent | f394b62b7b0dd24757e9813e19f4b6091c5a28f6 (diff) |
nfsd: Add I/O trace points in the NFSv4 write path
NFSv4 write compound processing invokes nfsd_vfs_write directly. The
trace points currently in nfsd_write are not effective for NFSv4
writes.
Move the trace points into the shared nfsd_vfs_write() helper.
After the I/O, we also want to record any local I/O error that
might have occurred, and the total count of bytes that were actually
moved (rather than the requested number).
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/trace.h')
-rw-r--r-- | fs/nfsd/trace.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index 30e04852a4e0..653e9ee754d2 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h | |||
@@ -51,6 +51,39 @@ DEFINE_NFSD_IO_EVENT(write_opened); | |||
51 | DEFINE_NFSD_IO_EVENT(write_io_done); | 51 | DEFINE_NFSD_IO_EVENT(write_io_done); |
52 | DEFINE_NFSD_IO_EVENT(write_done); | 52 | DEFINE_NFSD_IO_EVENT(write_done); |
53 | 53 | ||
54 | DECLARE_EVENT_CLASS(nfsd_err_class, | ||
55 | TP_PROTO(struct svc_rqst *rqstp, | ||
56 | struct svc_fh *fhp, | ||
57 | loff_t offset, | ||
58 | int status), | ||
59 | TP_ARGS(rqstp, fhp, offset, status), | ||
60 | TP_STRUCT__entry( | ||
61 | __field(u32, xid) | ||
62 | __field(u32, fh_hash) | ||
63 | __field(loff_t, offset) | ||
64 | __field(int, status) | ||
65 | ), | ||
66 | TP_fast_assign( | ||
67 | __entry->xid = be32_to_cpu(rqstp->rq_xid); | ||
68 | __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); | ||
69 | __entry->offset = offset; | ||
70 | __entry->status = status; | ||
71 | ), | ||
72 | TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld status=%d", | ||
73 | __entry->xid, __entry->fh_hash, | ||
74 | __entry->offset, __entry->status) | ||
75 | ) | ||
76 | |||
77 | #define DEFINE_NFSD_ERR_EVENT(name) \ | ||
78 | DEFINE_EVENT(nfsd_err_class, nfsd_##name, \ | ||
79 | TP_PROTO(struct svc_rqst *rqstp, \ | ||
80 | struct svc_fh *fhp, \ | ||
81 | loff_t offset, \ | ||
82 | int len), \ | ||
83 | TP_ARGS(rqstp, fhp, offset, len)) | ||
84 | |||
85 | DEFINE_NFSD_ERR_EVENT(write_err); | ||
86 | |||
54 | #include "state.h" | 87 | #include "state.h" |
55 | 88 | ||
56 | DECLARE_EVENT_CLASS(nfsd_stateid_class, | 89 | DECLARE_EVENT_CLASS(nfsd_stateid_class, |