xref: /linux/drivers/infiniband/sw/rdmavt/trace_rc.h (revision 79997eda0d31bc68203c95ecb978773ee6ce7a1f)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright(c) 2017 Intel Corporation.
4  */
5 #if !defined(__RVT_TRACE_RC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define __RVT_TRACE_RC_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_rc
16 
17 DECLARE_EVENT_CLASS(rvt_rc_template,
18 		    TP_PROTO(struct rvt_qp *qp, u32 psn),
19 		    TP_ARGS(qp, psn),
20 		    TP_STRUCT__entry(
21 			RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device))
22 			__field(u32, qpn)
23 			__field(u32, s_flags)
24 			__field(u32, psn)
25 			__field(u32, s_psn)
26 			__field(u32, s_next_psn)
27 			__field(u32, s_sending_psn)
28 			__field(u32, s_sending_hpsn)
29 			__field(u32, r_psn)
30 			),
31 		    TP_fast_assign(
32 			RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device));
33 			__entry->qpn = qp->ibqp.qp_num;
34 			__entry->s_flags = qp->s_flags;
35 			__entry->psn = psn;
36 			__entry->s_psn = qp->s_psn;
37 			__entry->s_next_psn = qp->s_next_psn;
38 			__entry->s_sending_psn = qp->s_sending_psn;
39 			__entry->s_sending_hpsn = qp->s_sending_hpsn;
40 			__entry->r_psn = qp->r_psn;
41 			),
42 		    TP_printk(
43 			"[%s] qpn 0x%x s_flags 0x%x psn 0x%x s_psn 0x%x s_next_psn 0x%x s_sending_psn 0x%x sending_hpsn 0x%x r_psn 0x%x",
44 			__get_str(dev),
45 			__entry->qpn,
46 			__entry->s_flags,
47 			__entry->psn,
48 			__entry->s_psn,
49 			__entry->s_next_psn,
50 			__entry->s_sending_psn,
51 			__entry->s_sending_hpsn,
52 			__entry->r_psn
53 			)
54 );
55 
56 DEFINE_EVENT(rvt_rc_template, rvt_rc_timeout,
57 	     TP_PROTO(struct rvt_qp *qp, u32 psn),
58 	     TP_ARGS(qp, psn)
59 );
60 
61 #endif /* __RVT_TRACE_RC_H */
62 
63 #undef TRACE_INCLUDE_PATH
64 #undef TRACE_INCLUDE_FILE
65 #define TRACE_INCLUDE_PATH .
66 #define TRACE_INCLUDE_FILE trace_rc
67 #include <trace/define_trace.h>
68