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