1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 #if !defined(__RVT_TRACE_TX_H) || defined(TRACE_HEADER_MULTI_READ)
48 #define __RVT_TRACE_TX_H
49
50 #include <linux/tracepoint.h>
51 #include <linux/trace_seq.h>
52
53 #include <rdma/ib_verbs.h>
54 #include <rdma/rdmavt_qp.h>
55
56 #undef TRACE_SYSTEM
57 #define TRACE_SYSTEM rvt_tx
58
59 #define wr_opcode_name(opcode) { IB_WR_##opcode, #opcode }
60 #define show_wr_opcode(opcode) \
61 __print_symbolic(opcode, \
62 wr_opcode_name(RDMA_WRITE), \
63 wr_opcode_name(RDMA_WRITE_WITH_IMM), \
64 wr_opcode_name(SEND), \
65 wr_opcode_name(SEND_WITH_IMM), \
66 wr_opcode_name(RDMA_READ), \
67 wr_opcode_name(ATOMIC_CMP_AND_SWP), \
68 wr_opcode_name(ATOMIC_FETCH_AND_ADD), \
69 wr_opcode_name(LSO), \
70 wr_opcode_name(SEND_WITH_INV), \
71 wr_opcode_name(RDMA_READ_WITH_INV), \
72 wr_opcode_name(LOCAL_INV), \
73 wr_opcode_name(MASKED_ATOMIC_CMP_AND_SWP), \
74 wr_opcode_name(MASKED_ATOMIC_FETCH_AND_ADD), \
75 wr_opcode_name(RESERVED1), \
76 wr_opcode_name(RESERVED2), \
77 wr_opcode_name(RESERVED3), \
78 wr_opcode_name(RESERVED4), \
79 wr_opcode_name(RESERVED5), \
80 wr_opcode_name(RESERVED6), \
81 wr_opcode_name(RESERVED7), \
82 wr_opcode_name(RESERVED8), \
83 wr_opcode_name(RESERVED9), \
84 wr_opcode_name(RESERVED10))
85
86 #define POS_PRN \
87 "[%s] wqe %p wr_id %llx send_flags %x qpn %x qpt %u psn %x lpsn %x ssn %x length %u opcode 0x%.2x,%s size %u avail %u head %u last %u pid %u num_sge %u wr_num_sge %u"
88
89 TRACE_EVENT(
90 rvt_post_one_wr,
91 TP_PROTO(struct rvt_qp *qp, struct rvt_swqe *wqe, int wr_num_sge),
92 TP_ARGS(qp, wqe, wr_num_sge),
93 TP_STRUCT__entry(
94 RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device))
95 __field(u64, wr_id)
96 __field(struct rvt_swqe *, wqe)
97 __field(u32, qpn)
98 __field(u32, qpt)
99 __field(u32, psn)
100 __field(u32, lpsn)
101 __field(u32, length)
102 __field(u32, opcode)
103 __field(u32, size)
104 __field(u32, avail)
105 __field(u32, head)
106 __field(u32, last)
107 __field(u32, ssn)
108 __field(int, send_flags)
109 __field(pid_t, pid)
110 __field(int, num_sge)
111 __field(int, wr_num_sge)
112 ),
113 TP_fast_assign(
114 RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device))
115 __entry->wqe = wqe;
116 __entry->wr_id = wqe->wr.wr_id;
117 __entry->qpn = qp->ibqp.qp_num;
118 __entry->qpt = qp->ibqp.qp_type;
119 __entry->psn = wqe->psn;
120 __entry->lpsn = wqe->lpsn;
121 __entry->length = wqe->length;
122 __entry->opcode = wqe->wr.opcode;
123 __entry->size = qp->s_size;
124 __entry->avail = qp->s_avail;
125 __entry->head = qp->s_head;
126 __entry->last = qp->s_last;
127 __entry->pid = qp->pid;
128 __entry->ssn = wqe->ssn;
129 __entry->send_flags = wqe->wr.send_flags;
130 __entry->num_sge = wqe->wr.num_sge;
131 __entry->wr_num_sge = wr_num_sge;
132 ),
133 TP_printk(
134 POS_PRN,
135 __get_str(dev),
136 __entry->wqe,
137 __entry->wr_id,
138 __entry->send_flags,
139 __entry->qpn,
140 __entry->qpt,
141 __entry->psn,
142 __entry->lpsn,
143 __entry->ssn,
144 __entry->length,
145 __entry->opcode, show_wr_opcode(__entry->opcode),
146 __entry->size,
147 __entry->avail,
148 __entry->head,
149 __entry->last,
150 __entry->pid,
151 __entry->num_sge,
152 __entry->wr_num_sge
153 )
154 );
155
156 TRACE_EVENT(
157 rvt_qp_send_completion,
158 TP_PROTO(struct rvt_qp *qp, struct rvt_swqe *wqe, u32 idx),
159 TP_ARGS(qp, wqe, idx),
160 TP_STRUCT__entry(
161 RDI_DEV_ENTRY(ib_to_rvt(qp->ibqp.device))
162 __field(struct rvt_swqe *, wqe)
163 __field(u64, wr_id)
164 __field(u32, qpn)
165 __field(u32, qpt)
166 __field(u32, length)
167 __field(u32, idx)
168 __field(u32, ssn)
169 __field(enum ib_wr_opcode, opcode)
170 __field(int, send_flags)
171 ),
172 TP_fast_assign(
173 RDI_DEV_ASSIGN(ib_to_rvt(qp->ibqp.device))
174 __entry->wqe = wqe;
175 __entry->wr_id = wqe->wr.wr_id;
176 __entry->qpn = qp->ibqp.qp_num;
177 __entry->qpt = qp->ibqp.qp_type;
178 __entry->length = wqe->length;
179 __entry->idx = idx;
180 __entry->ssn = wqe->ssn;
181 __entry->opcode = wqe->wr.opcode;
182 __entry->send_flags = wqe->wr.send_flags;
183 ),
184 TP_printk(
185 "[%s] qpn 0x%x qpt %u wqe %p idx %u wr_id %llx length %u ssn %u opcode %x send_flags %x",
186 __get_str(dev),
187 __entry->qpn,
188 __entry->qpt,
189 __entry->wqe,
190 __entry->idx,
191 __entry->wr_id,
192 __entry->length,
193 __entry->ssn,
194 __entry->opcode,
195 __entry->send_flags
196 )
197 );
198 #endif
199
200 #undef TRACE_INCLUDE_PATH
201 #undef TRACE_INCLUDE_FILE
202 #define TRACE_INCLUDE_PATH .
203 #define TRACE_INCLUDE_FILE trace_tx
204 #include <trace/define_trace.h>
205