xref: /openbmc/linux/include/trace/events/rxrpc.h (revision 61c67bfa)
1 /* AF_RXRPC tracepoints
2  *
3  * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
4  * Written by David Howells (dhowells@redhat.com)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public Licence
8  * as published by the Free Software Foundation; either version
9  * 2 of the Licence, or (at your option) any later version.
10  */
11 #undef TRACE_SYSTEM
12 #define TRACE_SYSTEM rxrpc
13 
14 #if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ)
15 #define _TRACE_RXRPC_H
16 
17 #include <linux/tracepoint.h>
18 #include <linux/errqueue.h>
19 
20 /*
21  * Define enums for tracing information.
22  *
23  * These should all be kept sorted, making it easier to match the string
24  * mapping tables further on.
25  */
26 #ifndef __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
27 #define __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
28 
29 enum rxrpc_skb_trace {
30 	rxrpc_skb_rx_cleaned,
31 	rxrpc_skb_rx_freed,
32 	rxrpc_skb_rx_got,
33 	rxrpc_skb_rx_lost,
34 	rxrpc_skb_rx_purged,
35 	rxrpc_skb_rx_received,
36 	rxrpc_skb_rx_rotated,
37 	rxrpc_skb_rx_seen,
38 	rxrpc_skb_tx_cleaned,
39 	rxrpc_skb_tx_freed,
40 	rxrpc_skb_tx_got,
41 	rxrpc_skb_tx_new,
42 	rxrpc_skb_tx_rotated,
43 	rxrpc_skb_tx_seen,
44 };
45 
46 enum rxrpc_local_trace {
47 	rxrpc_local_got,
48 	rxrpc_local_new,
49 	rxrpc_local_processing,
50 	rxrpc_local_put,
51 	rxrpc_local_queued,
52 };
53 
54 enum rxrpc_peer_trace {
55 	rxrpc_peer_got,
56 	rxrpc_peer_new,
57 	rxrpc_peer_processing,
58 	rxrpc_peer_put,
59 };
60 
61 enum rxrpc_conn_trace {
62 	rxrpc_conn_got,
63 	rxrpc_conn_new_client,
64 	rxrpc_conn_new_service,
65 	rxrpc_conn_put_client,
66 	rxrpc_conn_put_service,
67 	rxrpc_conn_queued,
68 	rxrpc_conn_reap_service,
69 	rxrpc_conn_seen,
70 };
71 
72 enum rxrpc_client_trace {
73 	rxrpc_client_activate_chans,
74 	rxrpc_client_alloc,
75 	rxrpc_client_chan_activate,
76 	rxrpc_client_chan_disconnect,
77 	rxrpc_client_chan_pass,
78 	rxrpc_client_chan_unstarted,
79 	rxrpc_client_chan_wait_failed,
80 	rxrpc_client_cleanup,
81 	rxrpc_client_count,
82 	rxrpc_client_discard,
83 	rxrpc_client_duplicate,
84 	rxrpc_client_exposed,
85 	rxrpc_client_replace,
86 	rxrpc_client_to_active,
87 	rxrpc_client_to_culled,
88 	rxrpc_client_to_idle,
89 	rxrpc_client_to_inactive,
90 	rxrpc_client_to_upgrade,
91 	rxrpc_client_to_waiting,
92 	rxrpc_client_uncount,
93 };
94 
95 enum rxrpc_call_trace {
96 	rxrpc_call_connected,
97 	rxrpc_call_error,
98 	rxrpc_call_got,
99 	rxrpc_call_got_kernel,
100 	rxrpc_call_got_userid,
101 	rxrpc_call_new_client,
102 	rxrpc_call_new_service,
103 	rxrpc_call_put,
104 	rxrpc_call_put_kernel,
105 	rxrpc_call_put_noqueue,
106 	rxrpc_call_put_userid,
107 	rxrpc_call_queued,
108 	rxrpc_call_queued_ref,
109 	rxrpc_call_release,
110 	rxrpc_call_seen,
111 };
112 
113 enum rxrpc_transmit_trace {
114 	rxrpc_transmit_await_reply,
115 	rxrpc_transmit_end,
116 	rxrpc_transmit_queue,
117 	rxrpc_transmit_queue_last,
118 	rxrpc_transmit_rotate,
119 	rxrpc_transmit_rotate_last,
120 	rxrpc_transmit_wait,
121 };
122 
123 enum rxrpc_receive_trace {
124 	rxrpc_receive_end,
125 	rxrpc_receive_front,
126 	rxrpc_receive_incoming,
127 	rxrpc_receive_queue,
128 	rxrpc_receive_queue_last,
129 	rxrpc_receive_rotate,
130 };
131 
132 enum rxrpc_recvmsg_trace {
133 	rxrpc_recvmsg_cont,
134 	rxrpc_recvmsg_data_return,
135 	rxrpc_recvmsg_dequeue,
136 	rxrpc_recvmsg_enter,
137 	rxrpc_recvmsg_full,
138 	rxrpc_recvmsg_hole,
139 	rxrpc_recvmsg_next,
140 	rxrpc_recvmsg_requeue,
141 	rxrpc_recvmsg_return,
142 	rxrpc_recvmsg_terminal,
143 	rxrpc_recvmsg_to_be_accepted,
144 	rxrpc_recvmsg_wait,
145 };
146 
147 enum rxrpc_rtt_tx_trace {
148 	rxrpc_rtt_tx_data,
149 	rxrpc_rtt_tx_ping,
150 };
151 
152 enum rxrpc_rtt_rx_trace {
153 	rxrpc_rtt_rx_ping_response,
154 	rxrpc_rtt_rx_requested_ack,
155 };
156 
157 enum rxrpc_timer_trace {
158 	rxrpc_timer_begin,
159 	rxrpc_timer_exp_ack,
160 	rxrpc_timer_exp_hard,
161 	rxrpc_timer_exp_idle,
162 	rxrpc_timer_exp_keepalive,
163 	rxrpc_timer_exp_lost_ack,
164 	rxrpc_timer_exp_normal,
165 	rxrpc_timer_exp_ping,
166 	rxrpc_timer_exp_resend,
167 	rxrpc_timer_expired,
168 	rxrpc_timer_init_for_reply,
169 	rxrpc_timer_init_for_send_reply,
170 	rxrpc_timer_restart,
171 	rxrpc_timer_set_for_ack,
172 	rxrpc_timer_set_for_hard,
173 	rxrpc_timer_set_for_idle,
174 	rxrpc_timer_set_for_keepalive,
175 	rxrpc_timer_set_for_lost_ack,
176 	rxrpc_timer_set_for_normal,
177 	rxrpc_timer_set_for_ping,
178 	rxrpc_timer_set_for_resend,
179 	rxrpc_timer_set_for_send,
180 };
181 
182 enum rxrpc_propose_ack_trace {
183 	rxrpc_propose_ack_client_tx_end,
184 	rxrpc_propose_ack_input_data,
185 	rxrpc_propose_ack_ping_for_check_life,
186 	rxrpc_propose_ack_ping_for_keepalive,
187 	rxrpc_propose_ack_ping_for_lost_ack,
188 	rxrpc_propose_ack_ping_for_lost_reply,
189 	rxrpc_propose_ack_ping_for_params,
190 	rxrpc_propose_ack_processing_op,
191 	rxrpc_propose_ack_respond_to_ack,
192 	rxrpc_propose_ack_respond_to_ping,
193 	rxrpc_propose_ack_retry_tx,
194 	rxrpc_propose_ack_rotate_rx,
195 	rxrpc_propose_ack_terminal_ack,
196 };
197 
198 enum rxrpc_propose_ack_outcome {
199 	rxrpc_propose_ack_subsume,
200 	rxrpc_propose_ack_update,
201 	rxrpc_propose_ack_use,
202 };
203 
204 enum rxrpc_congest_change {
205 	rxrpc_cong_begin_retransmission,
206 	rxrpc_cong_cleared_nacks,
207 	rxrpc_cong_new_low_nack,
208 	rxrpc_cong_no_change,
209 	rxrpc_cong_progress,
210 	rxrpc_cong_retransmit_again,
211 	rxrpc_cong_rtt_window_end,
212 	rxrpc_cong_saw_nack,
213 };
214 
215 enum rxrpc_tx_point {
216 	rxrpc_tx_point_call_abort,
217 	rxrpc_tx_point_call_ack,
218 	rxrpc_tx_point_call_data_frag,
219 	rxrpc_tx_point_call_data_nofrag,
220 	rxrpc_tx_point_call_final_resend,
221 	rxrpc_tx_point_conn_abort,
222 	rxrpc_tx_point_rxkad_challenge,
223 	rxrpc_tx_point_rxkad_response,
224 	rxrpc_tx_point_reject,
225 	rxrpc_tx_point_version_keepalive,
226 	rxrpc_tx_point_version_reply,
227 };
228 
229 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
230 
231 /*
232  * Declare tracing information enums and their string mappings for display.
233  */
234 #define rxrpc_skb_traces \
235 	EM(rxrpc_skb_rx_cleaned,		"Rx CLN") \
236 	EM(rxrpc_skb_rx_freed,			"Rx FRE") \
237 	EM(rxrpc_skb_rx_got,			"Rx GOT") \
238 	EM(rxrpc_skb_rx_lost,			"Rx *L*") \
239 	EM(rxrpc_skb_rx_purged,			"Rx PUR") \
240 	EM(rxrpc_skb_rx_received,		"Rx RCV") \
241 	EM(rxrpc_skb_rx_rotated,		"Rx ROT") \
242 	EM(rxrpc_skb_rx_seen,			"Rx SEE") \
243 	EM(rxrpc_skb_tx_cleaned,		"Tx CLN") \
244 	EM(rxrpc_skb_tx_freed,			"Tx FRE") \
245 	EM(rxrpc_skb_tx_got,			"Tx GOT") \
246 	EM(rxrpc_skb_tx_new,			"Tx NEW") \
247 	EM(rxrpc_skb_tx_rotated,		"Tx ROT") \
248 	E_(rxrpc_skb_tx_seen,			"Tx SEE")
249 
250 #define rxrpc_local_traces \
251 	EM(rxrpc_local_got,			"GOT") \
252 	EM(rxrpc_local_new,			"NEW") \
253 	EM(rxrpc_local_processing,		"PRO") \
254 	EM(rxrpc_local_put,			"PUT") \
255 	E_(rxrpc_local_queued,			"QUE")
256 
257 #define rxrpc_peer_traces \
258 	EM(rxrpc_peer_got,			"GOT") \
259 	EM(rxrpc_peer_new,			"NEW") \
260 	EM(rxrpc_peer_processing,		"PRO") \
261 	E_(rxrpc_peer_put,			"PUT")
262 
263 #define rxrpc_conn_traces \
264 	EM(rxrpc_conn_got,			"GOT") \
265 	EM(rxrpc_conn_new_client,		"NWc") \
266 	EM(rxrpc_conn_new_service,		"NWs") \
267 	EM(rxrpc_conn_put_client,		"PTc") \
268 	EM(rxrpc_conn_put_service,		"PTs") \
269 	EM(rxrpc_conn_queued,			"QUE") \
270 	EM(rxrpc_conn_reap_service,		"RPs") \
271 	E_(rxrpc_conn_seen,			"SEE")
272 
273 #define rxrpc_client_traces \
274 	EM(rxrpc_client_activate_chans,		"Activa") \
275 	EM(rxrpc_client_alloc,			"Alloc ") \
276 	EM(rxrpc_client_chan_activate,		"ChActv") \
277 	EM(rxrpc_client_chan_disconnect,	"ChDisc") \
278 	EM(rxrpc_client_chan_pass,		"ChPass") \
279 	EM(rxrpc_client_chan_unstarted,		"ChUnst") \
280 	EM(rxrpc_client_chan_wait_failed,	"ChWtFl") \
281 	EM(rxrpc_client_cleanup,		"Clean ") \
282 	EM(rxrpc_client_count,			"Count ") \
283 	EM(rxrpc_client_discard,		"Discar") \
284 	EM(rxrpc_client_duplicate,		"Duplic") \
285 	EM(rxrpc_client_exposed,		"Expose") \
286 	EM(rxrpc_client_replace,		"Replac") \
287 	EM(rxrpc_client_to_active,		"->Actv") \
288 	EM(rxrpc_client_to_culled,		"->Cull") \
289 	EM(rxrpc_client_to_idle,		"->Idle") \
290 	EM(rxrpc_client_to_inactive,		"->Inac") \
291 	EM(rxrpc_client_to_upgrade,		"->Upgd") \
292 	EM(rxrpc_client_to_waiting,		"->Wait") \
293 	E_(rxrpc_client_uncount,		"Uncoun")
294 
295 #define rxrpc_conn_cache_states \
296 	EM(RXRPC_CONN_CLIENT_INACTIVE,		"Inac") \
297 	EM(RXRPC_CONN_CLIENT_WAITING,		"Wait") \
298 	EM(RXRPC_CONN_CLIENT_ACTIVE,		"Actv") \
299 	EM(RXRPC_CONN_CLIENT_UPGRADE,		"Upgd") \
300 	EM(RXRPC_CONN_CLIENT_CULLED,		"Cull") \
301 	E_(RXRPC_CONN_CLIENT_IDLE,		"Idle") \
302 
303 #define rxrpc_call_traces \
304 	EM(rxrpc_call_connected,		"CON") \
305 	EM(rxrpc_call_error,			"*E*") \
306 	EM(rxrpc_call_got,			"GOT") \
307 	EM(rxrpc_call_got_kernel,		"Gke") \
308 	EM(rxrpc_call_got_userid,		"Gus") \
309 	EM(rxrpc_call_new_client,		"NWc") \
310 	EM(rxrpc_call_new_service,		"NWs") \
311 	EM(rxrpc_call_put,			"PUT") \
312 	EM(rxrpc_call_put_kernel,		"Pke") \
313 	EM(rxrpc_call_put_noqueue,		"PNQ") \
314 	EM(rxrpc_call_put_userid,		"Pus") \
315 	EM(rxrpc_call_queued,			"QUE") \
316 	EM(rxrpc_call_queued_ref,		"QUR") \
317 	EM(rxrpc_call_release,			"RLS") \
318 	E_(rxrpc_call_seen,			"SEE")
319 
320 #define rxrpc_transmit_traces \
321 	EM(rxrpc_transmit_await_reply,		"AWR") \
322 	EM(rxrpc_transmit_end,			"END") \
323 	EM(rxrpc_transmit_queue,		"QUE") \
324 	EM(rxrpc_transmit_queue_last,		"QLS") \
325 	EM(rxrpc_transmit_rotate,		"ROT") \
326 	EM(rxrpc_transmit_rotate_last,		"RLS") \
327 	E_(rxrpc_transmit_wait,			"WAI")
328 
329 #define rxrpc_receive_traces \
330 	EM(rxrpc_receive_end,			"END") \
331 	EM(rxrpc_receive_front,			"FRN") \
332 	EM(rxrpc_receive_incoming,		"INC") \
333 	EM(rxrpc_receive_queue,			"QUE") \
334 	EM(rxrpc_receive_queue_last,		"QLS") \
335 	E_(rxrpc_receive_rotate,		"ROT")
336 
337 #define rxrpc_recvmsg_traces \
338 	EM(rxrpc_recvmsg_cont,			"CONT") \
339 	EM(rxrpc_recvmsg_data_return,		"DATA") \
340 	EM(rxrpc_recvmsg_dequeue,		"DEQU") \
341 	EM(rxrpc_recvmsg_enter,			"ENTR") \
342 	EM(rxrpc_recvmsg_full,			"FULL") \
343 	EM(rxrpc_recvmsg_hole,			"HOLE") \
344 	EM(rxrpc_recvmsg_next,			"NEXT") \
345 	EM(rxrpc_recvmsg_requeue,		"REQU") \
346 	EM(rxrpc_recvmsg_return,		"RETN") \
347 	EM(rxrpc_recvmsg_terminal,		"TERM") \
348 	EM(rxrpc_recvmsg_to_be_accepted,	"TBAC") \
349 	E_(rxrpc_recvmsg_wait,			"WAIT")
350 
351 #define rxrpc_rtt_tx_traces \
352 	EM(rxrpc_rtt_tx_data,			"DATA") \
353 	E_(rxrpc_rtt_tx_ping,			"PING")
354 
355 #define rxrpc_rtt_rx_traces \
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(struct rxrpc_local *local, enum rxrpc_local_trace op,
506 		     int usage, const void *where),
507 
508 	    TP_ARGS(local, 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(struct rxrpc_peer *peer, enum rxrpc_peer_trace op,
533 		     int usage, const void *where),
534 
535 	    TP_ARGS(peer, 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(struct rxrpc_connection *conn, enum rxrpc_conn_trace op,
560 		     int usage, const void *where),
561 
562 	    TP_ARGS(conn, 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(struct rxrpc_call *call, enum rxrpc_call_trace op,
620 		     int usage, const void *where, const void *aux),
621 
622 	    TP_ARGS(call, 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, const void *where),
651 
652 	    TP_ARGS(skb, op, usage, mod_count, where),
653 
654 	    TP_STRUCT__entry(
655 		    __field(struct sk_buff *,		skb		)
656 		    __field(enum rxrpc_skb_trace,	op		)
657 		    __field(int,			usage		)
658 		    __field(int,			mod_count	)
659 		    __field(const void *,		where		)
660 			     ),
661 
662 	    TP_fast_assign(
663 		    __entry->skb = skb;
664 		    __entry->op = op;
665 		    __entry->usage = usage;
666 		    __entry->mod_count = mod_count;
667 		    __entry->where = where;
668 			   ),
669 
670 	    TP_printk("s=%p %s u=%d m=%d p=%pSR",
671 		      __entry->skb,
672 		      __print_symbolic(__entry->op, rxrpc_skb_traces),
673 		      __entry->usage,
674 		      __entry->mod_count,
675 		      __entry->where)
676 	    );
677 
678 TRACE_EVENT(rxrpc_rx_packet,
679 	    TP_PROTO(struct rxrpc_skb_priv *sp),
680 
681 	    TP_ARGS(sp),
682 
683 	    TP_STRUCT__entry(
684 		    __field_struct(struct rxrpc_host_header,	hdr		)
685 			     ),
686 
687 	    TP_fast_assign(
688 		    memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
689 			   ),
690 
691 	    TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
692 		      __entry->hdr.epoch, __entry->hdr.cid,
693 		      __entry->hdr.callNumber, __entry->hdr.serviceId,
694 		      __entry->hdr.serial, __entry->hdr.seq,
695 		      __entry->hdr.type, __entry->hdr.flags,
696 		      __entry->hdr.type <= 15 ?
697 		      __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
698 	    );
699 
700 TRACE_EVENT(rxrpc_rx_done,
701 	    TP_PROTO(int result, int abort_code),
702 
703 	    TP_ARGS(result, abort_code),
704 
705 	    TP_STRUCT__entry(
706 		    __field(int,			result		)
707 		    __field(int,			abort_code	)
708 			     ),
709 
710 	    TP_fast_assign(
711 		    __entry->result = result;
712 		    __entry->abort_code = abort_code;
713 			   ),
714 
715 	    TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
716 	    );
717 
718 TRACE_EVENT(rxrpc_abort,
719 	    TP_PROTO(unsigned int call_nr, const char *why, u32 cid, u32 call_id,
720 		     rxrpc_seq_t seq, int abort_code, int error),
721 
722 	    TP_ARGS(call_nr, why, cid, call_id, seq, abort_code, error),
723 
724 	    TP_STRUCT__entry(
725 		    __field(unsigned int,		call_nr		)
726 		    __array(char,			why, 4		)
727 		    __field(u32,			cid		)
728 		    __field(u32,			call_id		)
729 		    __field(rxrpc_seq_t,		seq		)
730 		    __field(int,			abort_code	)
731 		    __field(int,			error		)
732 			     ),
733 
734 	    TP_fast_assign(
735 		    memcpy(__entry->why, why, 4);
736 		    __entry->call_nr = call_nr;
737 		    __entry->cid = cid;
738 		    __entry->call_id = call_id;
739 		    __entry->abort_code = abort_code;
740 		    __entry->error = error;
741 		    __entry->seq = seq;
742 			   ),
743 
744 	    TP_printk("c=%08x %08x:%08x s=%u a=%d e=%d %s",
745 		      __entry->call_nr,
746 		      __entry->cid, __entry->call_id, __entry->seq,
747 		      __entry->abort_code, __entry->error, __entry->why)
748 	    );
749 
750 TRACE_EVENT(rxrpc_call_complete,
751 	    TP_PROTO(struct rxrpc_call *call),
752 
753 	    TP_ARGS(call),
754 
755 	    TP_STRUCT__entry(
756 		    __field(unsigned int,		call		)
757 		    __field(enum rxrpc_call_completion,	compl		)
758 		    __field(int,			error		)
759 		    __field(u32,			abort_code	)
760 			     ),
761 
762 	    TP_fast_assign(
763 		    __entry->call = call->debug_id;
764 		    __entry->compl = call->completion;
765 		    __entry->error = call->error;
766 		    __entry->abort_code = call->abort_code;
767 			   ),
768 
769 	    TP_printk("c=%08x %s r=%d ac=%d",
770 		      __entry->call,
771 		      __print_symbolic(__entry->compl, rxrpc_completions),
772 		      __entry->error,
773 		      __entry->abort_code)
774 	    );
775 
776 TRACE_EVENT(rxrpc_transmit,
777 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
778 
779 	    TP_ARGS(call, why),
780 
781 	    TP_STRUCT__entry(
782 		    __field(unsigned int,		call		)
783 		    __field(enum rxrpc_transmit_trace,	why		)
784 		    __field(rxrpc_seq_t,		tx_hard_ack	)
785 		    __field(rxrpc_seq_t,		tx_top		)
786 		    __field(int,			tx_winsize	)
787 			     ),
788 
789 	    TP_fast_assign(
790 		    __entry->call = call->debug_id;
791 		    __entry->why = why;
792 		    __entry->tx_hard_ack = call->tx_hard_ack;
793 		    __entry->tx_top = call->tx_top;
794 		    __entry->tx_winsize = call->tx_winsize;
795 			   ),
796 
797 	    TP_printk("c=%08x %s f=%08x n=%u/%u",
798 		      __entry->call,
799 		      __print_symbolic(__entry->why, rxrpc_transmit_traces),
800 		      __entry->tx_hard_ack + 1,
801 		      __entry->tx_top - __entry->tx_hard_ack,
802 		      __entry->tx_winsize)
803 	    );
804 
805 TRACE_EVENT(rxrpc_rx_data,
806 	    TP_PROTO(unsigned int call, rxrpc_seq_t seq,
807 		     rxrpc_serial_t serial, u8 flags, u8 anno),
808 
809 	    TP_ARGS(call, seq, serial, flags, anno),
810 
811 	    TP_STRUCT__entry(
812 		    __field(unsigned int,		call		)
813 		    __field(rxrpc_seq_t,		seq		)
814 		    __field(rxrpc_serial_t,		serial		)
815 		    __field(u8,				flags		)
816 		    __field(u8,				anno		)
817 			     ),
818 
819 	    TP_fast_assign(
820 		    __entry->call = call;
821 		    __entry->seq = seq;
822 		    __entry->serial = serial;
823 		    __entry->flags = flags;
824 		    __entry->anno = anno;
825 			   ),
826 
827 	    TP_printk("c=%08x DATA %08x q=%08x fl=%02x a=%02x",
828 		      __entry->call,
829 		      __entry->serial,
830 		      __entry->seq,
831 		      __entry->flags,
832 		      __entry->anno)
833 	    );
834 
835 TRACE_EVENT(rxrpc_rx_ack,
836 	    TP_PROTO(struct rxrpc_call *call,
837 		     rxrpc_serial_t serial, rxrpc_serial_t ack_serial,
838 		     rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks),
839 
840 	    TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
841 
842 	    TP_STRUCT__entry(
843 		    __field(unsigned int,		call		)
844 		    __field(rxrpc_serial_t,		serial		)
845 		    __field(rxrpc_serial_t,		ack_serial	)
846 		    __field(rxrpc_seq_t,		first		)
847 		    __field(rxrpc_seq_t,		prev		)
848 		    __field(u8,				reason		)
849 		    __field(u8,				n_acks		)
850 			     ),
851 
852 	    TP_fast_assign(
853 		    __entry->call = call->debug_id;
854 		    __entry->serial = serial;
855 		    __entry->ack_serial = ack_serial;
856 		    __entry->first = first;
857 		    __entry->prev = prev;
858 		    __entry->reason = reason;
859 		    __entry->n_acks = n_acks;
860 			   ),
861 
862 	    TP_printk("c=%08x %08x %s r=%08x f=%08x p=%08x n=%u",
863 		      __entry->call,
864 		      __entry->serial,
865 		      __print_symbolic(__entry->reason, rxrpc_ack_names),
866 		      __entry->ack_serial,
867 		      __entry->first,
868 		      __entry->prev,
869 		      __entry->n_acks)
870 	    );
871 
872 TRACE_EVENT(rxrpc_rx_abort,
873 	    TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
874 		     u32 abort_code),
875 
876 	    TP_ARGS(call, serial, abort_code),
877 
878 	    TP_STRUCT__entry(
879 		    __field(unsigned int,		call		)
880 		    __field(rxrpc_serial_t,		serial		)
881 		    __field(u32,			abort_code	)
882 			     ),
883 
884 	    TP_fast_assign(
885 		    __entry->call = call->debug_id;
886 		    __entry->serial = serial;
887 		    __entry->abort_code = abort_code;
888 			   ),
889 
890 	    TP_printk("c=%08x ABORT %08x ac=%d",
891 		      __entry->call,
892 		      __entry->serial,
893 		      __entry->abort_code)
894 	    );
895 
896 TRACE_EVENT(rxrpc_rx_rwind_change,
897 	    TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
898 		     u32 rwind, bool wake),
899 
900 	    TP_ARGS(call, serial, rwind, wake),
901 
902 	    TP_STRUCT__entry(
903 		    __field(unsigned int,		call		)
904 		    __field(rxrpc_serial_t,		serial		)
905 		    __field(u32,			rwind		)
906 		    __field(bool,			wake		)
907 			     ),
908 
909 	    TP_fast_assign(
910 		    __entry->call = call->debug_id;
911 		    __entry->serial = serial;
912 		    __entry->rwind = rwind;
913 		    __entry->wake = wake;
914 			   ),
915 
916 	    TP_printk("c=%08x %08x rw=%u%s",
917 		      __entry->call,
918 		      __entry->serial,
919 		      __entry->rwind,
920 		      __entry->wake ? " wake" : "")
921 	    );
922 
923 TRACE_EVENT(rxrpc_tx_packet,
924 	    TP_PROTO(unsigned int call_id, struct rxrpc_wire_header *whdr,
925 		     enum rxrpc_tx_point where),
926 
927 	    TP_ARGS(call_id, whdr, where),
928 
929 	    TP_STRUCT__entry(
930 		    __field(unsigned int,			call	)
931 		    __field(enum rxrpc_tx_point,		where	)
932 		    __field_struct(struct rxrpc_wire_header,	whdr	)
933 			     ),
934 
935 	    TP_fast_assign(
936 		    __entry->call = call_id;
937 		    memcpy(&__entry->whdr, whdr, sizeof(__entry->whdr));
938 		    __entry->where = where;
939 			   ),
940 
941 	    TP_printk("c=%08x %08x:%08x:%08x:%04x %08x %08x %02x %02x %s %s",
942 		      __entry->call,
943 		      ntohl(__entry->whdr.epoch),
944 		      ntohl(__entry->whdr.cid),
945 		      ntohl(__entry->whdr.callNumber),
946 		      ntohs(__entry->whdr.serviceId),
947 		      ntohl(__entry->whdr.serial),
948 		      ntohl(__entry->whdr.seq),
949 		      __entry->whdr.type, __entry->whdr.flags,
950 		      __entry->whdr.type <= 15 ?
951 		      __print_symbolic(__entry->whdr.type, rxrpc_pkts) : "?UNK",
952 		      __print_symbolic(__entry->where, rxrpc_tx_points))
953 	    );
954 
955 TRACE_EVENT(rxrpc_tx_data,
956 	    TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
957 		     rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
958 
959 	    TP_ARGS(call, seq, serial, flags, retrans, lose),
960 
961 	    TP_STRUCT__entry(
962 		    __field(unsigned int,		call		)
963 		    __field(rxrpc_seq_t,		seq		)
964 		    __field(rxrpc_serial_t,		serial		)
965 		    __field(u32,			cid		)
966 		    __field(u32,			call_id		)
967 		    __field(u8,				flags		)
968 		    __field(bool,			retrans		)
969 		    __field(bool,			lose		)
970 			     ),
971 
972 	    TP_fast_assign(
973 		    __entry->call = call->debug_id;
974 		    __entry->cid = call->cid;
975 		    __entry->call_id = call->call_id;
976 		    __entry->seq = seq;
977 		    __entry->serial = serial;
978 		    __entry->flags = flags;
979 		    __entry->retrans = retrans;
980 		    __entry->lose = lose;
981 			   ),
982 
983 	    TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s%s",
984 		      __entry->call,
985 		      __entry->cid,
986 		      __entry->call_id,
987 		      __entry->serial,
988 		      __entry->seq,
989 		      __entry->flags,
990 		      __entry->retrans ? " *RETRANS*" : "",
991 		      __entry->lose ? " *LOSE*" : "")
992 	    );
993 
994 TRACE_EVENT(rxrpc_tx_ack,
995 	    TP_PROTO(unsigned int call, rxrpc_serial_t serial,
996 		     rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
997 		     u8 reason, u8 n_acks),
998 
999 	    TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
1000 
1001 	    TP_STRUCT__entry(
1002 		    __field(unsigned int,		call		)
1003 		    __field(rxrpc_serial_t,		serial		)
1004 		    __field(rxrpc_seq_t,		ack_first	)
1005 		    __field(rxrpc_serial_t,		ack_serial	)
1006 		    __field(u8,				reason		)
1007 		    __field(u8,				n_acks		)
1008 			     ),
1009 
1010 	    TP_fast_assign(
1011 		    __entry->call = call;
1012 		    __entry->serial = serial;
1013 		    __entry->ack_first = ack_first;
1014 		    __entry->ack_serial = ack_serial;
1015 		    __entry->reason = reason;
1016 		    __entry->n_acks = n_acks;
1017 			   ),
1018 
1019 	    TP_printk(" c=%08x ACK  %08x %s f=%08x r=%08x n=%u",
1020 		      __entry->call,
1021 		      __entry->serial,
1022 		      __print_symbolic(__entry->reason, rxrpc_ack_names),
1023 		      __entry->ack_first,
1024 		      __entry->ack_serial,
1025 		      __entry->n_acks)
1026 	    );
1027 
1028 TRACE_EVENT(rxrpc_receive,
1029 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
1030 		     rxrpc_serial_t serial, rxrpc_seq_t seq),
1031 
1032 	    TP_ARGS(call, why, serial, seq),
1033 
1034 	    TP_STRUCT__entry(
1035 		    __field(unsigned int,		call		)
1036 		    __field(enum rxrpc_receive_trace,	why		)
1037 		    __field(rxrpc_serial_t,		serial		)
1038 		    __field(rxrpc_seq_t,		seq		)
1039 		    __field(rxrpc_seq_t,		hard_ack	)
1040 		    __field(rxrpc_seq_t,		top		)
1041 			     ),
1042 
1043 	    TP_fast_assign(
1044 		    __entry->call = call->debug_id;
1045 		    __entry->why = why;
1046 		    __entry->serial = serial;
1047 		    __entry->seq = seq;
1048 		    __entry->hard_ack = call->rx_hard_ack;
1049 		    __entry->top = call->rx_top;
1050 			   ),
1051 
1052 	    TP_printk("c=%08x %s r=%08x q=%08x w=%08x-%08x",
1053 		      __entry->call,
1054 		      __print_symbolic(__entry->why, rxrpc_receive_traces),
1055 		      __entry->serial,
1056 		      __entry->seq,
1057 		      __entry->hard_ack,
1058 		      __entry->top)
1059 	    );
1060 
1061 TRACE_EVENT(rxrpc_recvmsg,
1062 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
1063 		     rxrpc_seq_t seq, unsigned int offset, unsigned int len,
1064 		     int ret),
1065 
1066 	    TP_ARGS(call, why, seq, offset, len, ret),
1067 
1068 	    TP_STRUCT__entry(
1069 		    __field(unsigned int,		call		)
1070 		    __field(enum rxrpc_recvmsg_trace,	why		)
1071 		    __field(rxrpc_seq_t,		seq		)
1072 		    __field(unsigned int,		offset		)
1073 		    __field(unsigned int,		len		)
1074 		    __field(int,			ret		)
1075 			     ),
1076 
1077 	    TP_fast_assign(
1078 		    __entry->call = call->debug_id;
1079 		    __entry->why = why;
1080 		    __entry->seq = seq;
1081 		    __entry->offset = offset;
1082 		    __entry->len = len;
1083 		    __entry->ret = ret;
1084 			   ),
1085 
1086 	    TP_printk("c=%08x %s q=%08x o=%u l=%u ret=%d",
1087 		      __entry->call,
1088 		      __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
1089 		      __entry->seq,
1090 		      __entry->offset,
1091 		      __entry->len,
1092 		      __entry->ret)
1093 	    );
1094 
1095 TRACE_EVENT(rxrpc_rtt_tx,
1096 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
1097 		     rxrpc_serial_t send_serial),
1098 
1099 	    TP_ARGS(call, why, send_serial),
1100 
1101 	    TP_STRUCT__entry(
1102 		    __field(unsigned int,		call		)
1103 		    __field(enum rxrpc_rtt_tx_trace,	why		)
1104 		    __field(rxrpc_serial_t,		send_serial	)
1105 			     ),
1106 
1107 	    TP_fast_assign(
1108 		    __entry->call = call->debug_id;
1109 		    __entry->why = why;
1110 		    __entry->send_serial = send_serial;
1111 			   ),
1112 
1113 	    TP_printk("c=%08x %s sr=%08x",
1114 		      __entry->call,
1115 		      __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
1116 		      __entry->send_serial)
1117 	    );
1118 
1119 TRACE_EVENT(rxrpc_rtt_rx,
1120 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
1121 		     rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
1122 		     s64 rtt, u8 nr, s64 avg),
1123 
1124 	    TP_ARGS(call, why, send_serial, resp_serial, rtt, nr, avg),
1125 
1126 	    TP_STRUCT__entry(
1127 		    __field(unsigned int,		call		)
1128 		    __field(enum rxrpc_rtt_rx_trace,	why		)
1129 		    __field(u8,				nr		)
1130 		    __field(rxrpc_serial_t,		send_serial	)
1131 		    __field(rxrpc_serial_t,		resp_serial	)
1132 		    __field(s64,			rtt		)
1133 		    __field(u64,			avg		)
1134 			     ),
1135 
1136 	    TP_fast_assign(
1137 		    __entry->call = call->debug_id;
1138 		    __entry->why = why;
1139 		    __entry->send_serial = send_serial;
1140 		    __entry->resp_serial = resp_serial;
1141 		    __entry->rtt = rtt;
1142 		    __entry->nr = nr;
1143 		    __entry->avg = avg;
1144 			   ),
1145 
1146 	    TP_printk("c=%08x %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
1147 		      __entry->call,
1148 		      __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
1149 		      __entry->send_serial,
1150 		      __entry->resp_serial,
1151 		      __entry->rtt,
1152 		      __entry->nr,
1153 		      __entry->avg)
1154 	    );
1155 
1156 TRACE_EVENT(rxrpc_timer,
1157 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
1158 		     unsigned long now),
1159 
1160 	    TP_ARGS(call, why, now),
1161 
1162 	    TP_STRUCT__entry(
1163 		    __field(unsigned int,			call		)
1164 		    __field(enum rxrpc_timer_trace,		why		)
1165 		    __field(long,				now		)
1166 		    __field(long,				ack_at		)
1167 		    __field(long,				ack_lost_at	)
1168 		    __field(long,				resend_at	)
1169 		    __field(long,				ping_at		)
1170 		    __field(long,				expect_rx_by	)
1171 		    __field(long,				expect_req_by	)
1172 		    __field(long,				expect_term_by	)
1173 		    __field(long,				timer		)
1174 			     ),
1175 
1176 	    TP_fast_assign(
1177 		    __entry->call		= call->debug_id;
1178 		    __entry->why		= why;
1179 		    __entry->now		= now;
1180 		    __entry->ack_at		= call->ack_at;
1181 		    __entry->ack_lost_at	= call->ack_lost_at;
1182 		    __entry->resend_at		= call->resend_at;
1183 		    __entry->expect_rx_by	= call->expect_rx_by;
1184 		    __entry->expect_req_by	= call->expect_req_by;
1185 		    __entry->expect_term_by	= call->expect_term_by;
1186 		    __entry->timer		= call->timer.expires;
1187 			   ),
1188 
1189 	    TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
1190 		      __entry->call,
1191 		      __print_symbolic(__entry->why, rxrpc_timer_traces),
1192 		      __entry->ack_at - __entry->now,
1193 		      __entry->ack_lost_at - __entry->now,
1194 		      __entry->resend_at - __entry->now,
1195 		      __entry->expect_rx_by - __entry->now,
1196 		      __entry->expect_req_by - __entry->now,
1197 		      __entry->expect_term_by - __entry->now,
1198 		      __entry->timer - __entry->now)
1199 	    );
1200 
1201 TRACE_EVENT(rxrpc_rx_lose,
1202 	    TP_PROTO(struct rxrpc_skb_priv *sp),
1203 
1204 	    TP_ARGS(sp),
1205 
1206 	    TP_STRUCT__entry(
1207 		    __field_struct(struct rxrpc_host_header,	hdr		)
1208 			     ),
1209 
1210 	    TP_fast_assign(
1211 		    memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
1212 			   ),
1213 
1214 	    TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
1215 		      __entry->hdr.epoch, __entry->hdr.cid,
1216 		      __entry->hdr.callNumber, __entry->hdr.serviceId,
1217 		      __entry->hdr.serial, __entry->hdr.seq,
1218 		      __entry->hdr.type, __entry->hdr.flags,
1219 		      __entry->hdr.type <= 15 ?
1220 		      __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
1221 	    );
1222 
1223 TRACE_EVENT(rxrpc_propose_ack,
1224 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1225 		     u8 ack_reason, rxrpc_serial_t serial, bool immediate,
1226 		     bool background, enum rxrpc_propose_ack_outcome outcome),
1227 
1228 	    TP_ARGS(call, why, ack_reason, serial, immediate, background,
1229 		    outcome),
1230 
1231 	    TP_STRUCT__entry(
1232 		    __field(unsigned int,			call		)
1233 		    __field(enum rxrpc_propose_ack_trace,	why		)
1234 		    __field(rxrpc_serial_t,			serial		)
1235 		    __field(u8,					ack_reason	)
1236 		    __field(bool,				immediate	)
1237 		    __field(bool,				background	)
1238 		    __field(enum rxrpc_propose_ack_outcome,	outcome		)
1239 			     ),
1240 
1241 	    TP_fast_assign(
1242 		    __entry->call	= call->debug_id;
1243 		    __entry->why	= why;
1244 		    __entry->serial	= serial;
1245 		    __entry->ack_reason	= ack_reason;
1246 		    __entry->immediate	= immediate;
1247 		    __entry->background	= background;
1248 		    __entry->outcome	= outcome;
1249 			   ),
1250 
1251 	    TP_printk("c=%08x %s %s r=%08x i=%u b=%u%s",
1252 		      __entry->call,
1253 		      __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1254 		      __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
1255 		      __entry->serial,
1256 		      __entry->immediate,
1257 		      __entry->background,
1258 		      __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
1259 	    );
1260 
1261 TRACE_EVENT(rxrpc_retransmit,
1262 	    TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
1263 		     s64 expiry),
1264 
1265 	    TP_ARGS(call, seq, annotation, expiry),
1266 
1267 	    TP_STRUCT__entry(
1268 		    __field(unsigned int,		call		)
1269 		    __field(rxrpc_seq_t,		seq		)
1270 		    __field(u8,				annotation	)
1271 		    __field(s64,			expiry		)
1272 			     ),
1273 
1274 	    TP_fast_assign(
1275 		    __entry->call = call->debug_id;
1276 		    __entry->seq = seq;
1277 		    __entry->annotation = annotation;
1278 		    __entry->expiry = expiry;
1279 			   ),
1280 
1281 	    TP_printk("c=%08x q=%x a=%02x xp=%lld",
1282 		      __entry->call,
1283 		      __entry->seq,
1284 		      __entry->annotation,
1285 		      __entry->expiry)
1286 	    );
1287 
1288 TRACE_EVENT(rxrpc_congest,
1289 	    TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
1290 		     rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
1291 
1292 	    TP_ARGS(call, summary, ack_serial, change),
1293 
1294 	    TP_STRUCT__entry(
1295 		    __field(unsigned int,			call		)
1296 		    __field(enum rxrpc_congest_change,		change		)
1297 		    __field(rxrpc_seq_t,			hard_ack	)
1298 		    __field(rxrpc_seq_t,			top		)
1299 		    __field(rxrpc_seq_t,			lowest_nak	)
1300 		    __field(rxrpc_serial_t,			ack_serial	)
1301 		    __field_struct(struct rxrpc_ack_summary,	sum		)
1302 			     ),
1303 
1304 	    TP_fast_assign(
1305 		    __entry->call	= call->debug_id;
1306 		    __entry->change	= change;
1307 		    __entry->hard_ack	= call->tx_hard_ack;
1308 		    __entry->top	= call->tx_top;
1309 		    __entry->lowest_nak	= call->acks_lowest_nak;
1310 		    __entry->ack_serial	= ack_serial;
1311 		    memcpy(&__entry->sum, summary, sizeof(__entry->sum));
1312 			   ),
1313 
1314 	    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",
1315 		      __entry->call,
1316 		      __entry->ack_serial,
1317 		      __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
1318 		      __entry->hard_ack,
1319 		      __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
1320 		      __entry->sum.cwnd,
1321 		      __entry->sum.ssthresh,
1322 		      __entry->sum.nr_acks, __entry->sum.nr_nacks,
1323 		      __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
1324 		      __entry->sum.nr_rot_new_acks,
1325 		      __entry->top - __entry->hard_ack,
1326 		      __entry->sum.cumulative_acks,
1327 		      __entry->sum.dup_acks,
1328 		      __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
1329 		      __print_symbolic(__entry->change, rxrpc_congest_changes),
1330 		      __entry->sum.retrans_timeo ? " rTxTo" : "")
1331 	    );
1332 
1333 TRACE_EVENT(rxrpc_disconnect_call,
1334 	    TP_PROTO(struct rxrpc_call *call),
1335 
1336 	    TP_ARGS(call),
1337 
1338 	    TP_STRUCT__entry(
1339 		    __field(unsigned int,		call		)
1340 		    __field(u32,			abort_code	)
1341 			     ),
1342 
1343 	    TP_fast_assign(
1344 		    __entry->call = call->debug_id;
1345 		    __entry->abort_code = call->abort_code;
1346 			   ),
1347 
1348 	    TP_printk("c=%08x ab=%08x",
1349 		      __entry->call,
1350 		      __entry->abort_code)
1351 	    );
1352 
1353 TRACE_EVENT(rxrpc_improper_term,
1354 	    TP_PROTO(struct rxrpc_call *call),
1355 
1356 	    TP_ARGS(call),
1357 
1358 	    TP_STRUCT__entry(
1359 		    __field(unsigned int,		call		)
1360 		    __field(u32,			abort_code	)
1361 			     ),
1362 
1363 	    TP_fast_assign(
1364 		    __entry->call = call->debug_id;
1365 		    __entry->abort_code = call->abort_code;
1366 			   ),
1367 
1368 	    TP_printk("c=%08x ab=%08x",
1369 		      __entry->call,
1370 		      __entry->abort_code)
1371 	    );
1372 
1373 TRACE_EVENT(rxrpc_rx_eproto,
1374 	    TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
1375 		     const char *why),
1376 
1377 	    TP_ARGS(call, serial, why),
1378 
1379 	    TP_STRUCT__entry(
1380 		    __field(unsigned int,		call		)
1381 		    __field(rxrpc_serial_t,		serial		)
1382 		    __field(const char *,		why		)
1383 			     ),
1384 
1385 	    TP_fast_assign(
1386 		    __entry->call = call->debug_id;
1387 		    __entry->serial = serial;
1388 		    __entry->why = why;
1389 			   ),
1390 
1391 	    TP_printk("c=%08x EPROTO %08x %s",
1392 		      __entry->call,
1393 		      __entry->serial,
1394 		      __entry->why)
1395 	    );
1396 
1397 TRACE_EVENT(rxrpc_connect_call,
1398 	    TP_PROTO(struct rxrpc_call *call),
1399 
1400 	    TP_ARGS(call),
1401 
1402 	    TP_STRUCT__entry(
1403 		    __field(unsigned int,		call		)
1404 		    __field(unsigned long,		user_call_ID	)
1405 		    __field(u32,			cid		)
1406 		    __field(u32,			call_id		)
1407 			     ),
1408 
1409 	    TP_fast_assign(
1410 		    __entry->call = call->debug_id;
1411 		    __entry->user_call_ID = call->user_call_ID;
1412 		    __entry->cid = call->cid;
1413 		    __entry->call_id = call->call_id;
1414 			   ),
1415 
1416 	    TP_printk("c=%08x u=%p %08x:%08x",
1417 		      __entry->call,
1418 		      (void *)__entry->user_call_ID,
1419 		      __entry->cid,
1420 		      __entry->call_id)
1421 	    );
1422 
1423 TRACE_EVENT(rxrpc_resend,
1424 	    TP_PROTO(struct rxrpc_call *call, int ix),
1425 
1426 	    TP_ARGS(call, ix),
1427 
1428 	    TP_STRUCT__entry(
1429 		    __field(unsigned int,		call		)
1430 		    __field(int,			ix		)
1431 		    __array(u8,				anno, 64	)
1432 			     ),
1433 
1434 	    TP_fast_assign(
1435 		    __entry->call = call->debug_id;
1436 		    __entry->ix = ix;
1437 		    memcpy(__entry->anno, call->rxtx_annotations, 64);
1438 			   ),
1439 
1440 	    TP_printk("c=%08x ix=%u a=%64phN",
1441 		      __entry->call,
1442 		      __entry->ix,
1443 		      __entry->anno)
1444 	    );
1445 
1446 TRACE_EVENT(rxrpc_rx_icmp,
1447 	    TP_PROTO(struct rxrpc_peer *peer, struct sock_extended_err *ee,
1448 		     struct sockaddr_rxrpc *srx),
1449 
1450 	    TP_ARGS(peer, ee, srx),
1451 
1452 	    TP_STRUCT__entry(
1453 		    __field(unsigned int,			peer	)
1454 		    __field_struct(struct sock_extended_err,	ee	)
1455 		    __field_struct(struct sockaddr_rxrpc,	srx	)
1456 			     ),
1457 
1458 	    TP_fast_assign(
1459 		    __entry->peer = peer->debug_id;
1460 		    memcpy(&__entry->ee, ee, sizeof(__entry->ee));
1461 		    memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1462 			   ),
1463 
1464 	    TP_printk("P=%08x o=%u t=%u c=%u i=%u d=%u e=%d %pISp",
1465 		      __entry->peer,
1466 		      __entry->ee.ee_origin,
1467 		      __entry->ee.ee_type,
1468 		      __entry->ee.ee_code,
1469 		      __entry->ee.ee_info,
1470 		      __entry->ee.ee_data,
1471 		      __entry->ee.ee_errno,
1472 		      &__entry->srx.transport)
1473 	    );
1474 
1475 TRACE_EVENT(rxrpc_tx_fail,
1476 	    TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret,
1477 		     enum rxrpc_tx_point where),
1478 
1479 	    TP_ARGS(debug_id, serial, ret, where),
1480 
1481 	    TP_STRUCT__entry(
1482 		    __field(unsigned int,		debug_id	)
1483 		    __field(rxrpc_serial_t,		serial		)
1484 		    __field(int,			ret		)
1485 		    __field(enum rxrpc_tx_point,	where		)
1486 			     ),
1487 
1488 	    TP_fast_assign(
1489 		    __entry->debug_id = debug_id;
1490 		    __entry->serial = serial;
1491 		    __entry->ret = ret;
1492 		    __entry->where = where;
1493 			   ),
1494 
1495 	    TP_printk("c=%08x r=%x ret=%d %s",
1496 		      __entry->debug_id,
1497 		      __entry->serial,
1498 		      __entry->ret,
1499 		      __print_symbolic(__entry->where, rxrpc_tx_points))
1500 	    );
1501 
1502 TRACE_EVENT(rxrpc_call_reset,
1503 	    TP_PROTO(struct rxrpc_call *call),
1504 
1505 	    TP_ARGS(call),
1506 
1507 	    TP_STRUCT__entry(
1508 		    __field(unsigned int,		debug_id	)
1509 		    __field(u32,			cid		)
1510 		    __field(u32,			call_id		)
1511 		    __field(rxrpc_serial_t,		call_serial	)
1512 		    __field(rxrpc_serial_t,		conn_serial	)
1513 		    __field(rxrpc_seq_t,		tx_seq		)
1514 		    __field(rxrpc_seq_t,		rx_seq		)
1515 			     ),
1516 
1517 	    TP_fast_assign(
1518 		    __entry->debug_id = call->debug_id;
1519 		    __entry->cid = call->cid;
1520 		    __entry->call_id = call->call_id;
1521 		    __entry->call_serial = call->rx_serial;
1522 		    __entry->conn_serial = call->conn->hi_serial;
1523 		    __entry->tx_seq = call->tx_hard_ack;
1524 		    __entry->rx_seq = call->ackr_seen;
1525 			   ),
1526 
1527 	    TP_printk("c=%08x %08x:%08x r=%08x/%08x tx=%08x rx=%08x",
1528 		      __entry->debug_id,
1529 		      __entry->cid, __entry->call_id,
1530 		      __entry->call_serial, __entry->conn_serial,
1531 		      __entry->tx_seq, __entry->rx_seq)
1532 	    );
1533 
1534 TRACE_EVENT(rxrpc_notify_socket,
1535 	    TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial),
1536 
1537 	    TP_ARGS(debug_id, serial),
1538 
1539 	    TP_STRUCT__entry(
1540 		    __field(unsigned int,		debug_id	)
1541 		    __field(rxrpc_serial_t,		serial		)
1542 			     ),
1543 
1544 	    TP_fast_assign(
1545 		    __entry->debug_id = debug_id;
1546 		    __entry->serial = serial;
1547 			   ),
1548 
1549 	    TP_printk("c=%08x r=%08x",
1550 		      __entry->debug_id,
1551 		      __entry->serial)
1552 	    );
1553 
1554 #endif /* _TRACE_RXRPC_H */
1555 
1556 /* This part must be outside protection */
1557 #include <trace/define_trace.h>
1558