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
12DECLARE_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) \
35DEFINE_EVENT(nfsd_stateid_class, name, \
36	TP_PROTO(stateid_t *stp), \
37	TP_ARGS(stp))
38DEFINE_STATEID_EVENT(layoutstate_alloc);
39DEFINE_STATEID_EVENT(layoutstate_unhash);
40DEFINE_STATEID_EVENT(layoutstate_free);
41DEFINE_STATEID_EVENT(layout_get_lookup_fail);
42DEFINE_STATEID_EVENT(layout_commit_lookup_fail);
43DEFINE_STATEID_EVENT(layout_return_lookup_fail);
44DEFINE_STATEID_EVENT(layout_recall);
45DEFINE_STATEID_EVENT(layout_recall_done);
46DEFINE_STATEID_EVENT(layout_recall_fail);
47DEFINE_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