2 * Copyright (c) 2014 Christoph Hellwig.
5 #define TRACE_SYSTEM nfsd
7 #if !defined(_NFSD_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
10 #include <linux/tracepoint.h>
13 DECLARE_EVENT_CLASS(nfsd_io_class
,
14 TP_PROTO(struct svc_rqst
*rqstp
,
18 TP_ARGS(rqstp
, fhp
, offset
, len
),
21 __field_struct(struct knfsd_fh
, fh
)
22 __field(loff_t
, offset
)
26 __entry
->xid
= rqstp
->rq_xid
,
27 fh_copy_shallow(&__entry
->fh
, &fhp
->fh_handle
);
28 __entry
->offset
= offset
;
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
)
36 #define DEFINE_NFSD_IO_EVENT(name) \
37 DEFINE_EVENT(nfsd_io_class, name, \
38 TP_PROTO(struct svc_rqst *rqstp, \
42 TP_ARGS(rqstp, fhp, offset, len))
44 DEFINE_NFSD_IO_EVENT(read_start
);
45 DEFINE_NFSD_IO_EVENT(read_opened
);
46 DEFINE_NFSD_IO_EVENT(read_io_done
);
47 DEFINE_NFSD_IO_EVENT(read_done
);
48 DEFINE_NFSD_IO_EVENT(write_start
);
49 DEFINE_NFSD_IO_EVENT(write_opened
);
50 DEFINE_NFSD_IO_EVENT(write_io_done
);
51 DEFINE_NFSD_IO_EVENT(write_done
);
55 DECLARE_EVENT_CLASS(nfsd_stateid_class
,
56 TP_PROTO(stateid_t
*stp
),
62 __field(u32
, si_generation
)
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
;
70 TP_printk("client %08x:%08x stateid %08x:%08x",
74 __entry
->si_generation
)
77 #define DEFINE_STATEID_EVENT(name) \
78 DEFINE_EVENT(nfsd_stateid_class, name, \
79 TP_PROTO(stateid_t *stp), \
81 DEFINE_STATEID_EVENT(layoutstate_alloc
);
82 DEFINE_STATEID_EVENT(layoutstate_unhash
);
83 DEFINE_STATEID_EVENT(layoutstate_free
);
84 DEFINE_STATEID_EVENT(layout_get_lookup_fail
);
85 DEFINE_STATEID_EVENT(layout_commit_lookup_fail
);
86 DEFINE_STATEID_EVENT(layout_return_lookup_fail
);
87 DEFINE_STATEID_EVENT(layout_recall
);
88 DEFINE_STATEID_EVENT(layout_recall_done
);
89 DEFINE_STATEID_EVENT(layout_recall_fail
);
90 DEFINE_STATEID_EVENT(layout_recall_release
);
92 #endif /* _NFSD_TRACE_H */
94 #undef TRACE_INCLUDE_PATH
95 #define TRACE_INCLUDE_PATH .
96 #define TRACE_INCLUDE_FILE trace
97 #include <trace/define_trace.h>