xref: /openbmc/linux/include/trace/events/rxrpc.h (revision 7663edc1)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* AF_RXRPC tracepoints
3  *
4  * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
5  * Written by David Howells (dhowells@redhat.com)
6  */
7 #undef TRACE_SYSTEM
8 #define TRACE_SYSTEM rxrpc
9 
10 #if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _TRACE_RXRPC_H
12 
13 #include <linux/tracepoint.h>
14 #include <linux/errqueue.h>
15 
16 /*
17  * Define enums for tracing information.
18  *
19  * These should all be kept sorted, making it easier to match the string
20  * mapping tables further on.
21  */
22 #ifndef __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
23 #define __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
24 
25 enum rxrpc_skb_trace {
26 	rxrpc_skb_cleaned,
27 	rxrpc_skb_freed,
28 	rxrpc_skb_got,
29 	rxrpc_skb_lost,
30 	rxrpc_skb_new,
31 	rxrpc_skb_purged,
32 	rxrpc_skb_received,
33 	rxrpc_skb_rotated,
34 	rxrpc_skb_seen,
35 	rxrpc_skb_unshared,
36 	rxrpc_skb_unshared_nomem,
37 };
38 
39 enum rxrpc_local_trace {
40 	rxrpc_local_got,
41 	rxrpc_local_new,
42 	rxrpc_local_processing,
43 	rxrpc_local_put,
44 	rxrpc_local_queued,
45 };
46 
47 enum rxrpc_peer_trace {
48 	rxrpc_peer_got,
49 	rxrpc_peer_new,
50 	rxrpc_peer_processing,
51 	rxrpc_peer_put,
52 };
53 
54 enum rxrpc_conn_trace {
55 	rxrpc_conn_got,
56 	rxrpc_conn_new_client,
57 	rxrpc_conn_new_service,
58 	rxrpc_conn_put_client,
59 	rxrpc_conn_put_service,
60 	rxrpc_conn_queued,
61 	rxrpc_conn_reap_service,
62 	rxrpc_conn_seen,
63 };
64 
65 enum rxrpc_client_trace {
66 	rxrpc_client_activate_chans,
67 	rxrpc_client_alloc,
68 	rxrpc_client_chan_activate,
69 	rxrpc_client_chan_disconnect,
70 	rxrpc_client_chan_pass,
71 	rxrpc_client_chan_unstarted,
72 	rxrpc_client_chan_wait_failed,
73 	rxrpc_client_cleanup,
74 	rxrpc_client_count,
75 	rxrpc_client_discard,
76 	rxrpc_client_duplicate,
77 	rxrpc_client_exposed,
78 	rxrpc_client_replace,
79 	rxrpc_client_to_active,
80 	rxrpc_client_to_culled,
81 	rxrpc_client_to_idle,
82 	rxrpc_client_to_inactive,
83 	rxrpc_client_to_upgrade,
84 	rxrpc_client_to_waiting,
85 	rxrpc_client_uncount,
86 };
87 
88 enum rxrpc_call_trace {
89 	rxrpc_call_connected,
90 	rxrpc_call_error,
91 	rxrpc_call_got,
92 	rxrpc_call_got_kernel,
93 	rxrpc_call_got_userid,
94 	rxrpc_call_new_client,
95 	rxrpc_call_new_service,
96 	rxrpc_call_put,
97 	rxrpc_call_put_kernel,
98 	rxrpc_call_put_noqueue,
99 	rxrpc_call_put_userid,
100 	rxrpc_call_queued,
101 	rxrpc_call_queued_ref,
102 	rxrpc_call_release,
103 	rxrpc_call_seen,
104 };
105 
106 enum rxrpc_transmit_trace {
107 	rxrpc_transmit_await_reply,
108 	rxrpc_transmit_end,
109 	rxrpc_transmit_queue,
110 	rxrpc_transmit_queue_last,
111 	rxrpc_transmit_rotate,
112 	rxrpc_transmit_rotate_last,
113 	rxrpc_transmit_wait,
114 };
115 
116 enum rxrpc_receive_trace {
117 	rxrpc_receive_end,
118 	rxrpc_receive_front,
119 	rxrpc_receive_incoming,
120 	rxrpc_receive_queue,
121 	rxrpc_receive_queue_last,
122 	rxrpc_receive_rotate,
123 };
124 
125 enum rxrpc_recvmsg_trace {
126 	rxrpc_recvmsg_cont,
127 	rxrpc_recvmsg_data_return,
128 	rxrpc_recvmsg_dequeue,
129 	rxrpc_recvmsg_enter,
130 	rxrpc_recvmsg_full,
131 	rxrpc_recvmsg_hole,
132 	rxrpc_recvmsg_next,
133 	rxrpc_recvmsg_requeue,
134 	rxrpc_recvmsg_return,
135 	rxrpc_recvmsg_terminal,
136 	rxrpc_recvmsg_to_be_accepted,
137 	rxrpc_recvmsg_wait,
138 };
139 
140 enum rxrpc_rtt_tx_trace {
141 	rxrpc_rtt_tx_cancel,
142 	rxrpc_rtt_tx_data,
143 	rxrpc_rtt_tx_no_slot,
144 	rxrpc_rtt_tx_ping,
145 };
146 
147 enum rxrpc_rtt_rx_trace {
148 	rxrpc_rtt_rx_cancel,
149 	rxrpc_rtt_rx_lost,
150 	rxrpc_rtt_rx_obsolete,
151 	rxrpc_rtt_rx_ping_response,
152 	rxrpc_rtt_rx_requested_ack,
153 };
154 
155 enum rxrpc_timer_trace {
156 	rxrpc_timer_begin,
157 	rxrpc_timer_exp_ack,
158 	rxrpc_timer_exp_hard,
159 	rxrpc_timer_exp_idle,
160 	rxrpc_timer_exp_keepalive,
161 	rxrpc_timer_exp_lost_ack,
162 	rxrpc_timer_exp_normal,
163 	rxrpc_timer_exp_ping,
164 	rxrpc_timer_exp_resend,
165 	rxrpc_timer_expired,
166 	rxrpc_timer_init_for_reply,
167 	rxrpc_timer_init_for_send_reply,
168 	rxrpc_timer_restart,
169 	rxrpc_timer_set_for_ack,
170 	rxrpc_timer_set_for_hard,
171 	rxrpc_timer_set_for_idle,
172 	rxrpc_timer_set_for_keepalive,
173 	rxrpc_timer_set_for_lost_ack,
174 	rxrpc_timer_set_for_normal,
175 	rxrpc_timer_set_for_ping,
176 	rxrpc_timer_set_for_resend,
177 	rxrpc_timer_set_for_send,
178 };
179 
180 enum rxrpc_propose_ack_trace {
181 	rxrpc_propose_ack_client_tx_end,
182 	rxrpc_propose_ack_input_data,
183 	rxrpc_propose_ack_ping_for_check_life,
184 	rxrpc_propose_ack_ping_for_keepalive,
185 	rxrpc_propose_ack_ping_for_lost_ack,
186 	rxrpc_propose_ack_ping_for_lost_reply,
187 	rxrpc_propose_ack_ping_for_params,
188 	rxrpc_propose_ack_processing_op,
189 	rxrpc_propose_ack_respond_to_ack,
190 	rxrpc_propose_ack_respond_to_ping,
191 	rxrpc_propose_ack_retry_tx,
192 	rxrpc_propose_ack_rotate_rx,
193 	rxrpc_propose_ack_terminal_ack,
194 };
195 
196 enum rxrpc_propose_ack_outcome {
197 	rxrpc_propose_ack_subsume,
198 	rxrpc_propose_ack_update,
199 	rxrpc_propose_ack_use,
200 };
201 
202 enum rxrpc_congest_change {
203 	rxrpc_cong_begin_retransmission,
204 	rxrpc_cong_cleared_nacks,
205 	rxrpc_cong_new_low_nack,
206 	rxrpc_cong_no_change,
207 	rxrpc_cong_progress,
208 	rxrpc_cong_retransmit_again,
209 	rxrpc_cong_rtt_window_end,
210 	rxrpc_cong_saw_nack,
211 };
212 
213 enum rxrpc_tx_point {
214 	rxrpc_tx_point_call_abort,
215 	rxrpc_tx_point_call_ack,
216 	rxrpc_tx_point_call_data_frag,
217 	rxrpc_tx_point_call_data_nofrag,
218 	rxrpc_tx_point_call_final_resend,
219 	rxrpc_tx_point_conn_abort,
220 	rxrpc_tx_point_rxkad_challenge,
221 	rxrpc_tx_point_rxkad_response,
222 	rxrpc_tx_point_reject,
223 	rxrpc_tx_point_version_keepalive,
224 	rxrpc_tx_point_version_reply,
225 };
226 
227 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
228 
229 /*
230  * Declare tracing information enums and their string mappings for display.
231  */
232 #define rxrpc_skb_traces \
233 	EM(rxrpc_skb_cleaned,			"CLN") \
234 	EM(rxrpc_skb_freed,			"FRE") \
235 	EM(rxrpc_skb_got,			"GOT") \
236 	EM(rxrpc_skb_lost,			"*L*") \
237 	EM(rxrpc_skb_new,			"NEW") \
238 	EM(rxrpc_skb_purged,			"PUR") \
239 	EM(rxrpc_skb_received,			"RCV") \
240 	EM(rxrpc_skb_rotated,			"ROT") \
241 	EM(rxrpc_skb_seen,			"SEE") \
242 	EM(rxrpc_skb_unshared,			"UNS") \
243 	E_(rxrpc_skb_unshared_nomem,		"US0")
244 
245 #define rxrpc_local_traces \
246 	EM(rxrpc_local_got,			"GOT") \
247 	EM(rxrpc_local_new,			"NEW") \
248 	EM(rxrpc_local_processing,		"PRO") \
249 	EM(rxrpc_local_put,			"PUT") \
250 	E_(rxrpc_local_queued,			"QUE")
251 
252 #define rxrpc_peer_traces \
253 	EM(rxrpc_peer_got,			"GOT") \
254 	EM(rxrpc_peer_new,			"NEW") \
255 	EM(rxrpc_peer_processing,		"PRO") \
256 	E_(rxrpc_peer_put,			"PUT")
257 
258 #define rxrpc_conn_traces \
259 	EM(rxrpc_conn_got,			"GOT") \
260 	EM(rxrpc_conn_new_client,		"NWc") \
261 	EM(rxrpc_conn_new_service,		"NWs") \
262 	EM(rxrpc_conn_put_client,		"PTc") \
263 	EM(rxrpc_conn_put_service,		"PTs") \
264 	EM(rxrpc_conn_queued,			"QUE") \
265 	EM(rxrpc_conn_reap_service,		"RPs") \
266 	E_(rxrpc_conn_seen,			"SEE")
267 
268 #define rxrpc_client_traces \
269 	EM(rxrpc_client_activate_chans,		"Activa") \
270 	EM(rxrpc_client_alloc,			"Alloc ") \
271 	EM(rxrpc_client_chan_activate,		"ChActv") \
272 	EM(rxrpc_client_chan_disconnect,	"ChDisc") \
273 	EM(rxrpc_client_chan_pass,		"ChPass") \
274 	EM(rxrpc_client_chan_unstarted,		"ChUnst") \
275 	EM(rxrpc_client_chan_wait_failed,	"ChWtFl") \
276 	EM(rxrpc_client_cleanup,		"Clean ") \
277 	EM(rxrpc_client_count,			"Count ") \
278 	EM(rxrpc_client_discard,		"Discar") \
279 	EM(rxrpc_client_duplicate,		"Duplic") \
280 	EM(rxrpc_client_exposed,		"Expose") \
281 	EM(rxrpc_client_replace,		"Replac") \
282 	EM(rxrpc_client_to_active,		"->Actv") \
283 	EM(rxrpc_client_to_culled,		"->Cull") \
284 	EM(rxrpc_client_to_idle,		"->Idle") \
285 	EM(rxrpc_client_to_inactive,		"->Inac") \
286 	EM(rxrpc_client_to_upgrade,		"->Upgd") \
287 	EM(rxrpc_client_to_waiting,		"->Wait") \
288 	E_(rxrpc_client_uncount,		"Uncoun")
289 
290 #define rxrpc_conn_cache_states \
291 	EM(RXRPC_CONN_CLIENT_INACTIVE,		"Inac") \
292 	EM(RXRPC_CONN_CLIENT_WAITING,		"Wait") \
293 	EM(RXRPC_CONN_CLIENT_ACTIVE,		"Actv") \
294 	EM(RXRPC_CONN_CLIENT_UPGRADE,		"Upgd") \
295 	EM(RXRPC_CONN_CLIENT_CULLED,		"Cull") \
296 	E_(RXRPC_CONN_CLIENT_IDLE,		"Idle") \
297 
298 #define rxrpc_call_traces \
299 	EM(rxrpc_call_connected,		"CON") \
300 	EM(rxrpc_call_error,			"*E*") \
301 	EM(rxrpc_call_got,			"GOT") \
302 	EM(rxrpc_call_got_kernel,		"Gke") \
303 	EM(rxrpc_call_got_userid,		"Gus") \
304 	EM(rxrpc_call_new_client,		"NWc") \
305 	EM(rxrpc_call_new_service,		"NWs") \
306 	EM(rxrpc_call_put,			"PUT") \
307 	EM(rxrpc_call_put_kernel,		"Pke") \
308 	EM(rxrpc_call_put_noqueue,		"PNQ") \
309 	EM(rxrpc_call_put_userid,		"Pus") \
310 	EM(rxrpc_call_queued,			"QUE") \
311 	EM(rxrpc_call_queued_ref,		"QUR") \
312 	EM(rxrpc_call_release,			"RLS") \
313 	E_(rxrpc_call_seen,			"SEE")
314 
315 #define rxrpc_transmit_traces \
316 	EM(rxrpc_transmit_await_reply,		"AWR") \
317 	EM(rxrpc_transmit_end,			"END") \
318 	EM(rxrpc_transmit_queue,		"QUE") \
319 	EM(rxrpc_transmit_queue_last,		"QLS") \
320 	EM(rxrpc_transmit_rotate,		"ROT") \
321 	EM(rxrpc_transmit_rotate_last,		"RLS") \
322 	E_(rxrpc_transmit_wait,			"WAI")
323 
324 #define rxrpc_receive_traces \
325 	EM(rxrpc_receive_end,			"END") \
326 	EM(rxrpc_receive_front,			"FRN") \
327 	EM(rxrpc_receive_incoming,		"INC") \
328 	EM(rxrpc_receive_queue,			"QUE") \
329 	EM(rxrpc_receive_queue_last,		"QLS") \
330 	E_(rxrpc_receive_rotate,		"ROT")
331 
332 #define rxrpc_recvmsg_traces \
333 	EM(rxrpc_recvmsg_cont,			"CONT") \
334 	EM(rxrpc_recvmsg_data_return,		"DATA") \
335 	EM(rxrpc_recvmsg_dequeue,		"DEQU") \
336 	EM(rxrpc_recvmsg_enter,			"ENTR") \
337 	EM(rxrpc_recvmsg_full,			"FULL") \
338 	EM(rxrpc_recvmsg_hole,			"HOLE") \
339 	EM(rxrpc_recvmsg_next,			"NEXT") \
340 	EM(rxrpc_recvmsg_requeue,		"REQU") \
341 	EM(rxrpc_recvmsg_return,		"RETN") \
342 	EM(rxrpc_recvmsg_terminal,		"TERM") \
343 	EM(rxrpc_recvmsg_to_be_accepted,	"TBAC") \
344 	E_(rxrpc_recvmsg_wait,			"WAIT")
345 
346 #define rxrpc_rtt_tx_traces \
347 	EM(rxrpc_rtt_tx_cancel,			"CNCE") \
348 	EM(rxrpc_rtt_tx_data,			"DATA") \
349 	EM(rxrpc_rtt_tx_no_slot,		"FULL") \
350 	E_(rxrpc_rtt_tx_ping,			"PING")
351 
352 #define rxrpc_rtt_rx_traces \
353 	EM(rxrpc_rtt_rx_cancel,			"CNCL") \
354 	EM(rxrpc_rtt_rx_obsolete,		"OBSL") \
355 	EM(rxrpc_rtt_rx_lost,			"LOST") \
356 	EM(rxrpc_rtt_rx_ping_response,		"PONG") \
357 	E_(rxrpc_rtt_rx_requested_ack,		"RACK")
358 
359 #define rxrpc_timer_traces \
360 	EM(rxrpc_timer_begin,			"Begin ") \
361 	EM(rxrpc_timer_expired,			"*EXPR*") \
362 	EM(rxrpc_timer_exp_ack,			"ExpAck") \
363 	EM(rxrpc_timer_exp_hard,		"ExpHrd") \
364 	EM(rxrpc_timer_exp_idle,		"ExpIdl") \
365 	EM(rxrpc_timer_exp_keepalive,		"ExpKA ") \
366 	EM(rxrpc_timer_exp_lost_ack,		"ExpLoA") \
367 	EM(rxrpc_timer_exp_normal,		"ExpNml") \
368 	EM(rxrpc_timer_exp_ping,		"ExpPng") \
369 	EM(rxrpc_timer_exp_resend,		"ExpRsn") \
370 	EM(rxrpc_timer_init_for_reply,		"IniRpl") \
371 	EM(rxrpc_timer_init_for_send_reply,	"SndRpl") \
372 	EM(rxrpc_timer_restart,			"Restrt") \
373 	EM(rxrpc_timer_set_for_ack,		"SetAck") \
374 	EM(rxrpc_timer_set_for_hard,		"SetHrd") \
375 	EM(rxrpc_timer_set_for_idle,		"SetIdl") \
376 	EM(rxrpc_timer_set_for_keepalive,	"KeepAl") \
377 	EM(rxrpc_timer_set_for_lost_ack,	"SetLoA") \
378 	EM(rxrpc_timer_set_for_normal,		"SetNml") \
379 	EM(rxrpc_timer_set_for_ping,		"SetPng") \
380 	EM(rxrpc_timer_set_for_resend,		"SetRTx") \
381 	E_(rxrpc_timer_set_for_send,		"SetSnd")
382 
383 #define rxrpc_propose_ack_traces \
384 	EM(rxrpc_propose_ack_client_tx_end,	"ClTxEnd") \
385 	EM(rxrpc_propose_ack_input_data,	"DataIn ") \
386 	EM(rxrpc_propose_ack_ping_for_check_life, "ChkLife") \
387 	EM(rxrpc_propose_ack_ping_for_keepalive, "KeepAlv") \
388 	EM(rxrpc_propose_ack_ping_for_lost_ack,	"LostAck") \
389 	EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
390 	EM(rxrpc_propose_ack_ping_for_params,	"Params ") \
391 	EM(rxrpc_propose_ack_processing_op,	"ProcOp ") \
392 	EM(rxrpc_propose_ack_respond_to_ack,	"Rsp2Ack") \
393 	EM(rxrpc_propose_ack_respond_to_ping,	"Rsp2Png") \
394 	EM(rxrpc_propose_ack_retry_tx,		"RetryTx") \
395 	EM(rxrpc_propose_ack_rotate_rx,		"RxAck  ") \
396 	E_(rxrpc_propose_ack_terminal_ack,	"ClTerm ")
397 
398 #define rxrpc_propose_ack_outcomes \
399 	EM(rxrpc_propose_ack_subsume,		" Subsume") \
400 	EM(rxrpc_propose_ack_update,		" Update") \
401 	E_(rxrpc_propose_ack_use,		" New")
402 
403 #define rxrpc_congest_modes \
404 	EM(RXRPC_CALL_CONGEST_AVOIDANCE,	"CongAvoid") \
405 	EM(RXRPC_CALL_FAST_RETRANSMIT,		"FastReTx ") \
406 	EM(RXRPC_CALL_PACKET_LOSS,		"PktLoss  ") \
407 	E_(RXRPC_CALL_SLOW_START,		"SlowStart")
408 
409 #define rxrpc_congest_changes \
410 	EM(rxrpc_cong_begin_retransmission,	" Retrans") \
411 	EM(rxrpc_cong_cleared_nacks,		" Cleared") \
412 	EM(rxrpc_cong_new_low_nack,		" NewLowN") \
413 	EM(rxrpc_cong_no_change,		" -") \
414 	EM(rxrpc_cong_progress,			" Progres") \
415 	EM(rxrpc_cong_retransmit_again,		" ReTxAgn") \
416 	EM(rxrpc_cong_rtt_window_end,		" RttWinE") \
417 	E_(rxrpc_cong_saw_nack,			" SawNack")
418 
419 #define rxrpc_pkts \
420 	EM(0,					"?00") \
421 	EM(RXRPC_PACKET_TYPE_DATA,		"DATA") \
422 	EM(RXRPC_PACKET_TYPE_ACK,		"ACK") \
423 	EM(RXRPC_PACKET_TYPE_BUSY,		"BUSY") \
424 	EM(RXRPC_PACKET_TYPE_ABORT,		"ABORT") \
425 	EM(RXRPC_PACKET_TYPE_ACKALL,		"ACKALL") \
426 	EM(RXRPC_PACKET_TYPE_CHALLENGE,		"CHALL") \
427 	EM(RXRPC_PACKET_TYPE_RESPONSE,		"RESP") \
428 	EM(RXRPC_PACKET_TYPE_DEBUG,		"DEBUG") \
429 	EM(9,					"?09") \
430 	EM(10,					"?10") \
431 	EM(11,					"?11") \
432 	EM(12,					"?12") \
433 	EM(RXRPC_PACKET_TYPE_VERSION,		"VERSION") \
434 	EM(14,					"?14") \
435 	E_(15,					"?15")
436 
437 #define rxrpc_ack_names \
438 	EM(0,					"-0-") \
439 	EM(RXRPC_ACK_REQUESTED,			"REQ") \
440 	EM(RXRPC_ACK_DUPLICATE,			"DUP") \
441 	EM(RXRPC_ACK_OUT_OF_SEQUENCE,		"OOS") \
442 	EM(RXRPC_ACK_EXCEEDS_WINDOW,		"WIN") \
443 	EM(RXRPC_ACK_NOSPACE,			"MEM") \
444 	EM(RXRPC_ACK_PING,			"PNG") \
445 	EM(RXRPC_ACK_PING_RESPONSE,		"PNR") \
446 	EM(RXRPC_ACK_DELAY,			"DLY") \
447 	EM(RXRPC_ACK_IDLE,			"IDL") \
448 	E_(RXRPC_ACK__INVALID,			"-?-")
449 
450 #define rxrpc_completions \
451 	EM(RXRPC_CALL_SUCCEEDED,		"Succeeded") \
452 	EM(RXRPC_CALL_REMOTELY_ABORTED,		"RemoteAbort") \
453 	EM(RXRPC_CALL_LOCALLY_ABORTED,		"LocalAbort") \
454 	EM(RXRPC_CALL_LOCAL_ERROR,		"LocalError") \
455 	E_(RXRPC_CALL_NETWORK_ERROR,		"NetError")
456 
457 #define rxrpc_tx_points \
458 	EM(rxrpc_tx_point_call_abort,		"CallAbort") \
459 	EM(rxrpc_tx_point_call_ack,		"CallAck") \
460 	EM(rxrpc_tx_point_call_data_frag,	"CallDataFrag") \
461 	EM(rxrpc_tx_point_call_data_nofrag,	"CallDataNofrag") \
462 	EM(rxrpc_tx_point_call_final_resend,	"CallFinalResend") \
463 	EM(rxrpc_tx_point_conn_abort,		"ConnAbort") \
464 	EM(rxrpc_tx_point_reject,		"Reject") \
465 	EM(rxrpc_tx_point_rxkad_challenge,	"RxkadChall") \
466 	EM(rxrpc_tx_point_rxkad_response,	"RxkadResp") \
467 	EM(rxrpc_tx_point_version_keepalive,	"VerKeepalive") \
468 	E_(rxrpc_tx_point_version_reply,	"VerReply")
469 
470 /*
471  * Export enum symbols via userspace.
472  */
473 #undef EM
474 #undef E_
475 #define EM(a, b) TRACE_DEFINE_ENUM(a);
476 #define E_(a, b) TRACE_DEFINE_ENUM(a);
477 
478 rxrpc_skb_traces;
479 rxrpc_local_traces;
480 rxrpc_conn_traces;
481 rxrpc_client_traces;
482 rxrpc_call_traces;
483 rxrpc_transmit_traces;
484 rxrpc_receive_traces;
485 rxrpc_recvmsg_traces;
486 rxrpc_rtt_tx_traces;
487 rxrpc_rtt_rx_traces;
488 rxrpc_timer_traces;
489 rxrpc_propose_ack_traces;
490 rxrpc_propose_ack_outcomes;
491 rxrpc_congest_modes;
492 rxrpc_congest_changes;
493 rxrpc_tx_points;
494 
495 /*
496  * Now redefine the EM() and E_() macros to map the enums to the strings that
497  * will be printed in the output.
498  */
499 #undef EM
500 #undef E_
501 #define EM(a, b)	{ a, b },
502 #define E_(a, b)	{ a, b }
503 
504 TRACE_EVENT(rxrpc_local,
505 	    TP_PROTO(unsigned int local_debug_id, enum rxrpc_local_trace op,
506 		     int usage, const void *where),
507 
508 	    TP_ARGS(local_debug_id, op, usage, where),
509 
510 	    TP_STRUCT__entry(
511 		    __field(unsigned int,	local		)
512 		    __field(int,		op		)
513 		    __field(int,		usage		)
514 		    __field(const void *,	where		)
515 			     ),
516 
517 	    TP_fast_assign(
518 		    __entry->local = local_debug_id;
519 		    __entry->op = op;
520 		    __entry->usage = usage;
521 		    __entry->where = where;
522 			   ),
523 
524 	    TP_printk("L=%08x %s u=%d sp=%pSR",
525 		      __entry->local,
526 		      __print_symbolic(__entry->op, rxrpc_local_traces),
527 		      __entry->usage,
528 		      __entry->where)
529 	    );
530 
531 TRACE_EVENT(rxrpc_peer,
532 	    TP_PROTO(unsigned int peer_debug_id, enum rxrpc_peer_trace op,
533 		     int usage, const void *where),
534 
535 	    TP_ARGS(peer_debug_id, op, usage, where),
536 
537 	    TP_STRUCT__entry(
538 		    __field(unsigned int,	peer		)
539 		    __field(int,		op		)
540 		    __field(int,		usage		)
541 		    __field(const void *,	where		)
542 			     ),
543 
544 	    TP_fast_assign(
545 		    __entry->peer = peer_debug_id;
546 		    __entry->op = op;
547 		    __entry->usage = usage;
548 		    __entry->where = where;
549 			   ),
550 
551 	    TP_printk("P=%08x %s u=%d sp=%pSR",
552 		      __entry->peer,
553 		      __print_symbolic(__entry->op, rxrpc_peer_traces),
554 		      __entry->usage,
555 		      __entry->where)
556 	    );
557 
558 TRACE_EVENT(rxrpc_conn,
559 	    TP_PROTO(unsigned int conn_debug_id, enum rxrpc_conn_trace op,
560 		     int usage, const void *where),
561 
562 	    TP_ARGS(conn_debug_id, op, usage, where),
563 
564 	    TP_STRUCT__entry(
565 		    __field(unsigned int,	conn		)
566 		    __field(int,		op		)
567 		    __field(int,		usage		)
568 		    __field(const void *,	where		)
569 			     ),
570 
571 	    TP_fast_assign(
572 		    __entry->conn = conn_debug_id;
573 		    __entry->op = op;
574 		    __entry->usage = usage;
575 		    __entry->where = where;
576 			   ),
577 
578 	    TP_printk("C=%08x %s u=%d sp=%pSR",
579 		      __entry->conn,
580 		      __print_symbolic(__entry->op, rxrpc_conn_traces),
581 		      __entry->usage,
582 		      __entry->where)
583 	    );
584 
585 TRACE_EVENT(rxrpc_client,
586 	    TP_PROTO(struct rxrpc_connection *conn, int channel,
587 		     enum rxrpc_client_trace op),
588 
589 	    TP_ARGS(conn, channel, op),
590 
591 	    TP_STRUCT__entry(
592 		    __field(unsigned int,		conn		)
593 		    __field(u32,			cid		)
594 		    __field(int,			channel		)
595 		    __field(int,			usage		)
596 		    __field(enum rxrpc_client_trace,	op		)
597 		    __field(enum rxrpc_conn_cache_state, cs		)
598 			     ),
599 
600 	    TP_fast_assign(
601 		    __entry->conn = conn->debug_id;
602 		    __entry->channel = channel;
603 		    __entry->usage = atomic_read(&conn->usage);
604 		    __entry->op = op;
605 		    __entry->cid = conn->proto.cid;
606 		    __entry->cs = conn->cache_state;
607 			   ),
608 
609 	    TP_printk("C=%08x h=%2d %s %s i=%08x u=%d",
610 		      __entry->conn,
611 		      __entry->channel,
612 		      __print_symbolic(__entry->op, rxrpc_client_traces),
613 		      __print_symbolic(__entry->cs, rxrpc_conn_cache_states),
614 		      __entry->cid,
615 		      __entry->usage)
616 	    );
617 
618 TRACE_EVENT(rxrpc_call,
619 	    TP_PROTO(unsigned int call_debug_id, enum rxrpc_call_trace op,
620 		     int usage, const void *where, const void *aux),
621 
622 	    TP_ARGS(call_debug_id, op, usage, where, aux),
623 
624 	    TP_STRUCT__entry(
625 		    __field(unsigned int,		call		)
626 		    __field(int,			op		)
627 		    __field(int,			usage		)
628 		    __field(const void *,		where		)
629 		    __field(const void *,		aux		)
630 			     ),
631 
632 	    TP_fast_assign(
633 		    __entry->call = call_debug_id;
634 		    __entry->op = op;
635 		    __entry->usage = usage;
636 		    __entry->where = where;
637 		    __entry->aux = aux;
638 			   ),
639 
640 	    TP_printk("c=%08x %s u=%d sp=%pSR a=%p",
641 		      __entry->call,
642 		      __print_symbolic(__entry->op, rxrpc_call_traces),
643 		      __entry->usage,
644 		      __entry->where,
645 		      __entry->aux)
646 	    );
647 
648 TRACE_EVENT(rxrpc_skb,
649 	    TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
650 		     int usage, int mod_count, u8 flags,    const void *where),
651 
652 	    TP_ARGS(skb, op, usage, mod_count, flags, where),
653 
654 	    TP_STRUCT__entry(
655 		    __field(struct sk_buff *,		skb		)
656 		    __field(enum rxrpc_skb_trace,	op		)
657 		    __field(u8,				flags		)
658 		    __field(int,			usage		)
659 		    __field(int,			mod_count	)
660 		    __field(const void *,		where		)
661 			     ),
662 
663 	    TP_fast_assign(
664 		    __entry->skb = skb;
665 		    __entry->flags = flags;
666 		    __entry->op = op;
667 		    __entry->usage = usage;
668 		    __entry->mod_count = mod_count;
669 		    __entry->where = where;
670 			   ),
671 
672 	    TP_printk("s=%p %cx %s u=%d m=%d p=%pSR",
673 		      __entry->skb,
674 		      __entry->flags & RXRPC_SKB_TX_BUFFER ? 'T' : 'R',
675 		      __print_symbolic(__entry->op, rxrpc_skb_traces),
676 		      __entry->usage,
677 		      __entry->mod_count,
678 		      __entry->where)
679 	    );
680 
681 TRACE_EVENT(rxrpc_rx_packet,
682 	    TP_PROTO(struct rxrpc_skb_priv *sp),
683 
684 	    TP_ARGS(sp),
685 
686 	    TP_STRUCT__entry(
687 		    __field_struct(struct rxrpc_host_header,	hdr		)
688 			     ),
689 
690 	    TP_fast_assign(
691 		    memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
692 			   ),
693 
694 	    TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
695 		      __entry->hdr.epoch, __entry->hdr.cid,
696 		      __entry->hdr.callNumber, __entry->hdr.serviceId,
697 		      __entry->hdr.serial, __entry->hdr.seq,
698 		      __entry->hdr.type, __entry->hdr.flags,
699 		      __entry->hdr.type <= 15 ?
700 		      __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
701 	    );
702 
703 TRACE_EVENT(rxrpc_rx_done,
704 	    TP_PROTO(int result, int abort_code),
705 
706 	    TP_ARGS(result, abort_code),
707 
708 	    TP_STRUCT__entry(
709 		    __field(int,			result		)
710 		    __field(int,			abort_code	)
711 			     ),
712 
713 	    TP_fast_assign(
714 		    __entry->result = result;
715 		    __entry->abort_code = abort_code;
716 			   ),
717 
718 	    TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
719 	    );
720 
721 TRACE_EVENT(rxrpc_abort,
722 	    TP_PROTO(unsigned int call_nr, const char *why, u32 cid, u32 call_id,
723 		     rxrpc_seq_t seq, int abort_code, int error),
724 
725 	    TP_ARGS(call_nr, why, cid, call_id, seq, abort_code, error),
726 
727 	    TP_STRUCT__entry(
728 		    __field(unsigned int,		call_nr		)
729 		    __array(char,			why, 4		)
730 		    __field(u32,			cid		)
731 		    __field(u32,			call_id		)
732 		    __field(rxrpc_seq_t,		seq		)
733 		    __field(int,			abort_code	)
734 		    __field(int,			error		)
735 			     ),
736 
737 	    TP_fast_assign(
738 		    memcpy(__entry->why, why, 4);
739 		    __entry->call_nr = call_nr;
740 		    __entry->cid = cid;
741 		    __entry->call_id = call_id;
742 		    __entry->abort_code = abort_code;
743 		    __entry->error = error;
744 		    __entry->seq = seq;
745 			   ),
746 
747 	    TP_printk("c=%08x %08x:%08x s=%u a=%d e=%d %s",
748 		      __entry->call_nr,
749 		      __entry->cid, __entry->call_id, __entry->seq,
750 		      __entry->abort_code, __entry->error, __entry->why)
751 	    );
752 
753 TRACE_EVENT(rxrpc_call_complete,
754 	    TP_PROTO(struct rxrpc_call *call),
755 
756 	    TP_ARGS(call),
757 
758 	    TP_STRUCT__entry(
759 		    __field(unsigned int,		call		)
760 		    __field(enum rxrpc_call_completion,	compl		)
761 		    __field(int,			error		)
762 		    __field(u32,			abort_code	)
763 			     ),
764 
765 	    TP_fast_assign(
766 		    __entry->call = call->debug_id;
767 		    __entry->compl = call->completion;
768 		    __entry->error = call->error;
769 		    __entry->abort_code = call->abort_code;
770 			   ),
771 
772 	    TP_printk("c=%08x %s r=%d ac=%d",
773 		      __entry->call,
774 		      __print_symbolic(__entry->compl, rxrpc_completions),
775 		      __entry->error,
776 		      __entry->abort_code)
777 	    );
778 
779 TRACE_EVENT(rxrpc_transmit,
780 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
781 
782 	    TP_ARGS(call, why),
783 
784 	    TP_STRUCT__entry(
785 		    __field(unsigned int,		call		)
786 		    __field(enum rxrpc_transmit_trace,	why		)
787 		    __field(rxrpc_seq_t,		tx_hard_ack	)
788 		    __field(rxrpc_seq_t,		tx_top		)
789 		    __field(int,			tx_winsize	)
790 			     ),
791 
792 	    TP_fast_assign(
793 		    __entry->call = call->debug_id;
794 		    __entry->why = why;
795 		    __entry->tx_hard_ack = call->tx_hard_ack;
796 		    __entry->tx_top = call->tx_top;
797 		    __entry->tx_winsize = call->tx_winsize;
798 			   ),
799 
800 	    TP_printk("c=%08x %s f=%08x n=%u/%u",
801 		      __entry->call,
802 		      __print_symbolic(__entry->why, rxrpc_transmit_traces),
803 		      __entry->tx_hard_ack + 1,
804 		      __entry->tx_top - __entry->tx_hard_ack,
805 		      __entry->tx_winsize)
806 	    );
807 
808 TRACE_EVENT(rxrpc_rx_data,
809 	    TP_PROTO(unsigned int call, rxrpc_seq_t seq,
810 		     rxrpc_serial_t serial, u8 flags, u8 anno),
811 
812 	    TP_ARGS(call, seq, serial, flags, anno),
813 
814 	    TP_STRUCT__entry(
815 		    __field(unsigned int,		call		)
816 		    __field(rxrpc_seq_t,		seq		)
817 		    __field(rxrpc_serial_t,		serial		)
818 		    __field(u8,				flags		)
819 		    __field(u8,				anno		)
820 			     ),
821 
822 	    TP_fast_assign(
823 		    __entry->call = call;
824 		    __entry->seq = seq;
825 		    __entry->serial = serial;
826 		    __entry->flags = flags;
827 		    __entry->anno = anno;
828 			   ),
829 
830 	    TP_printk("c=%08x DATA %08x q=%08x fl=%02x a=%02x",
831 		      __entry->call,
832 		      __entry->serial,
833 		      __entry->seq,
834 		      __entry->flags,
835 		      __entry->anno)
836 	    );
837 
838 TRACE_EVENT(rxrpc_rx_ack,
839 	    TP_PROTO(struct rxrpc_call *call,
840 		     rxrpc_serial_t serial, rxrpc_serial_t ack_serial,
841 		     rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks),
842 
843 	    TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
844 
845 	    TP_STRUCT__entry(
846 		    __field(unsigned int,		call		)
847 		    __field(rxrpc_serial_t,		serial		)
848 		    __field(rxrpc_serial_t,		ack_serial	)
849 		    __field(rxrpc_seq_t,		first		)
850 		    __field(rxrpc_seq_t,		prev		)
851 		    __field(u8,				reason		)
852 		    __field(u8,				n_acks		)
853 			     ),
854 
855 	    TP_fast_assign(
856 		    __entry->call = call->debug_id;
857 		    __entry->serial = serial;
858 		    __entry->ack_serial = ack_serial;
859 		    __entry->first = first;
860 		    __entry->prev = prev;
861 		    __entry->reason = reason;
862 		    __entry->n_acks = n_acks;
863 			   ),
864 
865 	    TP_printk("c=%08x %08x %s r=%08x f=%08x p=%08x n=%u",
866 		      __entry->call,
867 		      __entry->serial,
868 		      __print_symbolic(__entry->reason, rxrpc_ack_names),
869 		      __entry->ack_serial,
870 		      __entry->first,
871 		      __entry->prev,
872 		      __entry->n_acks)
873 	    );
874 
875 TRACE_EVENT(rxrpc_rx_abort,
876 	    TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
877 		     u32 abort_code),
878 
879 	    TP_ARGS(call, serial, abort_code),
880 
881 	    TP_STRUCT__entry(
882 		    __field(unsigned int,		call		)
883 		    __field(rxrpc_serial_t,		serial		)
884 		    __field(u32,			abort_code	)
885 			     ),
886 
887 	    TP_fast_assign(
888 		    __entry->call = call->debug_id;
889 		    __entry->serial = serial;
890 		    __entry->abort_code = abort_code;
891 			   ),
892 
893 	    TP_printk("c=%08x ABORT %08x ac=%d",
894 		      __entry->call,
895 		      __entry->serial,
896 		      __entry->abort_code)
897 	    );
898 
899 TRACE_EVENT(rxrpc_rx_rwind_change,
900 	    TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
901 		     u32 rwind, bool wake),
902 
903 	    TP_ARGS(call, serial, rwind, wake),
904 
905 	    TP_STRUCT__entry(
906 		    __field(unsigned int,		call		)
907 		    __field(rxrpc_serial_t,		serial		)
908 		    __field(u32,			rwind		)
909 		    __field(bool,			wake		)
910 			     ),
911 
912 	    TP_fast_assign(
913 		    __entry->call = call->debug_id;
914 		    __entry->serial = serial;
915 		    __entry->rwind = rwind;
916 		    __entry->wake = wake;
917 			   ),
918 
919 	    TP_printk("c=%08x %08x rw=%u%s",
920 		      __entry->call,
921 		      __entry->serial,
922 		      __entry->rwind,
923 		      __entry->wake ? " wake" : "")
924 	    );
925 
926 TRACE_EVENT(rxrpc_tx_packet,
927 	    TP_PROTO(unsigned int call_id, struct rxrpc_wire_header *whdr,
928 		     enum rxrpc_tx_point where),
929 
930 	    TP_ARGS(call_id, whdr, where),
931 
932 	    TP_STRUCT__entry(
933 		    __field(unsigned int,			call	)
934 		    __field(enum rxrpc_tx_point,		where	)
935 		    __field_struct(struct rxrpc_wire_header,	whdr	)
936 			     ),
937 
938 	    TP_fast_assign(
939 		    __entry->call = call_id;
940 		    memcpy(&__entry->whdr, whdr, sizeof(__entry->whdr));
941 		    __entry->where = where;
942 			   ),
943 
944 	    TP_printk("c=%08x %08x:%08x:%08x:%04x %08x %08x %02x %02x %s %s",
945 		      __entry->call,
946 		      ntohl(__entry->whdr.epoch),
947 		      ntohl(__entry->whdr.cid),
948 		      ntohl(__entry->whdr.callNumber),
949 		      ntohs(__entry->whdr.serviceId),
950 		      ntohl(__entry->whdr.serial),
951 		      ntohl(__entry->whdr.seq),
952 		      __entry->whdr.type, __entry->whdr.flags,
953 		      __entry->whdr.type <= 15 ?
954 		      __print_symbolic(__entry->whdr.type, rxrpc_pkts) : "?UNK",
955 		      __print_symbolic(__entry->where, rxrpc_tx_points))
956 	    );
957 
958 TRACE_EVENT(rxrpc_tx_data,
959 	    TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
960 		     rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
961 
962 	    TP_ARGS(call, seq, serial, flags, retrans, lose),
963 
964 	    TP_STRUCT__entry(
965 		    __field(unsigned int,		call		)
966 		    __field(rxrpc_seq_t,		seq		)
967 		    __field(rxrpc_serial_t,		serial		)
968 		    __field(u32,			cid		)
969 		    __field(u32,			call_id		)
970 		    __field(u8,				flags		)
971 		    __field(bool,			retrans		)
972 		    __field(bool,			lose		)
973 			     ),
974 
975 	    TP_fast_assign(
976 		    __entry->call = call->debug_id;
977 		    __entry->cid = call->cid;
978 		    __entry->call_id = call->call_id;
979 		    __entry->seq = seq;
980 		    __entry->serial = serial;
981 		    __entry->flags = flags;
982 		    __entry->retrans = retrans;
983 		    __entry->lose = lose;
984 			   ),
985 
986 	    TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s%s",
987 		      __entry->call,
988 		      __entry->cid,
989 		      __entry->call_id,
990 		      __entry->serial,
991 		      __entry->seq,
992 		      __entry->flags,
993 		      __entry->retrans ? " *RETRANS*" : "",
994 		      __entry->lose ? " *LOSE*" : "")
995 	    );
996 
997 TRACE_EVENT(rxrpc_tx_ack,
998 	    TP_PROTO(unsigned int call, rxrpc_serial_t serial,
999 		     rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
1000 		     u8 reason, u8 n_acks),
1001 
1002 	    TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
1003 
1004 	    TP_STRUCT__entry(
1005 		    __field(unsigned int,		call		)
1006 		    __field(rxrpc_serial_t,		serial		)
1007 		    __field(rxrpc_seq_t,		ack_first	)
1008 		    __field(rxrpc_serial_t,		ack_serial	)
1009 		    __field(u8,				reason		)
1010 		    __field(u8,				n_acks		)
1011 			     ),
1012 
1013 	    TP_fast_assign(
1014 		    __entry->call = call;
1015 		    __entry->serial = serial;
1016 		    __entry->ack_first = ack_first;
1017 		    __entry->ack_serial = ack_serial;
1018 		    __entry->reason = reason;
1019 		    __entry->n_acks = n_acks;
1020 			   ),
1021 
1022 	    TP_printk(" c=%08x ACK  %08x %s f=%08x r=%08x n=%u",
1023 		      __entry->call,
1024 		      __entry->serial,
1025 		      __print_symbolic(__entry->reason, rxrpc_ack_names),
1026 		      __entry->ack_first,
1027 		      __entry->ack_serial,
1028 		      __entry->n_acks)
1029 	    );
1030 
1031 TRACE_EVENT(rxrpc_receive,
1032 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
1033 		     rxrpc_serial_t serial, rxrpc_seq_t seq),
1034 
1035 	    TP_ARGS(call, why, serial, seq),
1036 
1037 	    TP_STRUCT__entry(
1038 		    __field(unsigned int,		call		)
1039 		    __field(enum rxrpc_receive_trace,	why		)
1040 		    __field(rxrpc_serial_t,		serial		)
1041 		    __field(rxrpc_seq_t,		seq		)
1042 		    __field(rxrpc_seq_t,		hard_ack	)
1043 		    __field(rxrpc_seq_t,		top		)
1044 			     ),
1045 
1046 	    TP_fast_assign(
1047 		    __entry->call = call->debug_id;
1048 		    __entry->why = why;
1049 		    __entry->serial = serial;
1050 		    __entry->seq = seq;
1051 		    __entry->hard_ack = call->rx_hard_ack;
1052 		    __entry->top = call->rx_top;
1053 			   ),
1054 
1055 	    TP_printk("c=%08x %s r=%08x q=%08x w=%08x-%08x",
1056 		      __entry->call,
1057 		      __print_symbolic(__entry->why, rxrpc_receive_traces),
1058 		      __entry->serial,
1059 		      __entry->seq,
1060 		      __entry->hard_ack,
1061 		      __entry->top)
1062 	    );
1063 
1064 TRACE_EVENT(rxrpc_recvmsg,
1065 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
1066 		     rxrpc_seq_t seq, unsigned int offset, unsigned int len,
1067 		     int ret),
1068 
1069 	    TP_ARGS(call, why, seq, offset, len, ret),
1070 
1071 	    TP_STRUCT__entry(
1072 		    __field(unsigned int,		call		)
1073 		    __field(enum rxrpc_recvmsg_trace,	why		)
1074 		    __field(rxrpc_seq_t,		seq		)
1075 		    __field(unsigned int,		offset		)
1076 		    __field(unsigned int,		len		)
1077 		    __field(int,			ret		)
1078 			     ),
1079 
1080 	    TP_fast_assign(
1081 		    __entry->call = call ? call->debug_id : 0;
1082 		    __entry->why = why;
1083 		    __entry->seq = seq;
1084 		    __entry->offset = offset;
1085 		    __entry->len = len;
1086 		    __entry->ret = ret;
1087 			   ),
1088 
1089 	    TP_printk("c=%08x %s q=%08x o=%u l=%u ret=%d",
1090 		      __entry->call,
1091 		      __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
1092 		      __entry->seq,
1093 		      __entry->offset,
1094 		      __entry->len,
1095 		      __entry->ret)
1096 	    );
1097 
1098 TRACE_EVENT(rxrpc_rtt_tx,
1099 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
1100 		     int slot, rxrpc_serial_t send_serial),
1101 
1102 	    TP_ARGS(call, why, slot, send_serial),
1103 
1104 	    TP_STRUCT__entry(
1105 		    __field(unsigned int,		call		)
1106 		    __field(enum rxrpc_rtt_tx_trace,	why		)
1107 		    __field(int,			slot		)
1108 		    __field(rxrpc_serial_t,		send_serial	)
1109 			     ),
1110 
1111 	    TP_fast_assign(
1112 		    __entry->call = call->debug_id;
1113 		    __entry->why = why;
1114 		    __entry->slot = slot;
1115 		    __entry->send_serial = send_serial;
1116 			   ),
1117 
1118 	    TP_printk("c=%08x [%d] %s sr=%08x",
1119 		      __entry->call,
1120 		      __entry->slot,
1121 		      __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
1122 		      __entry->send_serial)
1123 	    );
1124 
1125 TRACE_EVENT(rxrpc_rtt_rx,
1126 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
1127 		     int slot,
1128 		     rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
1129 		     u32 rtt, u32 rto),
1130 
1131 	    TP_ARGS(call, why, slot, send_serial, resp_serial, rtt, rto),
1132 
1133 	    TP_STRUCT__entry(
1134 		    __field(unsigned int,		call		)
1135 		    __field(enum rxrpc_rtt_rx_trace,	why		)
1136 		    __field(int,			slot		)
1137 		    __field(rxrpc_serial_t,		send_serial	)
1138 		    __field(rxrpc_serial_t,		resp_serial	)
1139 		    __field(u32,			rtt		)
1140 		    __field(u32,			rto		)
1141 			     ),
1142 
1143 	    TP_fast_assign(
1144 		    __entry->call = call->debug_id;
1145 		    __entry->why = why;
1146 		    __entry->slot = slot;
1147 		    __entry->send_serial = send_serial;
1148 		    __entry->resp_serial = resp_serial;
1149 		    __entry->rtt = rtt;
1150 		    __entry->rto = rto;
1151 			   ),
1152 
1153 	    TP_printk("c=%08x [%d] %s sr=%08x rr=%08x rtt=%u rto=%u",
1154 		      __entry->call,
1155 		      __entry->slot,
1156 		      __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
1157 		      __entry->send_serial,
1158 		      __entry->resp_serial,
1159 		      __entry->rtt,
1160 		      __entry->rto)
1161 	    );
1162 
1163 TRACE_EVENT(rxrpc_timer,
1164 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
1165 		     unsigned long now),
1166 
1167 	    TP_ARGS(call, why, now),
1168 
1169 	    TP_STRUCT__entry(
1170 		    __field(unsigned int,			call		)
1171 		    __field(enum rxrpc_timer_trace,		why		)
1172 		    __field(long,				now		)
1173 		    __field(long,				ack_at		)
1174 		    __field(long,				ack_lost_at	)
1175 		    __field(long,				resend_at	)
1176 		    __field(long,				ping_at		)
1177 		    __field(long,				expect_rx_by	)
1178 		    __field(long,				expect_req_by	)
1179 		    __field(long,				expect_term_by	)
1180 		    __field(long,				timer		)
1181 			     ),
1182 
1183 	    TP_fast_assign(
1184 		    __entry->call		= call->debug_id;
1185 		    __entry->why		= why;
1186 		    __entry->now		= now;
1187 		    __entry->ack_at		= call->ack_at;
1188 		    __entry->ack_lost_at	= call->ack_lost_at;
1189 		    __entry->resend_at		= call->resend_at;
1190 		    __entry->expect_rx_by	= call->expect_rx_by;
1191 		    __entry->expect_req_by	= call->expect_req_by;
1192 		    __entry->expect_term_by	= call->expect_term_by;
1193 		    __entry->timer		= call->timer.expires;
1194 			   ),
1195 
1196 	    TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
1197 		      __entry->call,
1198 		      __print_symbolic(__entry->why, rxrpc_timer_traces),
1199 		      __entry->ack_at - __entry->now,
1200 		      __entry->ack_lost_at - __entry->now,
1201 		      __entry->resend_at - __entry->now,
1202 		      __entry->expect_rx_by - __entry->now,
1203 		      __entry->expect_req_by - __entry->now,
1204 		      __entry->expect_term_by - __entry->now,
1205 		      __entry->timer - __entry->now)
1206 	    );
1207 
1208 TRACE_EVENT(rxrpc_rx_lose,
1209 	    TP_PROTO(struct rxrpc_skb_priv *sp),
1210 
1211 	    TP_ARGS(sp),
1212 
1213 	    TP_STRUCT__entry(
1214 		    __field_struct(struct rxrpc_host_header,	hdr		)
1215 			     ),
1216 
1217 	    TP_fast_assign(
1218 		    memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
1219 			   ),
1220 
1221 	    TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
1222 		      __entry->hdr.epoch, __entry->hdr.cid,
1223 		      __entry->hdr.callNumber, __entry->hdr.serviceId,
1224 		      __entry->hdr.serial, __entry->hdr.seq,
1225 		      __entry->hdr.type, __entry->hdr.flags,
1226 		      __entry->hdr.type <= 15 ?
1227 		      __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
1228 	    );
1229 
1230 TRACE_EVENT(rxrpc_propose_ack,
1231 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1232 		     u8 ack_reason, rxrpc_serial_t serial, bool immediate,
1233 		     bool background, enum rxrpc_propose_ack_outcome outcome),
1234 
1235 	    TP_ARGS(call, why, ack_reason, serial, immediate, background,
1236 		    outcome),
1237 
1238 	    TP_STRUCT__entry(
1239 		    __field(unsigned int,			call		)
1240 		    __field(enum rxrpc_propose_ack_trace,	why		)
1241 		    __field(rxrpc_serial_t,			serial		)
1242 		    __field(u8,					ack_reason	)
1243 		    __field(bool,				immediate	)
1244 		    __field(bool,				background	)
1245 		    __field(enum rxrpc_propose_ack_outcome,	outcome		)
1246 			     ),
1247 
1248 	    TP_fast_assign(
1249 		    __entry->call	= call->debug_id;
1250 		    __entry->why	= why;
1251 		    __entry->serial	= serial;
1252 		    __entry->ack_reason	= ack_reason;
1253 		    __entry->immediate	= immediate;
1254 		    __entry->background	= background;
1255 		    __entry->outcome	= outcome;
1256 			   ),
1257 
1258 	    TP_printk("c=%08x %s %s r=%08x i=%u b=%u%s",
1259 		      __entry->call,
1260 		      __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1261 		      __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
1262 		      __entry->serial,
1263 		      __entry->immediate,
1264 		      __entry->background,
1265 		      __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
1266 	    );
1267 
1268 TRACE_EVENT(rxrpc_retransmit,
1269 	    TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
1270 		     s64 expiry),
1271 
1272 	    TP_ARGS(call, seq, annotation, expiry),
1273 
1274 	    TP_STRUCT__entry(
1275 		    __field(unsigned int,		call		)
1276 		    __field(rxrpc_seq_t,		seq		)
1277 		    __field(u8,				annotation	)
1278 		    __field(s64,			expiry		)
1279 			     ),
1280 
1281 	    TP_fast_assign(
1282 		    __entry->call = call->debug_id;
1283 		    __entry->seq = seq;
1284 		    __entry->annotation = annotation;
1285 		    __entry->expiry = expiry;
1286 			   ),
1287 
1288 	    TP_printk("c=%08x q=%x a=%02x xp=%lld",
1289 		      __entry->call,
1290 		      __entry->seq,
1291 		      __entry->annotation,
1292 		      __entry->expiry)
1293 	    );
1294 
1295 TRACE_EVENT(rxrpc_congest,
1296 	    TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
1297 		     rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
1298 
1299 	    TP_ARGS(call, summary, ack_serial, change),
1300 
1301 	    TP_STRUCT__entry(
1302 		    __field(unsigned int,			call		)
1303 		    __field(enum rxrpc_congest_change,		change		)
1304 		    __field(rxrpc_seq_t,			hard_ack	)
1305 		    __field(rxrpc_seq_t,			top		)
1306 		    __field(rxrpc_seq_t,			lowest_nak	)
1307 		    __field(rxrpc_serial_t,			ack_serial	)
1308 		    __field_struct(struct rxrpc_ack_summary,	sum		)
1309 			     ),
1310 
1311 	    TP_fast_assign(
1312 		    __entry->call	= call->debug_id;
1313 		    __entry->change	= change;
1314 		    __entry->hard_ack	= call->tx_hard_ack;
1315 		    __entry->top	= call->tx_top;
1316 		    __entry->lowest_nak	= call->acks_lowest_nak;
1317 		    __entry->ack_serial	= ack_serial;
1318 		    memcpy(&__entry->sum, summary, sizeof(__entry->sum));
1319 			   ),
1320 
1321 	    TP_printk("c=%08x r=%08x %s q=%08x %s cw=%u ss=%u nr=%u,%u nw=%u,%u r=%u b=%u u=%u d=%u l=%x%s%s%s",
1322 		      __entry->call,
1323 		      __entry->ack_serial,
1324 		      __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
1325 		      __entry->hard_ack,
1326 		      __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
1327 		      __entry->sum.cwnd,
1328 		      __entry->sum.ssthresh,
1329 		      __entry->sum.nr_acks, __entry->sum.nr_nacks,
1330 		      __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
1331 		      __entry->sum.nr_rot_new_acks,
1332 		      __entry->top - __entry->hard_ack,
1333 		      __entry->sum.cumulative_acks,
1334 		      __entry->sum.dup_acks,
1335 		      __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
1336 		      __print_symbolic(__entry->change, rxrpc_congest_changes),
1337 		      __entry->sum.retrans_timeo ? " rTxTo" : "")
1338 	    );
1339 
1340 TRACE_EVENT(rxrpc_disconnect_call,
1341 	    TP_PROTO(struct rxrpc_call *call),
1342 
1343 	    TP_ARGS(call),
1344 
1345 	    TP_STRUCT__entry(
1346 		    __field(unsigned int,		call		)
1347 		    __field(u32,			abort_code	)
1348 			     ),
1349 
1350 	    TP_fast_assign(
1351 		    __entry->call = call->debug_id;
1352 		    __entry->abort_code = call->abort_code;
1353 			   ),
1354 
1355 	    TP_printk("c=%08x ab=%08x",
1356 		      __entry->call,
1357 		      __entry->abort_code)
1358 	    );
1359 
1360 TRACE_EVENT(rxrpc_improper_term,
1361 	    TP_PROTO(struct rxrpc_call *call),
1362 
1363 	    TP_ARGS(call),
1364 
1365 	    TP_STRUCT__entry(
1366 		    __field(unsigned int,		call		)
1367 		    __field(u32,			abort_code	)
1368 			     ),
1369 
1370 	    TP_fast_assign(
1371 		    __entry->call = call->debug_id;
1372 		    __entry->abort_code = call->abort_code;
1373 			   ),
1374 
1375 	    TP_printk("c=%08x ab=%08x",
1376 		      __entry->call,
1377 		      __entry->abort_code)
1378 	    );
1379 
1380 TRACE_EVENT(rxrpc_rx_eproto,
1381 	    TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
1382 		     const char *why),
1383 
1384 	    TP_ARGS(call, serial, why),
1385 
1386 	    TP_STRUCT__entry(
1387 		    __field(unsigned int,		call		)
1388 		    __field(rxrpc_serial_t,		serial		)
1389 		    __field(const char *,		why		)
1390 			     ),
1391 
1392 	    TP_fast_assign(
1393 		    __entry->call = call ? call->debug_id : 0;
1394 		    __entry->serial = serial;
1395 		    __entry->why = why;
1396 			   ),
1397 
1398 	    TP_printk("c=%08x EPROTO %08x %s",
1399 		      __entry->call,
1400 		      __entry->serial,
1401 		      __entry->why)
1402 	    );
1403 
1404 TRACE_EVENT(rxrpc_connect_call,
1405 	    TP_PROTO(struct rxrpc_call *call),
1406 
1407 	    TP_ARGS(call),
1408 
1409 	    TP_STRUCT__entry(
1410 		    __field(unsigned int,		call		)
1411 		    __field(unsigned long,		user_call_ID	)
1412 		    __field(u32,			cid		)
1413 		    __field(u32,			call_id		)
1414 			     ),
1415 
1416 	    TP_fast_assign(
1417 		    __entry->call = call->debug_id;
1418 		    __entry->user_call_ID = call->user_call_ID;
1419 		    __entry->cid = call->cid;
1420 		    __entry->call_id = call->call_id;
1421 			   ),
1422 
1423 	    TP_printk("c=%08x u=%p %08x:%08x",
1424 		      __entry->call,
1425 		      (void *)__entry->user_call_ID,
1426 		      __entry->cid,
1427 		      __entry->call_id)
1428 	    );
1429 
1430 TRACE_EVENT(rxrpc_resend,
1431 	    TP_PROTO(struct rxrpc_call *call, int ix),
1432 
1433 	    TP_ARGS(call, ix),
1434 
1435 	    TP_STRUCT__entry(
1436 		    __field(unsigned int,		call		)
1437 		    __field(int,			ix		)
1438 		    __array(u8,				anno, 64	)
1439 			     ),
1440 
1441 	    TP_fast_assign(
1442 		    __entry->call = call->debug_id;
1443 		    __entry->ix = ix;
1444 		    memcpy(__entry->anno, call->rxtx_annotations, 64);
1445 			   ),
1446 
1447 	    TP_printk("c=%08x ix=%u a=%64phN",
1448 		      __entry->call,
1449 		      __entry->ix,
1450 		      __entry->anno)
1451 	    );
1452 
1453 TRACE_EVENT(rxrpc_rx_icmp,
1454 	    TP_PROTO(struct rxrpc_peer *peer, struct sock_extended_err *ee,
1455 		     struct sockaddr_rxrpc *srx),
1456 
1457 	    TP_ARGS(peer, ee, srx),
1458 
1459 	    TP_STRUCT__entry(
1460 		    __field(unsigned int,			peer	)
1461 		    __field_struct(struct sock_extended_err,	ee	)
1462 		    __field_struct(struct sockaddr_rxrpc,	srx	)
1463 			     ),
1464 
1465 	    TP_fast_assign(
1466 		    __entry->peer = peer->debug_id;
1467 		    memcpy(&__entry->ee, ee, sizeof(__entry->ee));
1468 		    memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1469 			   ),
1470 
1471 	    TP_printk("P=%08x o=%u t=%u c=%u i=%u d=%u e=%d %pISp",
1472 		      __entry->peer,
1473 		      __entry->ee.ee_origin,
1474 		      __entry->ee.ee_type,
1475 		      __entry->ee.ee_code,
1476 		      __entry->ee.ee_info,
1477 		      __entry->ee.ee_data,
1478 		      __entry->ee.ee_errno,
1479 		      &__entry->srx.transport)
1480 	    );
1481 
1482 TRACE_EVENT(rxrpc_tx_fail,
1483 	    TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret,
1484 		     enum rxrpc_tx_point where),
1485 
1486 	    TP_ARGS(debug_id, serial, ret, where),
1487 
1488 	    TP_STRUCT__entry(
1489 		    __field(unsigned int,		debug_id	)
1490 		    __field(rxrpc_serial_t,		serial		)
1491 		    __field(int,			ret		)
1492 		    __field(enum rxrpc_tx_point,	where		)
1493 			     ),
1494 
1495 	    TP_fast_assign(
1496 		    __entry->debug_id = debug_id;
1497 		    __entry->serial = serial;
1498 		    __entry->ret = ret;
1499 		    __entry->where = where;
1500 			   ),
1501 
1502 	    TP_printk("c=%08x r=%x ret=%d %s",
1503 		      __entry->debug_id,
1504 		      __entry->serial,
1505 		      __entry->ret,
1506 		      __print_symbolic(__entry->where, rxrpc_tx_points))
1507 	    );
1508 
1509 TRACE_EVENT(rxrpc_call_reset,
1510 	    TP_PROTO(struct rxrpc_call *call),
1511 
1512 	    TP_ARGS(call),
1513 
1514 	    TP_STRUCT__entry(
1515 		    __field(unsigned int,		debug_id	)
1516 		    __field(u32,			cid		)
1517 		    __field(u32,			call_id		)
1518 		    __field(rxrpc_serial_t,		call_serial	)
1519 		    __field(rxrpc_serial_t,		conn_serial	)
1520 		    __field(rxrpc_seq_t,		tx_seq		)
1521 		    __field(rxrpc_seq_t,		rx_seq		)
1522 			     ),
1523 
1524 	    TP_fast_assign(
1525 		    __entry->debug_id = call->debug_id;
1526 		    __entry->cid = call->cid;
1527 		    __entry->call_id = call->call_id;
1528 		    __entry->call_serial = call->rx_serial;
1529 		    __entry->conn_serial = call->conn->hi_serial;
1530 		    __entry->tx_seq = call->tx_hard_ack;
1531 		    __entry->rx_seq = call->ackr_seen;
1532 			   ),
1533 
1534 	    TP_printk("c=%08x %08x:%08x r=%08x/%08x tx=%08x rx=%08x",
1535 		      __entry->debug_id,
1536 		      __entry->cid, __entry->call_id,
1537 		      __entry->call_serial, __entry->conn_serial,
1538 		      __entry->tx_seq, __entry->rx_seq)
1539 	    );
1540 
1541 TRACE_EVENT(rxrpc_notify_socket,
1542 	    TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial),
1543 
1544 	    TP_ARGS(debug_id, serial),
1545 
1546 	    TP_STRUCT__entry(
1547 		    __field(unsigned int,		debug_id	)
1548 		    __field(rxrpc_serial_t,		serial		)
1549 			     ),
1550 
1551 	    TP_fast_assign(
1552 		    __entry->debug_id = debug_id;
1553 		    __entry->serial = serial;
1554 			   ),
1555 
1556 	    TP_printk("c=%08x r=%08x",
1557 		      __entry->debug_id,
1558 		      __entry->serial)
1559 	    );
1560 
1561 TRACE_EVENT(rxrpc_rx_discard_ack,
1562 	    TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial,
1563 		     rxrpc_seq_t first_soft_ack, rxrpc_seq_t call_ackr_first,
1564 		     rxrpc_seq_t prev_pkt, rxrpc_seq_t call_ackr_prev),
1565 
1566 	    TP_ARGS(debug_id, serial, first_soft_ack, call_ackr_first,
1567 		    prev_pkt, call_ackr_prev),
1568 
1569 	    TP_STRUCT__entry(
1570 		    __field(unsigned int,	debug_id	)
1571 		    __field(rxrpc_serial_t,	serial		)
1572 		    __field(rxrpc_seq_t,	first_soft_ack)
1573 		    __field(rxrpc_seq_t,	call_ackr_first)
1574 		    __field(rxrpc_seq_t,	prev_pkt)
1575 		    __field(rxrpc_seq_t,	call_ackr_prev)
1576 			     ),
1577 
1578 	    TP_fast_assign(
1579 		    __entry->debug_id		= debug_id;
1580 		    __entry->serial		= serial;
1581 		    __entry->first_soft_ack	= first_soft_ack;
1582 		    __entry->call_ackr_first	= call_ackr_first;
1583 		    __entry->prev_pkt		= prev_pkt;
1584 		    __entry->call_ackr_prev	= call_ackr_prev;
1585 			   ),
1586 
1587 	    TP_printk("c=%08x r=%08x %08x<%08x %08x<%08x",
1588 		      __entry->debug_id,
1589 		      __entry->serial,
1590 		      __entry->first_soft_ack,
1591 		      __entry->call_ackr_first,
1592 		      __entry->prev_pkt,
1593 		      __entry->call_ackr_prev)
1594 	    );
1595 
1596 #endif /* _TRACE_RXRPC_H */
1597 
1598 /* This part must be outside protection */
1599 #include <trace/define_trace.h>
1600