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