1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2014 Christoph Hellwig.
6 #define TRACE_SYSTEM nfsd
8 #if !defined(_NFSD_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
11 #include <linux/tracepoint.h>
14 DECLARE_EVENT_CLASS(nfsd_io_class
,
15 TP_PROTO(struct svc_rqst
*rqstp
,
19 TP_ARGS(rqstp
, fhp
, offset
, len
),
22 __field_struct(struct knfsd_fh
, fh
)
23 __field(loff_t
, offset
)
27 __entry
->xid
= rqstp
->rq_xid
,
28 fh_copy_shallow(&__entry
->fh
, &fhp
->fh_handle
);
29 __entry
->offset
= offset
;
32 TP_printk("xid=0x%x fh=0x%x offset=%lld len=%d",
33 __be32_to_cpu(__entry
->xid
), knfsd_fh_hash(&__entry
->fh
),
34 __entry
->offset
, __entry
->len
)
37 #define DEFINE_NFSD_IO_EVENT(name) \
38 DEFINE_EVENT(nfsd_io_class, name, \
39 TP_PROTO(struct svc_rqst *rqstp, \
43 TP_ARGS(rqstp, fhp, offset, len))
45 DEFINE_NFSD_IO_EVENT(read_start
);
46 DEFINE_NFSD_IO_EVENT(read_opened
);
47 DEFINE_NFSD_IO_EVENT(read_io_done
);
48 DEFINE_NFSD_IO_EVENT(read_done
);
49 DEFINE_NFSD_IO_EVENT(write_start
);
50 DEFINE_NFSD_IO_EVENT(write_opened
);
51 DEFINE_NFSD_IO_EVENT(write_io_done
);
52 DEFINE_NFSD_IO_EVENT(write_done
);
56 DECLARE_EVENT_CLASS(nfsd_stateid_class
,
57 TP_PROTO(stateid_t
*stp
),
63 __field(u32
, si_generation
)
66 __entry
->cl_boot
= stp
->si_opaque
.so_clid
.cl_boot
;
67 __entry
->cl_id
= stp
->si_opaque
.so_clid
.cl_id
;
68 __entry
->si_id
= stp
->si_opaque
.so_id
;
69 __entry
->si_generation
= stp
->si_generation
;
71 TP_printk("client %08x:%08x stateid %08x:%08x",
75 __entry
->si_generation
)
78 #define DEFINE_STATEID_EVENT(name) \
79 DEFINE_EVENT(nfsd_stateid_class, name, \
80 TP_PROTO(stateid_t *stp), \
82 DEFINE_STATEID_EVENT(layoutstate_alloc
);
83 DEFINE_STATEID_EVENT(layoutstate_unhash
);
84 DEFINE_STATEID_EVENT(layoutstate_free
);
85 DEFINE_STATEID_EVENT(layout_get_lookup_fail
);
86 DEFINE_STATEID_EVENT(layout_commit_lookup_fail
);
87 DEFINE_STATEID_EVENT(layout_return_lookup_fail
);
88 DEFINE_STATEID_EVENT(layout_recall
);
89 DEFINE_STATEID_EVENT(layout_recall_done
);
90 DEFINE_STATEID_EVENT(layout_recall_fail
);
91 DEFINE_STATEID_EVENT(layout_recall_release
);
93 #endif /* _NFSD_TRACE_H */
95 #undef TRACE_INCLUDE_PATH
96 #define TRACE_INCLUDE_PATH .
97 #define TRACE_INCLUDE_FILE trace
98 #include <trace/define_trace.h>