1 /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
2 /*
3  * Copyright(c) 2016 Intel Corporation.
4  */
5 #if !defined(__RVT_TRACE_QP_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define __RVT_TRACE_QP_H
7 
8 #include <linux/tracepoint.h>
9 #include <linux/trace_seq.h>
10 
11 #include <rdma/ib_verbs.h>
12 #include <rdma/rdmavt_qp.h>
13 
14 #undef TRACE_SYSTEM
15 #define TRACE_SYSTEM rvt_qp
16 
17 DECLARE_EVENT_CLASS(rvt_qphash_template,
18 	TP_PROTO(struct rvt_qp *qp, u32 bucket),
19 	TP_ARGS(qp, bucket),
20 	TP_STRUCT__entry(
21 		RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device))
22 		__field(u32, qpn)
23 		__field(u32, bucket)
24 	),
25 	TP_fast_assign(
26 		RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device));
27 		__entry->qpn = qp->ibqp.qp_num;
28 		__entry->bucket = bucket;
29 	),
30 	TP_printk(
31 		"[%s] qpn 0x%x bucket %u",
32 		__get_str(dev),
33 		__entry->qpn,
34 		__entry->bucket
35 	)
36 );
37 
38 DEFINE_EVENT(rvt_qphash_template, rvt_qpinsert,
39 	TP_PROTO(struct rvt_qp *qp, u32 bucket),
40 	TP_ARGS(qp, bucket));
41 
42 DEFINE_EVENT(rvt_qphash_template, rvt_qpremove,
43 	TP_PROTO(struct rvt_qp *qp, u32 bucket),
44 	TP_ARGS(qp, bucket));
45 
46 DECLARE_EVENT_CLASS(
47 	rvt_rnrnak_template,
48 	TP_PROTO(struct rvt_qp *qp, u32 to),
49 	TP_ARGS(qp, to),
50 	TP_STRUCT__entry(
51 		RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device))
52 		__field(u32, qpn)
53 		__field(void *, hrtimer)
54 		__field(u32, s_flags)
55 		__field(u32, to)
56 	),
57 	TP_fast_assign(
58 		RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device));
59 		__entry->qpn = qp->ibqp.qp_num;
60 		__entry->hrtimer = &qp->s_rnr_timer;
61 		__entry->s_flags = qp->s_flags;
62 		__entry->to = to;
63 	),
64 	TP_printk(
65 		"[%s] qpn 0x%x hrtimer 0x%p s_flags 0x%x timeout %u us",
66 		__get_str(dev),
67 		__entry->qpn,
68 		__entry->hrtimer,
69 		__entry->s_flags,
70 		__entry->to
71 	)
72 );
73 
74 DEFINE_EVENT(
75 	rvt_rnrnak_template, rvt_rnrnak_add,
76 	TP_PROTO(struct rvt_qp *qp, u32 to),
77 	TP_ARGS(qp, to));
78 
79 DEFINE_EVENT(
80 	rvt_rnrnak_template, rvt_rnrnak_timeout,
81 	TP_PROTO(struct rvt_qp *qp, u32 to),
82 	TP_ARGS(qp, to));
83 
84 DEFINE_EVENT(
85 	rvt_rnrnak_template, rvt_rnrnak_stop,
86 	TP_PROTO(struct rvt_qp *qp, u32 to),
87 	TP_ARGS(qp, to));
88 
89 #endif /* __RVT_TRACE_QP_H */
90 
91 #undef TRACE_INCLUDE_PATH
92 #undef TRACE_INCLUDE_FILE
93 #define TRACE_INCLUDE_PATH .
94 #define TRACE_INCLUDE_FILE trace_qp
95 #include <trace/define_trace.h>
96 
97