xprtrdma: Reduce context switching due to Local Invalidation
[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 {
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
09d2bf59
DH
42enum 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
1159d4b4
DH
50enum rxrpc_peer_trace {
51 rxrpc_peer_got,
52 rxrpc_peer_new,
53 rxrpc_peer_processing,
54 rxrpc_peer_put,
1159d4b4
DH
55};
56
b54a134a
DH
57enum 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,
f859ab61 64 rxrpc_conn_reap_service,
b54a134a
DH
65 rxrpc_conn_seen,
66};
67
68enum 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,
930c9f91 75 rxrpc_client_chan_wait_failed,
b54a134a
DH
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
91enum 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
109enum 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
119enum 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
128enum 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,
540b1c48 136 rxrpc_recvmsg_requeue,
b54a134a
DH
137 rxrpc_recvmsg_return,
138 rxrpc_recvmsg_terminal,
139 rxrpc_recvmsg_to_be_accepted,
140 rxrpc_recvmsg_wait,
141};
142
143enum rxrpc_rtt_tx_trace {
144 rxrpc_rtt_tx_data,
145 rxrpc_rtt_tx_ping,
146};
147
148enum rxrpc_rtt_rx_trace {
149 rxrpc_rtt_rx_ping_response,
150 rxrpc_rtt_rx_requested_ack,
151};
152
153enum rxrpc_timer_trace {
154 rxrpc_timer_begin,
a158bdd3
DH
155 rxrpc_timer_exp_ack,
156 rxrpc_timer_exp_hard,
157 rxrpc_timer_exp_idle,
415f44e4 158 rxrpc_timer_exp_keepalive,
bd1fdf8c 159 rxrpc_timer_exp_lost_ack,
a158bdd3
DH
160 rxrpc_timer_exp_normal,
161 rxrpc_timer_exp_ping,
162 rxrpc_timer_exp_resend,
b54a134a
DH
163 rxrpc_timer_expired,
164 rxrpc_timer_init_for_reply,
165 rxrpc_timer_init_for_send_reply,
a158bdd3 166 rxrpc_timer_restart,
b54a134a 167 rxrpc_timer_set_for_ack,
a158bdd3
DH
168 rxrpc_timer_set_for_hard,
169 rxrpc_timer_set_for_idle,
415f44e4 170 rxrpc_timer_set_for_keepalive,
bd1fdf8c 171 rxrpc_timer_set_for_lost_ack,
a158bdd3 172 rxrpc_timer_set_for_normal,
b54a134a
DH
173 rxrpc_timer_set_for_ping,
174 rxrpc_timer_set_for_resend,
175 rxrpc_timer_set_for_send,
176};
177
178enum rxrpc_propose_ack_trace {
179 rxrpc_propose_ack_client_tx_end,
180 rxrpc_propose_ack_input_data,
7150ceaa 181 rxrpc_propose_ack_ping_for_check_life,
415f44e4 182 rxrpc_propose_ack_ping_for_keepalive,
b54a134a
DH
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
194enum rxrpc_propose_ack_outcome {
195 rxrpc_propose_ack_subsume,
196 rxrpc_propose_ack_update,
197 rxrpc_propose_ack_use,
198};
199
200enum 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
4764c0da
DH
211enum 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,
6b47fe1d
DH
223};
224
b54a134a
DH
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
09d2bf59
DH
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
1159d4b4
DH
253#define rxrpc_peer_traces \
254 EM(rxrpc_peer_got, "GOT") \
255 EM(rxrpc_peer_new, "NEW") \
256 EM(rxrpc_peer_processing, "PRO") \
f3344303 257 E_(rxrpc_peer_put, "PUT")
1159d4b4 258
b54a134a
DH
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") \
f859ab61 266 EM(rxrpc_conn_reap_service, "RPs") \
b54a134a
DH
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") \
930c9f91 276 EM(rxrpc_client_chan_wait_failed, "ChWtFl") \
b54a134a
DH
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") \
4e255721 295 EM(RXRPC_CONN_CLIENT_UPGRADE, "Upgd") \
b54a134a
DH
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") \
540b1c48 341 EM(rxrpc_recvmsg_requeue, "REQU") \
b54a134a
DH
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*") \
a158bdd3
DH
358 EM(rxrpc_timer_exp_ack, "ExpAck") \
359 EM(rxrpc_timer_exp_hard, "ExpHrd") \
360 EM(rxrpc_timer_exp_idle, "ExpIdl") \
415f44e4 361 EM(rxrpc_timer_exp_keepalive, "ExpKA ") \
bd1fdf8c 362 EM(rxrpc_timer_exp_lost_ack, "ExpLoA") \
a158bdd3
DH
363 EM(rxrpc_timer_exp_normal, "ExpNml") \
364 EM(rxrpc_timer_exp_ping, "ExpPng") \
365 EM(rxrpc_timer_exp_resend, "ExpRsn") \
b54a134a
DH
366 EM(rxrpc_timer_init_for_reply, "IniRpl") \
367 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
a158bdd3 368 EM(rxrpc_timer_restart, "Restrt") \
b54a134a 369 EM(rxrpc_timer_set_for_ack, "SetAck") \
a158bdd3
DH
370 EM(rxrpc_timer_set_for_hard, "SetHrd") \
371 EM(rxrpc_timer_set_for_idle, "SetIdl") \
415f44e4 372 EM(rxrpc_timer_set_for_keepalive, "KeepAl") \
bd1fdf8c 373 EM(rxrpc_timer_set_for_lost_ack, "SetLoA") \
a158bdd3 374 EM(rxrpc_timer_set_for_normal, "SetNml") \
b54a134a
DH
375 EM(rxrpc_timer_set_for_ping, "SetPng") \
376 EM(rxrpc_timer_set_for_resend, "SetRTx") \
a158bdd3 377 E_(rxrpc_timer_set_for_send, "SetSnd")
b54a134a
DH
378
379#define rxrpc_propose_ack_traces \
380 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
381 EM(rxrpc_propose_ack_input_data, "DataIn ") \
7150ceaa 382 EM(rxrpc_propose_ack_ping_for_check_life, "ChkLife") \
415f44e4 383 EM(rxrpc_propose_ack_ping_for_keepalive, "KeepAlv") \
b54a134a
DH
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") \
197445af 397 E_(rxrpc_propose_ack_use, " New")
b54a134a
DH
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
1bae5d22
DH
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
4764c0da
DH
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")
6b47fe1d 465
b54a134a
DH
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
474rxrpc_skb_traces;
09d2bf59 475rxrpc_local_traces;
b54a134a
DH
476rxrpc_conn_traces;
477rxrpc_client_traces;
478rxrpc_call_traces;
479rxrpc_transmit_traces;
480rxrpc_receive_traces;
481rxrpc_recvmsg_traces;
482rxrpc_rtt_tx_traces;
483rxrpc_rtt_rx_traces;
484rxrpc_timer_traces;
485rxrpc_propose_ack_traces;
486rxrpc_propose_ack_outcomes;
827efed6 487rxrpc_congest_modes;
b54a134a 488rxrpc_congest_changes;
4764c0da 489rxrpc_tx_points;
b54a134a
DH
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
09d2bf59
DH
500TRACE_EVENT(rxrpc_local,
501 TP_PROTO(struct rxrpc_local *local, enum rxrpc_local_trace op,
502 int usage, const void *where),
503
504 TP_ARGS(local, 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
1159d4b4
DH
527TRACE_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
363deeab
DH
554TRACE_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(
a25e21f0
DH
561 __field(unsigned int, conn )
562 __field(int, op )
563 __field(int, usage )
564 __field(const void *, where )
363deeab
DH
565 ),
566
567 TP_fast_assign(
a25e21f0 568 __entry->conn = conn->debug_id;
363deeab
DH
569 __entry->op = op;
570 __entry->usage = usage;
571 __entry->where = where;
572 ),
573
a25e21f0 574 TP_printk("C=%08x %s u=%d sp=%pSR",
363deeab 575 __entry->conn,
b54a134a 576 __print_symbolic(__entry->op, rxrpc_conn_traces),
363deeab
DH
577 __entry->usage,
578 __entry->where)
579 );
580
581TRACE_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(
a25e21f0 588 __field(unsigned int, conn )
363deeab
DH
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(
a25e21f0 597 __entry->conn = conn->debug_id;
363deeab
DH
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
a25e21f0 605 TP_printk("C=%08x h=%2d %s %s i=%08x u=%d",
363deeab
DH
606 __entry->conn,
607 __entry->channel,
b54a134a
DH
608 __print_symbolic(__entry->op, rxrpc_client_traces),
609 __print_symbolic(__entry->cs, rxrpc_conn_cache_states),
363deeab
DH
610 __entry->cid,
611 __entry->usage)
612 );
613
e34d4234 614TRACE_EVENT(rxrpc_call,
fff72429 615 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
2ab27215 616 int usage, const void *where, const void *aux),
e34d4234 617
2ab27215 618 TP_ARGS(call, op, usage, where, aux),
e34d4234
DH
619
620 TP_STRUCT__entry(
a25e21f0 621 __field(unsigned int, call )
e34d4234
DH
622 __field(int, op )
623 __field(int, usage )
e34d4234
DH
624 __field(const void *, where )
625 __field(const void *, aux )
626 ),
627
628 TP_fast_assign(
a25e21f0 629 __entry->call = call->debug_id;
e34d4234
DH
630 __entry->op = op;
631 __entry->usage = usage;
e34d4234
DH
632 __entry->where = where;
633 __entry->aux = aux;
634 ),
635
a25e21f0 636 TP_printk("c=%08x %s u=%d sp=%pSR a=%p",
e34d4234 637 __entry->call,
b54a134a 638 __print_symbolic(__entry->op, rxrpc_call_traces),
e34d4234 639 __entry->usage,
e34d4234
DH
640 __entry->where,
641 __entry->aux)
642 );
643
df844fd4 644TRACE_EVENT(rxrpc_skb,
71f3ca40
DH
645 TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
646 int usage, int mod_count, const void *where),
df844fd4
DH
647
648 TP_ARGS(skb, op, usage, mod_count, where),
649
650 TP_STRUCT__entry(
651 __field(struct sk_buff *, skb )
71f3ca40 652 __field(enum rxrpc_skb_trace, op )
df844fd4
DH
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,
b54a134a 668 __print_symbolic(__entry->op, rxrpc_skb_traces),
df844fd4
DH
669 __entry->usage,
670 __entry->mod_count,
671 __entry->where)
672 );
673
49e19ec7
DH
674TRACE_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
a3868bfc 687 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
49e19ec7
DH
688 __entry->hdr.epoch, __entry->hdr.cid,
689 __entry->hdr.callNumber, __entry->hdr.serviceId,
690 __entry->hdr.serial, __entry->hdr.seq,
a3868bfc 691 __entry->hdr.type, __entry->hdr.flags,
b54a134a
DH
692 __entry->hdr.type <= 15 ?
693 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
49e19ec7
DH
694 );
695
696TRACE_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
5a42976d 714TRACE_EVENT(rxrpc_abort,
a25e21f0
DH
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),
5a42976d 717
a25e21f0 718 TP_ARGS(call_nr, why, cid, call_id, seq, abort_code, error),
5a42976d
DH
719
720 TP_STRUCT__entry(
a25e21f0 721 __field(unsigned int, call_nr )
5a42976d
DH
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);
a25e21f0 732 __entry->call_nr = call_nr;
5a42976d
DH
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
a25e21f0
DH
740 TP_printk("c=%08x %08x:%08x s=%u a=%d e=%d %s",
741 __entry->call_nr,
5a42976d
DH
742 __entry->cid, __entry->call_id, __entry->seq,
743 __entry->abort_code, __entry->error, __entry->why)
744 );
745
1bae5d22
DH
746TRACE_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
a124fe3e
DH
772TRACE_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(
a25e21f0 778 __field(unsigned int, call )
a124fe3e
DH
779 __field(enum rxrpc_transmit_trace, why )
780 __field(rxrpc_seq_t, tx_hard_ack )
781 __field(rxrpc_seq_t, tx_top )
b1d9f7fd 782 __field(int, tx_winsize )
a124fe3e
DH
783 ),
784
785 TP_fast_assign(
a25e21f0 786 __entry->call = call->debug_id;
a124fe3e
DH
787 __entry->why = why;
788 __entry->tx_hard_ack = call->tx_hard_ack;
789 __entry->tx_top = call->tx_top;
b1d9f7fd 790 __entry->tx_winsize = call->tx_winsize;
a124fe3e
DH
791 ),
792
a25e21f0 793 TP_printk("c=%08x %s f=%08x n=%u/%u",
a124fe3e 794 __entry->call,
b54a134a 795 __print_symbolic(__entry->why, rxrpc_transmit_traces),
a124fe3e 796 __entry->tx_hard_ack + 1,
b1d9f7fd
DH
797 __entry->tx_top - __entry->tx_hard_ack,
798 __entry->tx_winsize)
799 );
800
801TRACE_EVENT(rxrpc_rx_data,
4764c0da 802 TP_PROTO(unsigned int call, rxrpc_seq_t seq,
b1d9f7fd
DH
803 rxrpc_serial_t serial, u8 flags, u8 anno),
804
805 TP_ARGS(call, seq, serial, flags, anno),
806
807 TP_STRUCT__entry(
a25e21f0 808 __field(unsigned int, call )
b1d9f7fd
DH
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(
4764c0da 816 __entry->call = call;
b1d9f7fd
DH
817 __entry->seq = seq;
818 __entry->serial = serial;
819 __entry->flags = flags;
820 __entry->anno = anno;
821 ),
822
a25e21f0 823 TP_printk("c=%08x DATA %08x q=%08x fl=%02x a=%02x",
b1d9f7fd
DH
824 __entry->call,
825 __entry->serial,
826 __entry->seq,
827 __entry->flags,
828 __entry->anno)
a124fe3e
DH
829 );
830
ec71eb9a 831TRACE_EVENT(rxrpc_rx_ack,
b1d9f7fd
DH
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),
ec71eb9a 835
b1d9f7fd 836 TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
ec71eb9a
DH
837
838 TP_STRUCT__entry(
a25e21f0 839 __field(unsigned int, call )
b1d9f7fd
DH
840 __field(rxrpc_serial_t, serial )
841 __field(rxrpc_serial_t, ack_serial )
ec71eb9a 842 __field(rxrpc_seq_t, first )
b1d9f7fd 843 __field(rxrpc_seq_t, prev )
ec71eb9a
DH
844 __field(u8, reason )
845 __field(u8, n_acks )
846 ),
847
848 TP_fast_assign(
a25e21f0 849 __entry->call = call->debug_id;
b1d9f7fd
DH
850 __entry->serial = serial;
851 __entry->ack_serial = ack_serial;
ec71eb9a 852 __entry->first = first;
b1d9f7fd 853 __entry->prev = prev;
ec71eb9a
DH
854 __entry->reason = reason;
855 __entry->n_acks = n_acks;
856 ),
857
a25e21f0 858 TP_printk("c=%08x %08x %s r=%08x f=%08x p=%08x n=%u",
ec71eb9a 859 __entry->call,
b1d9f7fd 860 __entry->serial,
b54a134a 861 __print_symbolic(__entry->reason, rxrpc_ack_names),
b1d9f7fd 862 __entry->ack_serial,
ec71eb9a 863 __entry->first,
b1d9f7fd 864 __entry->prev,
ec71eb9a
DH
865 __entry->n_acks)
866 );
867
005ede28
DH
868TRACE_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(
a25e21f0 875 __field(unsigned int, call )
005ede28
DH
876 __field(rxrpc_serial_t, serial )
877 __field(u32, abort_code )
878 ),
879
880 TP_fast_assign(
a25e21f0 881 __entry->call = call->debug_id;
005ede28
DH
882 __entry->serial = serial;
883 __entry->abort_code = abort_code;
884 ),
885
a25e21f0 886 TP_printk("c=%08x ABORT %08x ac=%d",
005ede28
DH
887 __entry->call,
888 __entry->serial,
889 __entry->abort_code)
890 );
891
740586d2
DH
892TRACE_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(
a25e21f0 899 __field(unsigned int, call )
740586d2
DH
900 __field(rxrpc_serial_t, serial )
901 __field(u32, rwind )
902 __field(bool, wake )
903 ),
904
905 TP_fast_assign(
a25e21f0 906 __entry->call = call->debug_id;
740586d2
DH
907 __entry->serial = serial;
908 __entry->rwind = rwind;
909 __entry->wake = wake;
910 ),
911
a25e21f0 912 TP_printk("c=%08x %08x rw=%u%s",
740586d2
DH
913 __entry->call,
914 __entry->serial,
915 __entry->rwind,
916 __entry->wake ? " wake" : "")
917 );
918
4764c0da
DH
919TRACE_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));
4e2abd3c 934 __entry->where = where;
4764c0da
DH
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
be832aec
DH
951TRACE_EVENT(rxrpc_tx_data,
952 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
a1767077 953 rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
be832aec 954
a1767077 955 TP_ARGS(call, seq, serial, flags, retrans, lose),
be832aec
DH
956
957 TP_STRUCT__entry(
a25e21f0 958 __field(unsigned int, call )
be832aec
DH
959 __field(rxrpc_seq_t, seq )
960 __field(rxrpc_serial_t, serial )
4764c0da
DH
961 __field(u32, cid )
962 __field(u32, call_id )
be832aec 963 __field(u8, flags )
a1767077 964 __field(bool, retrans )
be832aec
DH
965 __field(bool, lose )
966 ),
967
968 TP_fast_assign(
a25e21f0 969 __entry->call = call->debug_id;
4764c0da
DH
970 __entry->cid = call->cid;
971 __entry->call_id = call->call_id;
be832aec
DH
972 __entry->seq = seq;
973 __entry->serial = serial;
974 __entry->flags = flags;
a1767077 975 __entry->retrans = retrans;
be832aec
DH
976 __entry->lose = lose;
977 ),
978
4764c0da 979 TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s%s",
be832aec 980 __entry->call,
4764c0da
DH
981 __entry->cid,
982 __entry->call_id,
be832aec
DH
983 __entry->serial,
984 __entry->seq,
985 __entry->flags,
265a44bb 986 __entry->retrans ? " *RETRANS*" : "",
be832aec
DH
987 __entry->lose ? " *LOSE*" : "")
988 );
989
f3639df2 990TRACE_EVENT(rxrpc_tx_ack,
4764c0da 991 TP_PROTO(unsigned int call, rxrpc_serial_t serial,
be832aec
DH
992 rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
993 u8 reason, u8 n_acks),
f3639df2 994
be832aec 995 TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
f3639df2
DH
996
997 TP_STRUCT__entry(
a25e21f0 998 __field(unsigned int, call )
f3639df2 999 __field(rxrpc_serial_t, serial )
be832aec
DH
1000 __field(rxrpc_seq_t, ack_first )
1001 __field(rxrpc_serial_t, ack_serial )
f3639df2
DH
1002 __field(u8, reason )
1003 __field(u8, n_acks )
1004 ),
1005
1006 TP_fast_assign(
4764c0da 1007 __entry->call = call;
f3639df2 1008 __entry->serial = serial;
be832aec
DH
1009 __entry->ack_first = ack_first;
1010 __entry->ack_serial = ack_serial;
f3639df2
DH
1011 __entry->reason = reason;
1012 __entry->n_acks = n_acks;
1013 ),
1014
a25e21f0 1015 TP_printk(" c=%08x ACK %08x %s f=%08x r=%08x n=%u",
f3639df2 1016 __entry->call,
f3639df2 1017 __entry->serial,
b54a134a 1018 __print_symbolic(__entry->reason, rxrpc_ack_names),
be832aec
DH
1019 __entry->ack_first,
1020 __entry->ack_serial,
f3639df2
DH
1021 __entry->n_acks)
1022 );
1023
58dc63c9
DH
1024TRACE_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(
a25e21f0 1031 __field(unsigned int, call )
58dc63c9
DH
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(
a25e21f0 1040 __entry->call = call->debug_id;
58dc63c9
DH
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
a25e21f0 1048 TP_printk("c=%08x %s r=%08x q=%08x w=%08x-%08x",
58dc63c9 1049 __entry->call,
b54a134a 1050 __print_symbolic(__entry->why, rxrpc_receive_traces),
58dc63c9
DH
1051 __entry->serial,
1052 __entry->seq,
1053 __entry->hard_ack,
1054 __entry->top)
1055 );
1056
84997905
DH
1057TRACE_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(
a25e21f0 1065 __field(unsigned int, call )
84997905
DH
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(
a25e21f0 1074 __entry->call = call->debug_id;
84997905
DH
1075 __entry->why = why;
1076 __entry->seq = seq;
1077 __entry->offset = offset;
1078 __entry->len = len;
1079 __entry->ret = ret;
1080 ),
1081
a25e21f0 1082 TP_printk("c=%08x %s q=%08x o=%u l=%u ret=%d",
84997905 1083 __entry->call,
b54a134a 1084 __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
84997905
DH
1085 __entry->seq,
1086 __entry->offset,
1087 __entry->len,
1088 __entry->ret)
1089 );
1090
cf1a6474
DH
1091TRACE_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(
a25e21f0 1098 __field(unsigned int, call )
cf1a6474
DH
1099 __field(enum rxrpc_rtt_tx_trace, why )
1100 __field(rxrpc_serial_t, send_serial )
1101 ),
1102
1103 TP_fast_assign(
a25e21f0 1104 __entry->call = call->debug_id;
cf1a6474
DH
1105 __entry->why = why;
1106 __entry->send_serial = send_serial;
1107 ),
1108
a25e21f0 1109 TP_printk("c=%08x %s sr=%08x",
cf1a6474 1110 __entry->call,
b54a134a 1111 __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
cf1a6474
DH
1112 __entry->send_serial)
1113 );
1114
1115TRACE_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(
a25e21f0 1123 __field(unsigned int, call )
cf1a6474
DH
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(
a25e21f0 1133 __entry->call = call->debug_id;
cf1a6474
DH
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
a25e21f0 1142 TP_printk("c=%08x %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
cf1a6474 1143 __entry->call,
b54a134a 1144 __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
cf1a6474
DH
1145 __entry->send_serial,
1146 __entry->resp_serial,
1147 __entry->rtt,
1148 __entry->nr,
1149 __entry->avg)
1150 );
1151
fc7ab6d2
DH
1152TRACE_EVENT(rxrpc_timer,
1153 TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
a158bdd3 1154 unsigned long now),
fc7ab6d2 1155
a158bdd3 1156 TP_ARGS(call, why, now),
fc7ab6d2
DH
1157
1158 TP_STRUCT__entry(
a25e21f0 1159 __field(unsigned int, call )
fc7ab6d2 1160 __field(enum rxrpc_timer_trace, why )
a158bdd3
DH
1161 __field(long, now )
1162 __field(long, ack_at )
bd1fdf8c 1163 __field(long, ack_lost_at )
a158bdd3
DH
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 )
fc7ab6d2
DH
1170 ),
1171
1172 TP_fast_assign(
a25e21f0 1173 __entry->call = call->debug_id;
a158bdd3
DH
1174 __entry->why = why;
1175 __entry->now = now;
1176 __entry->ack_at = call->ack_at;
bd1fdf8c 1177 __entry->ack_lost_at = call->ack_lost_at;
a158bdd3
DH
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;
fc7ab6d2
DH
1183 ),
1184
a25e21f0 1185 TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
fc7ab6d2 1186 __entry->call,
b54a134a 1187 __print_symbolic(__entry->why, rxrpc_timer_traces),
a158bdd3 1188 __entry->ack_at - __entry->now,
bd1fdf8c 1189 __entry->ack_lost_at - __entry->now,
a158bdd3
DH
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)
fc7ab6d2
DH
1195 );
1196
89b475ab
DH
1197TRACE_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,
b54a134a
DH
1215 __entry->hdr.type <= 15 ?
1216 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
89b475ab
DH
1217 );
1218
9c7ad434
DH
1219TRACE_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(
a25e21f0 1228 __field(unsigned int, call )
9c7ad434
DH
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(
a25e21f0 1238 __entry->call = call->debug_id;
9c7ad434
DH
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
a25e21f0 1247 TP_printk("c=%08x %s %s r=%08x i=%u b=%u%s",
9c7ad434 1248 __entry->call,
b54a134a
DH
1249 __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1250 __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
9c7ad434
DH
1251 __entry->serial,
1252 __entry->immediate,
1253 __entry->background,
b54a134a 1254 __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
9c7ad434
DH
1255 );
1256
c6672e3f
DH
1257TRACE_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(
a25e21f0 1264 __field(unsigned int, call )
c6672e3f
DH
1265 __field(rxrpc_seq_t, seq )
1266 __field(u8, annotation )
1267 __field(s64, expiry )
1268 ),
1269
1270 TP_fast_assign(
a25e21f0 1271 __entry->call = call->debug_id;
c6672e3f
DH
1272 __entry->seq = seq;
1273 __entry->annotation = annotation;
1274 __entry->expiry = expiry;
1275 ),
1276
a25e21f0 1277 TP_printk("c=%08x q=%x a=%02x xp=%lld",
c6672e3f
DH
1278 __entry->call,
1279 __entry->seq,
1280 __entry->annotation,
1281 __entry->expiry)
1282 );
1283
57494343
DH
1284TRACE_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(
a25e21f0 1291 __field(unsigned int, call )
57494343
DH
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(
a25e21f0 1301 __entry->call = call->debug_id;
57494343
DH
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
a25e21f0 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",
57494343
DH
1311 __entry->call,
1312 __entry->ack_serial,
b54a134a 1313 __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
57494343 1314 __entry->hard_ack,
b54a134a 1315 __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
57494343
DH
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 ? "!" : "",
b54a134a 1325 __print_symbolic(__entry->change, rxrpc_congest_changes),
57494343
DH
1326 __entry->sum.retrans_timeo ? " rTxTo" : "")
1327 );
1328
b1d9f7fd
DH
1329TRACE_EVENT(rxrpc_disconnect_call,
1330 TP_PROTO(struct rxrpc_call *call),
1331
1332 TP_ARGS(call),
1333
1334 TP_STRUCT__entry(
a25e21f0 1335 __field(unsigned int, call )
b1d9f7fd
DH
1336 __field(u32, abort_code )
1337 ),
1338
1339 TP_fast_assign(
a25e21f0 1340 __entry->call = call->debug_id;
b1d9f7fd
DH
1341 __entry->abort_code = call->abort_code;
1342 ),
1343
a25e21f0 1344 TP_printk("c=%08x ab=%08x",
b1d9f7fd
DH
1345 __entry->call,
1346 __entry->abort_code)
1347 );
1348
1349TRACE_EVENT(rxrpc_improper_term,
1350 TP_PROTO(struct rxrpc_call *call),
1351
1352 TP_ARGS(call),
1353
1354 TP_STRUCT__entry(
a25e21f0 1355 __field(unsigned int, call )
b1d9f7fd
DH
1356 __field(u32, abort_code )
1357 ),
1358
1359 TP_fast_assign(
a25e21f0 1360 __entry->call = call->debug_id;
b1d9f7fd
DH
1361 __entry->abort_code = call->abort_code;
1362 ),
1363
a25e21f0 1364 TP_printk("c=%08x ab=%08x",
b1d9f7fd
DH
1365 __entry->call,
1366 __entry->abort_code)
1367 );
1368
fb46f6ee
DH
1369TRACE_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(
a25e21f0 1376 __field(unsigned int, call )
fb46f6ee
DH
1377 __field(rxrpc_serial_t, serial )
1378 __field(const char *, why )
1379 ),
1380
1381 TP_fast_assign(
a25e21f0 1382 __entry->call = call->debug_id;
fb46f6ee
DH
1383 __entry->serial = serial;
1384 __entry->why = why;
1385 ),
1386
a25e21f0 1387 TP_printk("c=%08x EPROTO %08x %s",
fb46f6ee
DH
1388 __entry->call,
1389 __entry->serial,
1390 __entry->why)
1391 );
1392
89ca6948
DH
1393TRACE_EVENT(rxrpc_connect_call,
1394 TP_PROTO(struct rxrpc_call *call),
1395
1396 TP_ARGS(call),
1397
1398 TP_STRUCT__entry(
a25e21f0 1399 __field(unsigned int, call )
89ca6948
DH
1400 __field(unsigned long, user_call_ID )
1401 __field(u32, cid )
1402 __field(u32, call_id )
1403 ),
1404
1405 TP_fast_assign(
a25e21f0 1406 __entry->call = call->debug_id;
89ca6948
DH
1407 __entry->user_call_ID = call->user_call_ID;
1408 __entry->cid = call->cid;
1409 __entry->call_id = call->call_id;
1410 ),
1411
a25e21f0 1412 TP_printk("c=%08x u=%p %08x:%08x",
89ca6948
DH
1413 __entry->call,
1414 (void *)__entry->user_call_ID,
1415 __entry->cid,
1416 __entry->call_id)
1417 );
1418
827efed6
DH
1419TRACE_EVENT(rxrpc_resend,
1420 TP_PROTO(struct rxrpc_call *call, int ix),
1421
1422 TP_ARGS(call, ix),
1423
1424 TP_STRUCT__entry(
a25e21f0 1425 __field(unsigned int, call )
827efed6
DH
1426 __field(int, ix )
1427 __array(u8, anno, 64 )
1428 ),
1429
1430 TP_fast_assign(
a25e21f0 1431 __entry->call = call->debug_id;
827efed6
DH
1432 __entry->ix = ix;
1433 memcpy(__entry->anno, call->rxtx_annotations, 64);
1434 ),
1435
a25e21f0 1436 TP_printk("c=%08x ix=%u a=%64phN",
827efed6
DH
1437 __entry->call,
1438 __entry->ix,
1439 __entry->anno)
1440 );
1441
494337c9
DH
1442TRACE_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
6b47fe1d
DH
1471TRACE_EVENT(rxrpc_tx_fail,
1472 TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret,
4764c0da 1473 enum rxrpc_tx_point where),
6b47fe1d 1474
4764c0da 1475 TP_ARGS(debug_id, serial, ret, where),
6b47fe1d
DH
1476
1477 TP_STRUCT__entry(
1478 __field(unsigned int, debug_id )
1479 __field(rxrpc_serial_t, serial )
1480 __field(int, ret )
4764c0da 1481 __field(enum rxrpc_tx_point, where )
6b47fe1d
DH
1482 ),
1483
1484 TP_fast_assign(
1485 __entry->debug_id = debug_id;
1486 __entry->serial = serial;
1487 __entry->ret = ret;
4764c0da 1488 __entry->where = where;
6b47fe1d
DH
1489 ),
1490
1491 TP_printk("c=%08x r=%x ret=%d %s",
1492 __entry->debug_id,
1493 __entry->serial,
1494 __entry->ret,
4764c0da 1495 __print_symbolic(__entry->where, rxrpc_tx_points))
6b47fe1d
DH
1496 );
1497
1a025028
DH
1498TRACE_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
4272d303
DH
1530TRACE_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
df844fd4
DH
1550#endif /* _TRACE_RXRPC_H */
1551
1552/* This part must be outside protection */
1553#include <trace/define_trace.h>