xref: /openbmc/linux/fs/nfsd/trace.h (revision 827634ad)
1 /*
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>
11 
12 DECLARE_EVENT_CLASS(nfsd_stateid_class,
13 	TP_PROTO(stateid_t *stp),
14 	TP_ARGS(stp),
15 	TP_STRUCT__entry(
16 		__field(u32, cl_boot)
17 		__field(u32, cl_id)
18 		__field(u32, si_id)
19 		__field(u32, si_generation)
20 	),
21 	TP_fast_assign(
22 		__entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
23 		__entry->cl_id = stp->si_opaque.so_clid.cl_id;
24 		__entry->si_id = stp->si_opaque.so_id;
25 		__entry->si_generation = stp->si_generation;
26 	),
27 	TP_printk("client %08x:%08x stateid %08x:%08x",
28 		__entry->cl_boot,
29 		__entry->cl_id,
30 		__entry->si_id,
31 		__entry->si_generation)
32 )
33 
34 #define DEFINE_STATEID_EVENT(name) \
35 DEFINE_EVENT(nfsd_stateid_class, name, \
36 	TP_PROTO(stateid_t *stp), \
37 	TP_ARGS(stp))
38 DEFINE_STATEID_EVENT(layoutstate_alloc);
39 DEFINE_STATEID_EVENT(layoutstate_unhash);
40 DEFINE_STATEID_EVENT(layoutstate_free);
41 DEFINE_STATEID_EVENT(layout_get_lookup_fail);
42 DEFINE_STATEID_EVENT(layout_commit_lookup_fail);
43 DEFINE_STATEID_EVENT(layout_return_lookup_fail);
44 DEFINE_STATEID_EVENT(layout_recall);
45 DEFINE_STATEID_EVENT(layout_recall_done);
46 DEFINE_STATEID_EVENT(layout_recall_fail);
47 DEFINE_STATEID_EVENT(layout_recall_release);
48 
49 #endif /* _NFSD_TRACE_H */
50 
51 #undef TRACE_INCLUDE_PATH
52 #define TRACE_INCLUDE_PATH .
53 #define TRACE_INCLUDE_FILE trace
54 #include <trace/define_trace.h>
55