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