summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/trace.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@poochiereds.net>2015-11-17 06:52:23 -0500
committerJ. Bruce Fields <bfields@redhat.com>2016-01-14 17:32:51 -0500
commit6e8b50d16a757d53f8817acecba97c5d4aa1cf65 (patch)
tree1d8846d614705a8475543c575e026e87e6b3eaa8 /fs/nfsd/trace.h
parent6b9b21073d3b250e17812cd562fffc9006962b39 (diff)
nfsd: add new io class tracepoint
Add some new tracepoints in the nfsd read/write codepaths. The idea is that this will give us the ability to measure how long each phase of a read or write operation takes. Signed-off-by: Jeff Layton <jeff.layton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/trace.h')
-rw-r--r--fs/nfsd/trace.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index 0befe762762b..3287041905da 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -8,6 +8,47 @@
8#define _NFSD_TRACE_H 8#define _NFSD_TRACE_H
9 9
10#include <linux/tracepoint.h> 10#include <linux/tracepoint.h>
11#include "nfsfh.h"
12
13DECLARE_EVENT_CLASS(nfsd_io_class,
14 TP_PROTO(struct svc_rqst *rqstp,
15 struct svc_fh *fhp,
16 loff_t offset,
17 int len),
18 TP_ARGS(rqstp, fhp, offset, len),
19 TP_STRUCT__entry(
20 __field(__be32, xid)
21 __field_struct(struct knfsd_fh, fh)
22 __field(loff_t, offset)
23 __field(int, len)
24 ),
25 TP_fast_assign(
26 __entry->xid = rqstp->rq_xid,
27 fh_copy_shallow(&__entry->fh, &fhp->fh_handle);
28 __entry->offset = offset;
29 __entry->len = len;
30 ),
31 TP_printk("xid=0x%x fh=0x%x offset=%lld len=%d",
32 __be32_to_cpu(__entry->xid), knfsd_fh_hash(&__entry->fh),
33 __entry->offset, __entry->len)
34)
35
36#define DEFINE_NFSD_IO_EVENT(name) \
37DEFINE_EVENT(nfsd_io_class, name, \
38 TP_PROTO(struct svc_rqst *rqstp, \
39 struct svc_fh *fhp, \
40 loff_t offset, \
41 int len), \
42 TP_ARGS(rqstp, fhp, offset, len))
43
44DEFINE_NFSD_IO_EVENT(read_start);
45DEFINE_NFSD_IO_EVENT(read_opened);
46DEFINE_NFSD_IO_EVENT(read_io_done);
47DEFINE_NFSD_IO_EVENT(read_done);
48DEFINE_NFSD_IO_EVENT(write_start);
49DEFINE_NFSD_IO_EVENT(write_opened);
50DEFINE_NFSD_IO_EVENT(write_io_done);
51DEFINE_NFSD_IO_EVENT(write_done);
11 52
12#include "state.h" 53#include "state.h"
13 54