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