xref: /openbmc/linux/include/trace/events/rxrpc.h (revision 55fd7e02)
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 		     u32 rtt, u32 rto),
1116 
1117 	    TP_ARGS(call, why, send_serial, resp_serial, rtt, rto),
1118 
1119 	    TP_STRUCT__entry(
1120 		    __field(unsigned int,		call		)
1121 		    __field(enum rxrpc_rtt_rx_trace,	why		)
1122 		    __field(rxrpc_serial_t,		send_serial	)
1123 		    __field(rxrpc_serial_t,		resp_serial	)
1124 		    __field(u32,			rtt		)
1125 		    __field(u32,			rto		)
1126 			     ),
1127 
1128 	    TP_fast_assign(
1129 		    __entry->call = call->debug_id;
1130 		    __entry->why = why;
1131 		    __entry->send_serial = send_serial;
1132 		    __entry->resp_serial = resp_serial;
1133 		    __entry->rtt = rtt;
1134 		    __entry->rto = rto;
1135 			   ),
1136 
1137 	    TP_printk("c=%08x %s sr=%08x rr=%08x rtt=%u rto=%u",
1138 		      __entry->call,
1139 		      __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
1140 		      __entry->send_serial,
1141 		      __entry->resp_serial,
1142 		      __entry->rtt,
1143 		      __entry->rto)
1144 	    );
1145 
1146 TRACE_EVENT(rxrpc_timer,
1147 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
1148 		     unsigned long now),
1149 
1150 	    TP_ARGS(call, why, now),
1151 
1152 	    TP_STRUCT__entry(
1153 		    __field(unsigned int,			call		)
1154 		    __field(enum rxrpc_timer_trace,		why		)
1155 		    __field(long,				now		)
1156 		    __field(long,				ack_at		)
1157 		    __field(long,				ack_lost_at	)
1158 		    __field(long,				resend_at	)
1159 		    __field(long,				ping_at		)
1160 		    __field(long,				expect_rx_by	)
1161 		    __field(long,				expect_req_by	)
1162 		    __field(long,				expect_term_by	)
1163 		    __field(long,				timer		)
1164 			     ),
1165 
1166 	    TP_fast_assign(
1167 		    __entry->call		= call->debug_id;
1168 		    __entry->why		= why;
1169 		    __entry->now		= now;
1170 		    __entry->ack_at		= call->ack_at;
1171 		    __entry->ack_lost_at	= call->ack_lost_at;
1172 		    __entry->resend_at		= call->resend_at;
1173 		    __entry->expect_rx_by	= call->expect_rx_by;
1174 		    __entry->expect_req_by	= call->expect_req_by;
1175 		    __entry->expect_term_by	= call->expect_term_by;
1176 		    __entry->timer		= call->timer.expires;
1177 			   ),
1178 
1179 	    TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
1180 		      __entry->call,
1181 		      __print_symbolic(__entry->why, rxrpc_timer_traces),
1182 		      __entry->ack_at - __entry->now,
1183 		      __entry->ack_lost_at - __entry->now,
1184 		      __entry->resend_at - __entry->now,
1185 		      __entry->expect_rx_by - __entry->now,
1186 		      __entry->expect_req_by - __entry->now,
1187 		      __entry->expect_term_by - __entry->now,
1188 		      __entry->timer - __entry->now)
1189 	    );
1190 
1191 TRACE_EVENT(rxrpc_rx_lose,
1192 	    TP_PROTO(struct rxrpc_skb_priv *sp),
1193 
1194 	    TP_ARGS(sp),
1195 
1196 	    TP_STRUCT__entry(
1197 		    __field_struct(struct rxrpc_host_header,	hdr		)
1198 			     ),
1199 
1200 	    TP_fast_assign(
1201 		    memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
1202 			   ),
1203 
1204 	    TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
1205 		      __entry->hdr.epoch, __entry->hdr.cid,
1206 		      __entry->hdr.callNumber, __entry->hdr.serviceId,
1207 		      __entry->hdr.serial, __entry->hdr.seq,
1208 		      __entry->hdr.type, __entry->hdr.flags,
1209 		      __entry->hdr.type <= 15 ?
1210 		      __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
1211 	    );
1212 
1213 TRACE_EVENT(rxrpc_propose_ack,
1214 	    TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1215 		     u8 ack_reason, rxrpc_serial_t serial, bool immediate,
1216 		     bool background, enum rxrpc_propose_ack_outcome outcome),
1217 
1218 	    TP_ARGS(call, why, ack_reason, serial, immediate, background,
1219 		    outcome),
1220 
1221 	    TP_STRUCT__entry(
1222 		    __field(unsigned int,			call		)
1223 		    __field(enum rxrpc_propose_ack_trace,	why		)
1224 		    __field(rxrpc_serial_t,			serial		)
1225 		    __field(u8,					ack_reason	)
1226 		    __field(bool,				immediate	)
1227 		    __field(bool,				background	)
1228 		    __field(enum rxrpc_propose_ack_outcome,	outcome		)
1229 			     ),
1230 
1231 	    TP_fast_assign(
1232 		    __entry->call	= call->debug_id;
1233 		    __entry->why	= why;
1234 		    __entry->serial	= serial;
1235 		    __entry->ack_reason	= ack_reason;
1236 		    __entry->immediate	= immediate;
1237 		    __entry->background	= background;
1238 		    __entry->outcome	= outcome;
1239 			   ),
1240 
1241 	    TP_printk("c=%08x %s %s r=%08x i=%u b=%u%s",
1242 		      __entry->call,
1243 		      __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1244 		      __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
1245 		      __entry->serial,
1246 		      __entry->immediate,
1247 		      __entry->background,
1248 		      __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
1249 	    );
1250 
1251 TRACE_EVENT(rxrpc_retransmit,
1252 	    TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
1253 		     s64 expiry),
1254 
1255 	    TP_ARGS(call, seq, annotation, expiry),
1256 
1257 	    TP_STRUCT__entry(
1258 		    __field(unsigned int,		call		)
1259 		    __field(rxrpc_seq_t,		seq		)
1260 		    __field(u8,				annotation	)
1261 		    __field(s64,			expiry		)
1262 			     ),
1263 
1264 	    TP_fast_assign(
1265 		    __entry->call = call->debug_id;
1266 		    __entry->seq = seq;
1267 		    __entry->annotation = annotation;
1268 		    __entry->expiry = expiry;
1269 			   ),
1270 
1271 	    TP_printk("c=%08x q=%x a=%02x xp=%lld",
1272 		      __entry->call,
1273 		      __entry->seq,
1274 		      __entry->annotation,
1275 		      __entry->expiry)
1276 	    );
1277 
1278 TRACE_EVENT(rxrpc_congest,
1279 	    TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
1280 		     rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
1281 
1282 	    TP_ARGS(call, summary, ack_serial, change),
1283 
1284 	    TP_STRUCT__entry(
1285 		    __field(unsigned int,			call		)
1286 		    __field(enum rxrpc_congest_change,		change		)
1287 		    __field(rxrpc_seq_t,			hard_ack	)
1288 		    __field(rxrpc_seq_t,			top		)
1289 		    __field(rxrpc_seq_t,			lowest_nak	)
1290 		    __field(rxrpc_serial_t,			ack_serial	)
1291 		    __field_struct(struct rxrpc_ack_summary,	sum		)
1292 			     ),
1293 
1294 	    TP_fast_assign(
1295 		    __entry->call	= call->debug_id;
1296 		    __entry->change	= change;
1297 		    __entry->hard_ack	= call->tx_hard_ack;
1298 		    __entry->top	= call->tx_top;
1299 		    __entry->lowest_nak	= call->acks_lowest_nak;
1300 		    __entry->ack_serial	= ack_serial;
1301 		    memcpy(&__entry->sum, summary, sizeof(__entry->sum));
1302 			   ),
1303 
1304 	    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",
1305 		      __entry->call,
1306 		      __entry->ack_serial,
1307 		      __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
1308 		      __entry->hard_ack,
1309 		      __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
1310 		      __entry->sum.cwnd,
1311 		      __entry->sum.ssthresh,
1312 		      __entry->sum.nr_acks, __entry->sum.nr_nacks,
1313 		      __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
1314 		      __entry->sum.nr_rot_new_acks,
1315 		      __entry->top - __entry->hard_ack,
1316 		      __entry->sum.cumulative_acks,
1317 		      __entry->sum.dup_acks,
1318 		      __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
1319 		      __print_symbolic(__entry->change, rxrpc_congest_changes),
1320 		      __entry->sum.retrans_timeo ? " rTxTo" : "")
1321 	    );
1322 
1323 TRACE_EVENT(rxrpc_disconnect_call,
1324 	    TP_PROTO(struct rxrpc_call *call),
1325 
1326 	    TP_ARGS(call),
1327 
1328 	    TP_STRUCT__entry(
1329 		    __field(unsigned int,		call		)
1330 		    __field(u32,			abort_code	)
1331 			     ),
1332 
1333 	    TP_fast_assign(
1334 		    __entry->call = call->debug_id;
1335 		    __entry->abort_code = call->abort_code;
1336 			   ),
1337 
1338 	    TP_printk("c=%08x ab=%08x",
1339 		      __entry->call,
1340 		      __entry->abort_code)
1341 	    );
1342 
1343 TRACE_EVENT(rxrpc_improper_term,
1344 	    TP_PROTO(struct rxrpc_call *call),
1345 
1346 	    TP_ARGS(call),
1347 
1348 	    TP_STRUCT__entry(
1349 		    __field(unsigned int,		call		)
1350 		    __field(u32,			abort_code	)
1351 			     ),
1352 
1353 	    TP_fast_assign(
1354 		    __entry->call = call->debug_id;
1355 		    __entry->abort_code = call->abort_code;
1356 			   ),
1357 
1358 	    TP_printk("c=%08x ab=%08x",
1359 		      __entry->call,
1360 		      __entry->abort_code)
1361 	    );
1362 
1363 TRACE_EVENT(rxrpc_rx_eproto,
1364 	    TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
1365 		     const char *why),
1366 
1367 	    TP_ARGS(call, serial, why),
1368 
1369 	    TP_STRUCT__entry(
1370 		    __field(unsigned int,		call		)
1371 		    __field(rxrpc_serial_t,		serial		)
1372 		    __field(const char *,		why		)
1373 			     ),
1374 
1375 	    TP_fast_assign(
1376 		    __entry->call = call ? call->debug_id : 0;
1377 		    __entry->serial = serial;
1378 		    __entry->why = why;
1379 			   ),
1380 
1381 	    TP_printk("c=%08x EPROTO %08x %s",
1382 		      __entry->call,
1383 		      __entry->serial,
1384 		      __entry->why)
1385 	    );
1386 
1387 TRACE_EVENT(rxrpc_connect_call,
1388 	    TP_PROTO(struct rxrpc_call *call),
1389 
1390 	    TP_ARGS(call),
1391 
1392 	    TP_STRUCT__entry(
1393 		    __field(unsigned int,		call		)
1394 		    __field(unsigned long,		user_call_ID	)
1395 		    __field(u32,			cid		)
1396 		    __field(u32,			call_id		)
1397 			     ),
1398 
1399 	    TP_fast_assign(
1400 		    __entry->call = call->debug_id;
1401 		    __entry->user_call_ID = call->user_call_ID;
1402 		    __entry->cid = call->cid;
1403 		    __entry->call_id = call->call_id;
1404 			   ),
1405 
1406 	    TP_printk("c=%08x u=%p %08x:%08x",
1407 		      __entry->call,
1408 		      (void *)__entry->user_call_ID,
1409 		      __entry->cid,
1410 		      __entry->call_id)
1411 	    );
1412 
1413 TRACE_EVENT(rxrpc_resend,
1414 	    TP_PROTO(struct rxrpc_call *call, int ix),
1415 
1416 	    TP_ARGS(call, ix),
1417 
1418 	    TP_STRUCT__entry(
1419 		    __field(unsigned int,		call		)
1420 		    __field(int,			ix		)
1421 		    __array(u8,				anno, 64	)
1422 			     ),
1423 
1424 	    TP_fast_assign(
1425 		    __entry->call = call->debug_id;
1426 		    __entry->ix = ix;
1427 		    memcpy(__entry->anno, call->rxtx_annotations, 64);
1428 			   ),
1429 
1430 	    TP_printk("c=%08x ix=%u a=%64phN",
1431 		      __entry->call,
1432 		      __entry->ix,
1433 		      __entry->anno)
1434 	    );
1435 
1436 TRACE_EVENT(rxrpc_rx_icmp,
1437 	    TP_PROTO(struct rxrpc_peer *peer, struct sock_extended_err *ee,
1438 		     struct sockaddr_rxrpc *srx),
1439 
1440 	    TP_ARGS(peer, ee, srx),
1441 
1442 	    TP_STRUCT__entry(
1443 		    __field(unsigned int,			peer	)
1444 		    __field_struct(struct sock_extended_err,	ee	)
1445 		    __field_struct(struct sockaddr_rxrpc,	srx	)
1446 			     ),
1447 
1448 	    TP_fast_assign(
1449 		    __entry->peer = peer->debug_id;
1450 		    memcpy(&__entry->ee, ee, sizeof(__entry->ee));
1451 		    memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1452 			   ),
1453 
1454 	    TP_printk("P=%08x o=%u t=%u c=%u i=%u d=%u e=%d %pISp",
1455 		      __entry->peer,
1456 		      __entry->ee.ee_origin,
1457 		      __entry->ee.ee_type,
1458 		      __entry->ee.ee_code,
1459 		      __entry->ee.ee_info,
1460 		      __entry->ee.ee_data,
1461 		      __entry->ee.ee_errno,
1462 		      &__entry->srx.transport)
1463 	    );
1464 
1465 TRACE_EVENT(rxrpc_tx_fail,
1466 	    TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret,
1467 		     enum rxrpc_tx_point where),
1468 
1469 	    TP_ARGS(debug_id, serial, ret, where),
1470 
1471 	    TP_STRUCT__entry(
1472 		    __field(unsigned int,		debug_id	)
1473 		    __field(rxrpc_serial_t,		serial		)
1474 		    __field(int,			ret		)
1475 		    __field(enum rxrpc_tx_point,	where		)
1476 			     ),
1477 
1478 	    TP_fast_assign(
1479 		    __entry->debug_id = debug_id;
1480 		    __entry->serial = serial;
1481 		    __entry->ret = ret;
1482 		    __entry->where = where;
1483 			   ),
1484 
1485 	    TP_printk("c=%08x r=%x ret=%d %s",
1486 		      __entry->debug_id,
1487 		      __entry->serial,
1488 		      __entry->ret,
1489 		      __print_symbolic(__entry->where, rxrpc_tx_points))
1490 	    );
1491 
1492 TRACE_EVENT(rxrpc_call_reset,
1493 	    TP_PROTO(struct rxrpc_call *call),
1494 
1495 	    TP_ARGS(call),
1496 
1497 	    TP_STRUCT__entry(
1498 		    __field(unsigned int,		debug_id	)
1499 		    __field(u32,			cid		)
1500 		    __field(u32,			call_id		)
1501 		    __field(rxrpc_serial_t,		call_serial	)
1502 		    __field(rxrpc_serial_t,		conn_serial	)
1503 		    __field(rxrpc_seq_t,		tx_seq		)
1504 		    __field(rxrpc_seq_t,		rx_seq		)
1505 			     ),
1506 
1507 	    TP_fast_assign(
1508 		    __entry->debug_id = call->debug_id;
1509 		    __entry->cid = call->cid;
1510 		    __entry->call_id = call->call_id;
1511 		    __entry->call_serial = call->rx_serial;
1512 		    __entry->conn_serial = call->conn->hi_serial;
1513 		    __entry->tx_seq = call->tx_hard_ack;
1514 		    __entry->rx_seq = call->ackr_seen;
1515 			   ),
1516 
1517 	    TP_printk("c=%08x %08x:%08x r=%08x/%08x tx=%08x rx=%08x",
1518 		      __entry->debug_id,
1519 		      __entry->cid, __entry->call_id,
1520 		      __entry->call_serial, __entry->conn_serial,
1521 		      __entry->tx_seq, __entry->rx_seq)
1522 	    );
1523 
1524 TRACE_EVENT(rxrpc_notify_socket,
1525 	    TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial),
1526 
1527 	    TP_ARGS(debug_id, serial),
1528 
1529 	    TP_STRUCT__entry(
1530 		    __field(unsigned int,		debug_id	)
1531 		    __field(rxrpc_serial_t,		serial		)
1532 			     ),
1533 
1534 	    TP_fast_assign(
1535 		    __entry->debug_id = debug_id;
1536 		    __entry->serial = serial;
1537 			   ),
1538 
1539 	    TP_printk("c=%08x r=%08x",
1540 		      __entry->debug_id,
1541 		      __entry->serial)
1542 	    );
1543 
1544 TRACE_EVENT(rxrpc_rx_discard_ack,
1545 	    TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial,
1546 		     rxrpc_seq_t first_soft_ack, rxrpc_seq_t call_ackr_first,
1547 		     rxrpc_seq_t prev_pkt, rxrpc_seq_t call_ackr_prev),
1548 
1549 	    TP_ARGS(debug_id, serial, first_soft_ack, call_ackr_first,
1550 		    prev_pkt, call_ackr_prev),
1551 
1552 	    TP_STRUCT__entry(
1553 		    __field(unsigned int,	debug_id	)
1554 		    __field(rxrpc_serial_t,	serial		)
1555 		    __field(rxrpc_seq_t,	first_soft_ack)
1556 		    __field(rxrpc_seq_t,	call_ackr_first)
1557 		    __field(rxrpc_seq_t,	prev_pkt)
1558 		    __field(rxrpc_seq_t,	call_ackr_prev)
1559 			     ),
1560 
1561 	    TP_fast_assign(
1562 		    __entry->debug_id		= debug_id;
1563 		    __entry->serial		= serial;
1564 		    __entry->first_soft_ack	= first_soft_ack;
1565 		    __entry->call_ackr_first	= call_ackr_first;
1566 		    __entry->prev_pkt		= prev_pkt;
1567 		    __entry->call_ackr_prev	= call_ackr_prev;
1568 			   ),
1569 
1570 	    TP_printk("c=%08x r=%08x %08x<%08x %08x<%08x",
1571 		      __entry->debug_id,
1572 		      __entry->serial,
1573 		      __entry->first_soft_ack,
1574 		      __entry->call_ackr_first,
1575 		      __entry->prev_pkt,
1576 		      __entry->call_ackr_prev)
1577 	    );
1578 
1579 #endif /* _TRACE_RXRPC_H */
1580 
1581 /* This part must be outside protection */
1582 #include <trace/define_trace.h>
1583