blob: 3287041905dabaca2b80b3add4269a55ecf28a27 [file] [log] [blame]
Christoph Hellwig31ef83d2014-08-16 19:02:22 -05001/*
2 * Copyright (c) 2014 Christoph Hellwig.
3 */
4#undef TRACE_SYSTEM
5#define TRACE_SYSTEM nfsd
6
7#if !defined(_NFSD_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
8#define _NFSD_TRACE_H
9
10#include <linux/tracepoint.h>
Jeff Layton6e8b50d2015-11-17 06:52:23 -050011#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);
Christoph Hellwig31ef83d2014-08-16 19:02:22 -050052
Jeff Layton825213e2015-10-03 08:19:57 -040053#include "state.h"
54
Christoph Hellwig31ef83d2014-08-16 19:02:22 -050055DECLARE_EVENT_CLASS(nfsd_stateid_class,
56 TP_PROTO(stateid_t *stp),
57 TP_ARGS(stp),
58 TP_STRUCT__entry(
59 __field(u32, cl_boot)
60 __field(u32, cl_id)
61 __field(u32, si_id)
62 __field(u32, si_generation)
63 ),
64 TP_fast_assign(
65 __entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
66 __entry->cl_id = stp->si_opaque.so_clid.cl_id;
67 __entry->si_id = stp->si_opaque.so_id;
68 __entry->si_generation = stp->si_generation;
69 ),
70 TP_printk("client %08x:%08x stateid %08x:%08x",
71 __entry->cl_boot,
72 __entry->cl_id,
73 __entry->si_id,
74 __entry->si_generation)
75)
76
77#define DEFINE_STATEID_EVENT(name) \
78DEFINE_EVENT(nfsd_stateid_class, name, \
79 TP_PROTO(stateid_t *stp), \
80 TP_ARGS(stp))
81DEFINE_STATEID_EVENT(layoutstate_alloc);
82DEFINE_STATEID_EVENT(layoutstate_unhash);
83DEFINE_STATEID_EVENT(layoutstate_free);
84DEFINE_STATEID_EVENT(layout_get_lookup_fail);
85DEFINE_STATEID_EVENT(layout_commit_lookup_fail);
86DEFINE_STATEID_EVENT(layout_return_lookup_fail);
87DEFINE_STATEID_EVENT(layout_recall);
88DEFINE_STATEID_EVENT(layout_recall_done);
89DEFINE_STATEID_EVENT(layout_recall_fail);
90DEFINE_STATEID_EVENT(layout_recall_release);
91
92#endif /* _NFSD_TRACE_H */
93
94#undef TRACE_INCLUDE_PATH
95#define TRACE_INCLUDE_PATH .
96#define TRACE_INCLUDE_FILE trace
97#include <trace/define_trace.h>