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