blob: a13a62db356553552d0f20871075715d854ada2c [file] [log] [blame]
Thomas Gleixnerb4d0d232019-05-20 19:08:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
David Howellsdf844fd2016-08-23 15:27:24 +01002/* AF_RXRPC tracepoints
3 *
4 * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
David Howellsdf844fd2016-08-23 15:27:24 +01006 */
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>
David Howells494337c2018-05-10 23:26:01 +010014#include <linux/errqueue.h>
David Howellsdf844fd2016-08-23 15:27:24 +010015
David Howellsb54a1342017-01-05 10:38:33 +000016/*
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 {
David Howells987db9f2019-08-19 09:25:38 +010026 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,
David Howellsd0d5c0c2019-08-27 10:13:46 +010035 rxrpc_skb_unshared,
36 rxrpc_skb_unshared_nomem,
David Howellsb54a1342017-01-05 10:38:33 +000037};
38
David Howells09d2bf52018-03-30 21:05:28 +010039enum 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
David Howells1159d4b2018-03-30 21:05:38 +010047enum rxrpc_peer_trace {
48 rxrpc_peer_got,
49 rxrpc_peer_new,
50 rxrpc_peer_processing,
51 rxrpc_peer_put,
David Howells1159d4b2018-03-30 21:05:38 +010052};
53
David Howellsb54a1342017-01-05 10:38:33 +000054enum 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,
David Howellsf859ab62017-11-24 10:18:42 +000061 rxrpc_conn_reap_service,
David Howellsb54a1342017-01-05 10:38:33 +000062 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,
David Howells930c9f92019-03-08 12:48:39 +000072 rxrpc_client_chan_wait_failed,
David Howellsb54a1342017-01-05 10:38:33 +000073 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,
David Howells540b1c42017-02-27 15:43:06 +0000133 rxrpc_recvmsg_requeue,
David Howellsb54a1342017-01-05 10:38:33 +0000134 rxrpc_recvmsg_return,
135 rxrpc_recvmsg_terminal,
136 rxrpc_recvmsg_to_be_accepted,
137 rxrpc_recvmsg_wait,
138};
139
140enum rxrpc_rtt_tx_trace {
141 rxrpc_rtt_tx_data,
142 rxrpc_rtt_tx_ping,
143};
144
145enum rxrpc_rtt_rx_trace {
146 rxrpc_rtt_rx_ping_response,
147 rxrpc_rtt_rx_requested_ack,
148};
149
150enum rxrpc_timer_trace {
151 rxrpc_timer_begin,
David Howellsa158bdd2017-11-24 10:18:41 +0000152 rxrpc_timer_exp_ack,
153 rxrpc_timer_exp_hard,
154 rxrpc_timer_exp_idle,
David Howells415f44e2017-11-24 10:18:42 +0000155 rxrpc_timer_exp_keepalive,
David Howellsbd1fdf82017-11-24 10:18:42 +0000156 rxrpc_timer_exp_lost_ack,
David Howellsa158bdd2017-11-24 10:18:41 +0000157 rxrpc_timer_exp_normal,
158 rxrpc_timer_exp_ping,
159 rxrpc_timer_exp_resend,
David Howellsb54a1342017-01-05 10:38:33 +0000160 rxrpc_timer_expired,
161 rxrpc_timer_init_for_reply,
162 rxrpc_timer_init_for_send_reply,
David Howellsa158bdd2017-11-24 10:18:41 +0000163 rxrpc_timer_restart,
David Howellsb54a1342017-01-05 10:38:33 +0000164 rxrpc_timer_set_for_ack,
David Howellsa158bdd2017-11-24 10:18:41 +0000165 rxrpc_timer_set_for_hard,
166 rxrpc_timer_set_for_idle,
David Howells415f44e2017-11-24 10:18:42 +0000167 rxrpc_timer_set_for_keepalive,
David Howellsbd1fdf82017-11-24 10:18:42 +0000168 rxrpc_timer_set_for_lost_ack,
David Howellsa158bdd2017-11-24 10:18:41 +0000169 rxrpc_timer_set_for_normal,
David Howellsb54a1342017-01-05 10:38:33 +0000170 rxrpc_timer_set_for_ping,
171 rxrpc_timer_set_for_resend,
172 rxrpc_timer_set_for_send,
173};
174
175enum rxrpc_propose_ack_trace {
176 rxrpc_propose_ack_client_tx_end,
177 rxrpc_propose_ack_input_data,
David Howells7150cea2018-11-12 22:33:22 +0000178 rxrpc_propose_ack_ping_for_check_life,
David Howells415f44e2017-11-24 10:18:42 +0000179 rxrpc_propose_ack_ping_for_keepalive,
David Howellsb54a1342017-01-05 10:38:33 +0000180 rxrpc_propose_ack_ping_for_lost_ack,
181 rxrpc_propose_ack_ping_for_lost_reply,
182 rxrpc_propose_ack_ping_for_params,
183 rxrpc_propose_ack_processing_op,
184 rxrpc_propose_ack_respond_to_ack,
185 rxrpc_propose_ack_respond_to_ping,
186 rxrpc_propose_ack_retry_tx,
187 rxrpc_propose_ack_rotate_rx,
188 rxrpc_propose_ack_terminal_ack,
189};
190
191enum rxrpc_propose_ack_outcome {
192 rxrpc_propose_ack_subsume,
193 rxrpc_propose_ack_update,
194 rxrpc_propose_ack_use,
195};
196
197enum rxrpc_congest_change {
198 rxrpc_cong_begin_retransmission,
199 rxrpc_cong_cleared_nacks,
200 rxrpc_cong_new_low_nack,
201 rxrpc_cong_no_change,
202 rxrpc_cong_progress,
203 rxrpc_cong_retransmit_again,
204 rxrpc_cong_rtt_window_end,
205 rxrpc_cong_saw_nack,
206};
207
David Howells4764c0d2018-07-23 17:18:37 +0100208enum rxrpc_tx_point {
209 rxrpc_tx_point_call_abort,
210 rxrpc_tx_point_call_ack,
211 rxrpc_tx_point_call_data_frag,
212 rxrpc_tx_point_call_data_nofrag,
213 rxrpc_tx_point_call_final_resend,
214 rxrpc_tx_point_conn_abort,
215 rxrpc_tx_point_rxkad_challenge,
216 rxrpc_tx_point_rxkad_response,
217 rxrpc_tx_point_reject,
218 rxrpc_tx_point_version_keepalive,
219 rxrpc_tx_point_version_reply,
David Howells6b47fe12018-05-10 23:26:01 +0100220};
221
David Howellsb54a1342017-01-05 10:38:33 +0000222#endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
223
224/*
225 * Declare tracing information enums and their string mappings for display.
226 */
227#define rxrpc_skb_traces \
David Howells987db9f2019-08-19 09:25:38 +0100228 EM(rxrpc_skb_cleaned, "CLN") \
229 EM(rxrpc_skb_freed, "FRE") \
230 EM(rxrpc_skb_got, "GOT") \
231 EM(rxrpc_skb_lost, "*L*") \
232 EM(rxrpc_skb_new, "NEW") \
233 EM(rxrpc_skb_purged, "PUR") \
234 EM(rxrpc_skb_received, "RCV") \
235 EM(rxrpc_skb_rotated, "ROT") \
David Howellsd0d5c0c2019-08-27 10:13:46 +0100236 EM(rxrpc_skb_seen, "SEE") \
237 EM(rxrpc_skb_unshared, "UNS") \
238 E_(rxrpc_skb_unshared_nomem, "US0")
David Howellsb54a1342017-01-05 10:38:33 +0000239
David Howells09d2bf52018-03-30 21:05:28 +0100240#define rxrpc_local_traces \
241 EM(rxrpc_local_got, "GOT") \
242 EM(rxrpc_local_new, "NEW") \
243 EM(rxrpc_local_processing, "PRO") \
244 EM(rxrpc_local_put, "PUT") \
245 E_(rxrpc_local_queued, "QUE")
246
David Howells1159d4b2018-03-30 21:05:38 +0100247#define rxrpc_peer_traces \
248 EM(rxrpc_peer_got, "GOT") \
249 EM(rxrpc_peer_new, "NEW") \
250 EM(rxrpc_peer_processing, "PRO") \
David Howellsf3344302018-09-27 15:13:09 +0100251 E_(rxrpc_peer_put, "PUT")
David Howells1159d4b2018-03-30 21:05:38 +0100252
David Howellsb54a1342017-01-05 10:38:33 +0000253#define rxrpc_conn_traces \
254 EM(rxrpc_conn_got, "GOT") \
255 EM(rxrpc_conn_new_client, "NWc") \
256 EM(rxrpc_conn_new_service, "NWs") \
257 EM(rxrpc_conn_put_client, "PTc") \
258 EM(rxrpc_conn_put_service, "PTs") \
259 EM(rxrpc_conn_queued, "QUE") \
David Howellsf859ab62017-11-24 10:18:42 +0000260 EM(rxrpc_conn_reap_service, "RPs") \
David Howellsb54a1342017-01-05 10:38:33 +0000261 E_(rxrpc_conn_seen, "SEE")
262
263#define rxrpc_client_traces \
264 EM(rxrpc_client_activate_chans, "Activa") \
265 EM(rxrpc_client_alloc, "Alloc ") \
266 EM(rxrpc_client_chan_activate, "ChActv") \
267 EM(rxrpc_client_chan_disconnect, "ChDisc") \
268 EM(rxrpc_client_chan_pass, "ChPass") \
269 EM(rxrpc_client_chan_unstarted, "ChUnst") \
David Howells930c9f92019-03-08 12:48:39 +0000270 EM(rxrpc_client_chan_wait_failed, "ChWtFl") \
David Howellsb54a1342017-01-05 10:38:33 +0000271 EM(rxrpc_client_cleanup, "Clean ") \
272 EM(rxrpc_client_count, "Count ") \
273 EM(rxrpc_client_discard, "Discar") \
274 EM(rxrpc_client_duplicate, "Duplic") \
275 EM(rxrpc_client_exposed, "Expose") \
276 EM(rxrpc_client_replace, "Replac") \
277 EM(rxrpc_client_to_active, "->Actv") \
278 EM(rxrpc_client_to_culled, "->Cull") \
279 EM(rxrpc_client_to_idle, "->Idle") \
280 EM(rxrpc_client_to_inactive, "->Inac") \
281 EM(rxrpc_client_to_upgrade, "->Upgd") \
282 EM(rxrpc_client_to_waiting, "->Wait") \
283 E_(rxrpc_client_uncount, "Uncoun")
284
285#define rxrpc_conn_cache_states \
286 EM(RXRPC_CONN_CLIENT_INACTIVE, "Inac") \
287 EM(RXRPC_CONN_CLIENT_WAITING, "Wait") \
288 EM(RXRPC_CONN_CLIENT_ACTIVE, "Actv") \
David Howells4e255722017-06-05 14:30:49 +0100289 EM(RXRPC_CONN_CLIENT_UPGRADE, "Upgd") \
David Howellsb54a1342017-01-05 10:38:33 +0000290 EM(RXRPC_CONN_CLIENT_CULLED, "Cull") \
291 E_(RXRPC_CONN_CLIENT_IDLE, "Idle") \
292
293#define rxrpc_call_traces \
294 EM(rxrpc_call_connected, "CON") \
295 EM(rxrpc_call_error, "*E*") \
296 EM(rxrpc_call_got, "GOT") \
297 EM(rxrpc_call_got_kernel, "Gke") \
298 EM(rxrpc_call_got_userid, "Gus") \
299 EM(rxrpc_call_new_client, "NWc") \
300 EM(rxrpc_call_new_service, "NWs") \
301 EM(rxrpc_call_put, "PUT") \
302 EM(rxrpc_call_put_kernel, "Pke") \
303 EM(rxrpc_call_put_noqueue, "PNQ") \
304 EM(rxrpc_call_put_userid, "Pus") \
305 EM(rxrpc_call_queued, "QUE") \
306 EM(rxrpc_call_queued_ref, "QUR") \
307 EM(rxrpc_call_release, "RLS") \
308 E_(rxrpc_call_seen, "SEE")
309
310#define rxrpc_transmit_traces \
311 EM(rxrpc_transmit_await_reply, "AWR") \
312 EM(rxrpc_transmit_end, "END") \
313 EM(rxrpc_transmit_queue, "QUE") \
314 EM(rxrpc_transmit_queue_last, "QLS") \
315 EM(rxrpc_transmit_rotate, "ROT") \
316 EM(rxrpc_transmit_rotate_last, "RLS") \
317 E_(rxrpc_transmit_wait, "WAI")
318
319#define rxrpc_receive_traces \
320 EM(rxrpc_receive_end, "END") \
321 EM(rxrpc_receive_front, "FRN") \
322 EM(rxrpc_receive_incoming, "INC") \
323 EM(rxrpc_receive_queue, "QUE") \
324 EM(rxrpc_receive_queue_last, "QLS") \
325 E_(rxrpc_receive_rotate, "ROT")
326
327#define rxrpc_recvmsg_traces \
328 EM(rxrpc_recvmsg_cont, "CONT") \
329 EM(rxrpc_recvmsg_data_return, "DATA") \
330 EM(rxrpc_recvmsg_dequeue, "DEQU") \
331 EM(rxrpc_recvmsg_enter, "ENTR") \
332 EM(rxrpc_recvmsg_full, "FULL") \
333 EM(rxrpc_recvmsg_hole, "HOLE") \
334 EM(rxrpc_recvmsg_next, "NEXT") \
David Howells540b1c42017-02-27 15:43:06 +0000335 EM(rxrpc_recvmsg_requeue, "REQU") \
David Howellsb54a1342017-01-05 10:38:33 +0000336 EM(rxrpc_recvmsg_return, "RETN") \
337 EM(rxrpc_recvmsg_terminal, "TERM") \
338 EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \
339 E_(rxrpc_recvmsg_wait, "WAIT")
340
341#define rxrpc_rtt_tx_traces \
342 EM(rxrpc_rtt_tx_data, "DATA") \
343 E_(rxrpc_rtt_tx_ping, "PING")
344
345#define rxrpc_rtt_rx_traces \
346 EM(rxrpc_rtt_rx_ping_response, "PONG") \
347 E_(rxrpc_rtt_rx_requested_ack, "RACK")
348
349#define rxrpc_timer_traces \
350 EM(rxrpc_timer_begin, "Begin ") \
351 EM(rxrpc_timer_expired, "*EXPR*") \
David Howellsa158bdd2017-11-24 10:18:41 +0000352 EM(rxrpc_timer_exp_ack, "ExpAck") \
353 EM(rxrpc_timer_exp_hard, "ExpHrd") \
354 EM(rxrpc_timer_exp_idle, "ExpIdl") \
David Howells415f44e2017-11-24 10:18:42 +0000355 EM(rxrpc_timer_exp_keepalive, "ExpKA ") \
David Howellsbd1fdf82017-11-24 10:18:42 +0000356 EM(rxrpc_timer_exp_lost_ack, "ExpLoA") \
David Howellsa158bdd2017-11-24 10:18:41 +0000357 EM(rxrpc_timer_exp_normal, "ExpNml") \
358 EM(rxrpc_timer_exp_ping, "ExpPng") \
359 EM(rxrpc_timer_exp_resend, "ExpRsn") \
David Howellsb54a1342017-01-05 10:38:33 +0000360 EM(rxrpc_timer_init_for_reply, "IniRpl") \
361 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
David Howellsa158bdd2017-11-24 10:18:41 +0000362 EM(rxrpc_timer_restart, "Restrt") \
David Howellsb54a1342017-01-05 10:38:33 +0000363 EM(rxrpc_timer_set_for_ack, "SetAck") \
David Howellsa158bdd2017-11-24 10:18:41 +0000364 EM(rxrpc_timer_set_for_hard, "SetHrd") \
365 EM(rxrpc_timer_set_for_idle, "SetIdl") \
David Howells415f44e2017-11-24 10:18:42 +0000366 EM(rxrpc_timer_set_for_keepalive, "KeepAl") \
David Howellsbd1fdf82017-11-24 10:18:42 +0000367 EM(rxrpc_timer_set_for_lost_ack, "SetLoA") \
David Howellsa158bdd2017-11-24 10:18:41 +0000368 EM(rxrpc_timer_set_for_normal, "SetNml") \
David Howellsb54a1342017-01-05 10:38:33 +0000369 EM(rxrpc_timer_set_for_ping, "SetPng") \
370 EM(rxrpc_timer_set_for_resend, "SetRTx") \
David Howellsa158bdd2017-11-24 10:18:41 +0000371 E_(rxrpc_timer_set_for_send, "SetSnd")
David Howellsb54a1342017-01-05 10:38:33 +0000372
373#define rxrpc_propose_ack_traces \
374 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
375 EM(rxrpc_propose_ack_input_data, "DataIn ") \
David Howells7150cea2018-11-12 22:33:22 +0000376 EM(rxrpc_propose_ack_ping_for_check_life, "ChkLife") \
David Howells415f44e2017-11-24 10:18:42 +0000377 EM(rxrpc_propose_ack_ping_for_keepalive, "KeepAlv") \
David Howellsb54a1342017-01-05 10:38:33 +0000378 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
379 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
380 EM(rxrpc_propose_ack_ping_for_params, "Params ") \
381 EM(rxrpc_propose_ack_processing_op, "ProcOp ") \
382 EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \
383 EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \
384 EM(rxrpc_propose_ack_retry_tx, "RetryTx") \
385 EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \
386 E_(rxrpc_propose_ack_terminal_ack, "ClTerm ")
387
388#define rxrpc_propose_ack_outcomes \
389 EM(rxrpc_propose_ack_subsume, " Subsume") \
390 EM(rxrpc_propose_ack_update, " Update") \
David Howells197445a2018-07-23 17:18:37 +0100391 E_(rxrpc_propose_ack_use, " New")
David Howellsb54a1342017-01-05 10:38:33 +0000392
393#define rxrpc_congest_modes \
394 EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \
395 EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \
396 EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \
397 E_(RXRPC_CALL_SLOW_START, "SlowStart")
398
399#define rxrpc_congest_changes \
400 EM(rxrpc_cong_begin_retransmission, " Retrans") \
401 EM(rxrpc_cong_cleared_nacks, " Cleared") \
402 EM(rxrpc_cong_new_low_nack, " NewLowN") \
403 EM(rxrpc_cong_no_change, "") \
404 EM(rxrpc_cong_progress, " Progres") \
405 EM(rxrpc_cong_retransmit_again, " ReTxAgn") \
406 EM(rxrpc_cong_rtt_window_end, " RttWinE") \
407 E_(rxrpc_cong_saw_nack, " SawNack")
408
409#define rxrpc_pkts \
410 EM(0, "?00") \
411 EM(RXRPC_PACKET_TYPE_DATA, "DATA") \
412 EM(RXRPC_PACKET_TYPE_ACK, "ACK") \
413 EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \
414 EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \
415 EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \
416 EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \
417 EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \
418 EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \
419 EM(9, "?09") \
420 EM(10, "?10") \
421 EM(11, "?11") \
422 EM(12, "?12") \
423 EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \
424 EM(14, "?14") \
425 E_(15, "?15")
426
427#define rxrpc_ack_names \
428 EM(0, "-0-") \
429 EM(RXRPC_ACK_REQUESTED, "REQ") \
430 EM(RXRPC_ACK_DUPLICATE, "DUP") \
431 EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \
432 EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \
433 EM(RXRPC_ACK_NOSPACE, "MEM") \
434 EM(RXRPC_ACK_PING, "PNG") \
435 EM(RXRPC_ACK_PING_RESPONSE, "PNR") \
436 EM(RXRPC_ACK_DELAY, "DLY") \
437 EM(RXRPC_ACK_IDLE, "IDL") \
438 E_(RXRPC_ACK__INVALID, "-?-")
439
David Howells1bae5d22018-03-27 23:08:20 +0100440#define rxrpc_completions \
441 EM(RXRPC_CALL_SUCCEEDED, "Succeeded") \
442 EM(RXRPC_CALL_REMOTELY_ABORTED, "RemoteAbort") \
443 EM(RXRPC_CALL_LOCALLY_ABORTED, "LocalAbort") \
444 EM(RXRPC_CALL_LOCAL_ERROR, "LocalError") \
445 E_(RXRPC_CALL_NETWORK_ERROR, "NetError")
446
David Howells4764c0d2018-07-23 17:18:37 +0100447#define rxrpc_tx_points \
448 EM(rxrpc_tx_point_call_abort, "CallAbort") \
449 EM(rxrpc_tx_point_call_ack, "CallAck") \
450 EM(rxrpc_tx_point_call_data_frag, "CallDataFrag") \
451 EM(rxrpc_tx_point_call_data_nofrag, "CallDataNofrag") \
452 EM(rxrpc_tx_point_call_final_resend, "CallFinalResend") \
453 EM(rxrpc_tx_point_conn_abort, "ConnAbort") \
454 EM(rxrpc_tx_point_reject, "Reject") \
455 EM(rxrpc_tx_point_rxkad_challenge, "RxkadChall") \
456 EM(rxrpc_tx_point_rxkad_response, "RxkadResp") \
457 EM(rxrpc_tx_point_version_keepalive, "VerKeepalive") \
458 E_(rxrpc_tx_point_version_reply, "VerReply")
David Howells6b47fe12018-05-10 23:26:01 +0100459
David Howellsb54a1342017-01-05 10:38:33 +0000460/*
461 * Export enum symbols via userspace.
462 */
463#undef EM
464#undef E_
465#define EM(a, b) TRACE_DEFINE_ENUM(a);
466#define E_(a, b) TRACE_DEFINE_ENUM(a);
467
468rxrpc_skb_traces;
David Howells09d2bf52018-03-30 21:05:28 +0100469rxrpc_local_traces;
David Howellsb54a1342017-01-05 10:38:33 +0000470rxrpc_conn_traces;
471rxrpc_client_traces;
472rxrpc_call_traces;
473rxrpc_transmit_traces;
474rxrpc_receive_traces;
475rxrpc_recvmsg_traces;
476rxrpc_rtt_tx_traces;
477rxrpc_rtt_rx_traces;
478rxrpc_timer_traces;
479rxrpc_propose_ack_traces;
480rxrpc_propose_ack_outcomes;
David Howells827efed2018-03-27 23:02:47 +0100481rxrpc_congest_modes;
David Howellsb54a1342017-01-05 10:38:33 +0000482rxrpc_congest_changes;
David Howells4764c0d2018-07-23 17:18:37 +0100483rxrpc_tx_points;
David Howellsb54a1342017-01-05 10:38:33 +0000484
485/*
486 * Now redefine the EM() and E_() macros to map the enums to the strings that
487 * will be printed in the output.
488 */
489#undef EM
490#undef E_
491#define EM(a, b) { a, b },
492#define E_(a, b) { a, b }
493
David Howells09d2bf52018-03-30 21:05:28 +0100494TRACE_EVENT(rxrpc_local,
David Howells06d95322019-08-13 22:26:36 +0100495 TP_PROTO(unsigned int local_debug_id, enum rxrpc_local_trace op,
David Howells09d2bf52018-03-30 21:05:28 +0100496 int usage, const void *where),
497
David Howells06d95322019-08-13 22:26:36 +0100498 TP_ARGS(local_debug_id, op, usage, where),
David Howells09d2bf52018-03-30 21:05:28 +0100499
500 TP_STRUCT__entry(
501 __field(unsigned int, local )
502 __field(int, op )
503 __field(int, usage )
504 __field(const void *, where )
505 ),
506
507 TP_fast_assign(
David Howells06d95322019-08-13 22:26:36 +0100508 __entry->local = local_debug_id;
David Howells09d2bf52018-03-30 21:05:28 +0100509 __entry->op = op;
510 __entry->usage = usage;
511 __entry->where = where;
512 ),
513
514 TP_printk("L=%08x %s u=%d sp=%pSR",
515 __entry->local,
516 __print_symbolic(__entry->op, rxrpc_local_traces),
517 __entry->usage,
518 __entry->where)
519 );
520
David Howells1159d4b2018-03-30 21:05:38 +0100521TRACE_EVENT(rxrpc_peer,
522 TP_PROTO(struct rxrpc_peer *peer, enum rxrpc_peer_trace op,
523 int usage, const void *where),
524
525 TP_ARGS(peer, op, usage, where),
526
527 TP_STRUCT__entry(
528 __field(unsigned int, peer )
529 __field(int, op )
530 __field(int, usage )
531 __field(const void *, where )
532 ),
533
534 TP_fast_assign(
535 __entry->peer = peer->debug_id;
536 __entry->op = op;
537 __entry->usage = usage;
538 __entry->where = where;
539 ),
540
541 TP_printk("P=%08x %s u=%d sp=%pSR",
542 __entry->peer,
543 __print_symbolic(__entry->op, rxrpc_peer_traces),
544 __entry->usage,
545 __entry->where)
546 );
547
David Howells363deea2016-09-17 10:49:14 +0100548TRACE_EVENT(rxrpc_conn,
549 TP_PROTO(struct rxrpc_connection *conn, enum rxrpc_conn_trace op,
550 int usage, const void *where),
551
552 TP_ARGS(conn, op, usage, where),
553
554 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100555 __field(unsigned int, conn )
556 __field(int, op )
557 __field(int, usage )
558 __field(const void *, where )
David Howells363deea2016-09-17 10:49:14 +0100559 ),
560
561 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +0100562 __entry->conn = conn->debug_id;
David Howells363deea2016-09-17 10:49:14 +0100563 __entry->op = op;
564 __entry->usage = usage;
565 __entry->where = where;
566 ),
567
David Howellsa25e21f2018-03-27 23:03:00 +0100568 TP_printk("C=%08x %s u=%d sp=%pSR",
David Howells363deea2016-09-17 10:49:14 +0100569 __entry->conn,
David Howellsb54a1342017-01-05 10:38:33 +0000570 __print_symbolic(__entry->op, rxrpc_conn_traces),
David Howells363deea2016-09-17 10:49:14 +0100571 __entry->usage,
572 __entry->where)
573 );
574
575TRACE_EVENT(rxrpc_client,
576 TP_PROTO(struct rxrpc_connection *conn, int channel,
577 enum rxrpc_client_trace op),
578
579 TP_ARGS(conn, channel, op),
580
581 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100582 __field(unsigned int, conn )
David Howells363deea2016-09-17 10:49:14 +0100583 __field(u32, cid )
584 __field(int, channel )
585 __field(int, usage )
586 __field(enum rxrpc_client_trace, op )
587 __field(enum rxrpc_conn_cache_state, cs )
588 ),
589
590 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +0100591 __entry->conn = conn->debug_id;
David Howells363deea2016-09-17 10:49:14 +0100592 __entry->channel = channel;
593 __entry->usage = atomic_read(&conn->usage);
594 __entry->op = op;
595 __entry->cid = conn->proto.cid;
596 __entry->cs = conn->cache_state;
597 ),
598
David Howellsa25e21f2018-03-27 23:03:00 +0100599 TP_printk("C=%08x h=%2d %s %s i=%08x u=%d",
David Howells363deea2016-09-17 10:49:14 +0100600 __entry->conn,
601 __entry->channel,
David Howellsb54a1342017-01-05 10:38:33 +0000602 __print_symbolic(__entry->op, rxrpc_client_traces),
603 __print_symbolic(__entry->cs, rxrpc_conn_cache_states),
David Howells363deea2016-09-17 10:49:14 +0100604 __entry->cid,
605 __entry->usage)
606 );
607
David Howellse34d4232016-08-30 09:49:29 +0100608TRACE_EVENT(rxrpc_call,
David Howellsfff724292016-09-07 14:34:21 +0100609 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
David Howells2ab27212016-09-08 11:10:12 +0100610 int usage, const void *where, const void *aux),
David Howellse34d4232016-08-30 09:49:29 +0100611
David Howells2ab27212016-09-08 11:10:12 +0100612 TP_ARGS(call, op, usage, where, aux),
David Howellse34d4232016-08-30 09:49:29 +0100613
614 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100615 __field(unsigned int, call )
David Howellse34d4232016-08-30 09:49:29 +0100616 __field(int, op )
617 __field(int, usage )
David Howellse34d4232016-08-30 09:49:29 +0100618 __field(const void *, where )
619 __field(const void *, aux )
620 ),
621
622 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +0100623 __entry->call = call->debug_id;
David Howellse34d4232016-08-30 09:49:29 +0100624 __entry->op = op;
625 __entry->usage = usage;
David Howellse34d4232016-08-30 09:49:29 +0100626 __entry->where = where;
627 __entry->aux = aux;
628 ),
629
David Howellsa25e21f2018-03-27 23:03:00 +0100630 TP_printk("c=%08x %s u=%d sp=%pSR a=%p",
David Howellse34d4232016-08-30 09:49:29 +0100631 __entry->call,
David Howellsb54a1342017-01-05 10:38:33 +0000632 __print_symbolic(__entry->op, rxrpc_call_traces),
David Howellse34d4232016-08-30 09:49:29 +0100633 __entry->usage,
David Howellse34d4232016-08-30 09:49:29 +0100634 __entry->where,
635 __entry->aux)
636 );
637
David Howellsdf844fd2016-08-23 15:27:24 +0100638TRACE_EVENT(rxrpc_skb,
David Howells71f3ca42016-09-17 10:49:14 +0100639 TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
David Howellsd0d5c0c2019-08-27 10:13:46 +0100640 int usage, int mod_count, u8 flags, const void *where),
David Howellsdf844fd2016-08-23 15:27:24 +0100641
David Howellsd0d5c0c2019-08-27 10:13:46 +0100642 TP_ARGS(skb, op, usage, mod_count, flags, where),
David Howellsdf844fd2016-08-23 15:27:24 +0100643
644 TP_STRUCT__entry(
645 __field(struct sk_buff *, skb )
David Howells71f3ca42016-09-17 10:49:14 +0100646 __field(enum rxrpc_skb_trace, op )
David Howells987db9f2019-08-19 09:25:38 +0100647 __field(u8, flags )
David Howellsdf844fd2016-08-23 15:27:24 +0100648 __field(int, usage )
649 __field(int, mod_count )
650 __field(const void *, where )
651 ),
652
653 TP_fast_assign(
654 __entry->skb = skb;
David Howellsd0d5c0c2019-08-27 10:13:46 +0100655 __entry->flags = flags;
David Howellsdf844fd2016-08-23 15:27:24 +0100656 __entry->op = op;
657 __entry->usage = usage;
658 __entry->mod_count = mod_count;
659 __entry->where = where;
660 ),
661
David Howells987db9f2019-08-19 09:25:38 +0100662 TP_printk("s=%p %cx %s u=%d m=%d p=%pSR",
David Howellsdf844fd2016-08-23 15:27:24 +0100663 __entry->skb,
David Howells987db9f2019-08-19 09:25:38 +0100664 __entry->flags & RXRPC_SKB_TX_BUFFER ? 'T' : 'R',
David Howellsb54a1342017-01-05 10:38:33 +0000665 __print_symbolic(__entry->op, rxrpc_skb_traces),
David Howellsdf844fd2016-08-23 15:27:24 +0100666 __entry->usage,
667 __entry->mod_count,
668 __entry->where)
669 );
670
David Howells49e19ec2016-09-08 11:10:12 +0100671TRACE_EVENT(rxrpc_rx_packet,
672 TP_PROTO(struct rxrpc_skb_priv *sp),
673
674 TP_ARGS(sp),
675
676 TP_STRUCT__entry(
677 __field_struct(struct rxrpc_host_header, hdr )
678 ),
679
680 TP_fast_assign(
681 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
682 ),
683
David Howellsa3868bf2016-09-17 10:49:13 +0100684 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
David Howells49e19ec2016-09-08 11:10:12 +0100685 __entry->hdr.epoch, __entry->hdr.cid,
686 __entry->hdr.callNumber, __entry->hdr.serviceId,
687 __entry->hdr.serial, __entry->hdr.seq,
David Howellsa3868bf2016-09-17 10:49:13 +0100688 __entry->hdr.type, __entry->hdr.flags,
David Howellsb54a1342017-01-05 10:38:33 +0000689 __entry->hdr.type <= 15 ?
690 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
David Howells49e19ec2016-09-08 11:10:12 +0100691 );
692
693TRACE_EVENT(rxrpc_rx_done,
694 TP_PROTO(int result, int abort_code),
695
696 TP_ARGS(result, abort_code),
697
698 TP_STRUCT__entry(
699 __field(int, result )
700 __field(int, abort_code )
701 ),
702
703 TP_fast_assign(
704 __entry->result = result;
705 __entry->abort_code = abort_code;
706 ),
707
708 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
709 );
710
David Howells5a429762016-09-06 22:19:51 +0100711TRACE_EVENT(rxrpc_abort,
David Howellsa25e21f2018-03-27 23:03:00 +0100712 TP_PROTO(unsigned int call_nr, const char *why, u32 cid, u32 call_id,
713 rxrpc_seq_t seq, int abort_code, int error),
David Howells5a429762016-09-06 22:19:51 +0100714
David Howellsa25e21f2018-03-27 23:03:00 +0100715 TP_ARGS(call_nr, why, cid, call_id, seq, abort_code, error),
David Howells5a429762016-09-06 22:19:51 +0100716
717 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100718 __field(unsigned int, call_nr )
David Howells5a429762016-09-06 22:19:51 +0100719 __array(char, why, 4 )
720 __field(u32, cid )
721 __field(u32, call_id )
722 __field(rxrpc_seq_t, seq )
723 __field(int, abort_code )
724 __field(int, error )
725 ),
726
727 TP_fast_assign(
728 memcpy(__entry->why, why, 4);
David Howellsa25e21f2018-03-27 23:03:00 +0100729 __entry->call_nr = call_nr;
David Howells5a429762016-09-06 22:19:51 +0100730 __entry->cid = cid;
731 __entry->call_id = call_id;
732 __entry->abort_code = abort_code;
733 __entry->error = error;
734 __entry->seq = seq;
735 ),
736
David Howellsa25e21f2018-03-27 23:03:00 +0100737 TP_printk("c=%08x %08x:%08x s=%u a=%d e=%d %s",
738 __entry->call_nr,
David Howells5a429762016-09-06 22:19:51 +0100739 __entry->cid, __entry->call_id, __entry->seq,
740 __entry->abort_code, __entry->error, __entry->why)
741 );
742
David Howells1bae5d22018-03-27 23:08:20 +0100743TRACE_EVENT(rxrpc_call_complete,
744 TP_PROTO(struct rxrpc_call *call),
745
746 TP_ARGS(call),
747
748 TP_STRUCT__entry(
749 __field(unsigned int, call )
750 __field(enum rxrpc_call_completion, compl )
751 __field(int, error )
752 __field(u32, abort_code )
753 ),
754
755 TP_fast_assign(
756 __entry->call = call->debug_id;
757 __entry->compl = call->completion;
758 __entry->error = call->error;
759 __entry->abort_code = call->abort_code;
760 ),
761
762 TP_printk("c=%08x %s r=%d ac=%d",
763 __entry->call,
764 __print_symbolic(__entry->compl, rxrpc_completions),
765 __entry->error,
766 __entry->abort_code)
767 );
768
David Howellsa124fe32016-09-17 10:49:13 +0100769TRACE_EVENT(rxrpc_transmit,
770 TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
771
772 TP_ARGS(call, why),
773
774 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100775 __field(unsigned int, call )
David Howellsa124fe32016-09-17 10:49:13 +0100776 __field(enum rxrpc_transmit_trace, why )
777 __field(rxrpc_seq_t, tx_hard_ack )
778 __field(rxrpc_seq_t, tx_top )
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000779 __field(int, tx_winsize )
David Howellsa124fe32016-09-17 10:49:13 +0100780 ),
781
782 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +0100783 __entry->call = call->debug_id;
David Howellsa124fe32016-09-17 10:49:13 +0100784 __entry->why = why;
785 __entry->tx_hard_ack = call->tx_hard_ack;
786 __entry->tx_top = call->tx_top;
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000787 __entry->tx_winsize = call->tx_winsize;
David Howellsa124fe32016-09-17 10:49:13 +0100788 ),
789
David Howellsa25e21f2018-03-27 23:03:00 +0100790 TP_printk("c=%08x %s f=%08x n=%u/%u",
David Howellsa124fe32016-09-17 10:49:13 +0100791 __entry->call,
David Howellsb54a1342017-01-05 10:38:33 +0000792 __print_symbolic(__entry->why, rxrpc_transmit_traces),
David Howellsa124fe32016-09-17 10:49:13 +0100793 __entry->tx_hard_ack + 1,
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000794 __entry->tx_top - __entry->tx_hard_ack,
795 __entry->tx_winsize)
David Howellsa124fe32016-09-17 10:49:13 +0100796 );
797
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000798TRACE_EVENT(rxrpc_rx_data,
David Howells4764c0d2018-07-23 17:18:37 +0100799 TP_PROTO(unsigned int call, rxrpc_seq_t seq,
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000800 rxrpc_serial_t serial, u8 flags, u8 anno),
David Howellsec71eb92016-09-17 10:49:13 +0100801
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000802 TP_ARGS(call, seq, serial, flags, anno),
David Howellsec71eb92016-09-17 10:49:13 +0100803
804 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100805 __field(unsigned int, call )
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000806 __field(rxrpc_seq_t, seq )
807 __field(rxrpc_serial_t, serial )
808 __field(u8, flags )
809 __field(u8, anno )
810 ),
811
812 TP_fast_assign(
David Howells4764c0d2018-07-23 17:18:37 +0100813 __entry->call = call;
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000814 __entry->seq = seq;
815 __entry->serial = serial;
816 __entry->flags = flags;
817 __entry->anno = anno;
818 ),
819
David Howellsa25e21f2018-03-27 23:03:00 +0100820 TP_printk("c=%08x DATA %08x q=%08x fl=%02x a=%02x",
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000821 __entry->call,
822 __entry->serial,
823 __entry->seq,
824 __entry->flags,
825 __entry->anno)
826 );
827
828TRACE_EVENT(rxrpc_rx_ack,
829 TP_PROTO(struct rxrpc_call *call,
830 rxrpc_serial_t serial, rxrpc_serial_t ack_serial,
831 rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks),
832
833 TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
834
835 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100836 __field(unsigned int, call )
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000837 __field(rxrpc_serial_t, serial )
838 __field(rxrpc_serial_t, ack_serial )
David Howellsec71eb92016-09-17 10:49:13 +0100839 __field(rxrpc_seq_t, first )
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000840 __field(rxrpc_seq_t, prev )
David Howellsec71eb92016-09-17 10:49:13 +0100841 __field(u8, reason )
842 __field(u8, n_acks )
843 ),
844
845 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +0100846 __entry->call = call->debug_id;
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000847 __entry->serial = serial;
848 __entry->ack_serial = ack_serial;
David Howellsec71eb92016-09-17 10:49:13 +0100849 __entry->first = first;
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000850 __entry->prev = prev;
David Howellsec71eb92016-09-17 10:49:13 +0100851 __entry->reason = reason;
852 __entry->n_acks = n_acks;
853 ),
854
David Howellsa25e21f2018-03-27 23:03:00 +0100855 TP_printk("c=%08x %08x %s r=%08x f=%08x p=%08x n=%u",
David Howellsec71eb92016-09-17 10:49:13 +0100856 __entry->call,
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000857 __entry->serial,
David Howellsb54a1342017-01-05 10:38:33 +0000858 __print_symbolic(__entry->reason, rxrpc_ack_names),
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000859 __entry->ack_serial,
David Howellsec71eb92016-09-17 10:49:13 +0100860 __entry->first,
David Howellsb1d9f7fd2017-01-05 10:38:34 +0000861 __entry->prev,
David Howellsec71eb92016-09-17 10:49:13 +0100862 __entry->n_acks)
863 );
864
David Howells005ede22017-04-06 10:12:00 +0100865TRACE_EVENT(rxrpc_rx_abort,
866 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
867 u32 abort_code),
868
869 TP_ARGS(call, serial, abort_code),
870
871 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100872 __field(unsigned int, call )
David Howells005ede22017-04-06 10:12:00 +0100873 __field(rxrpc_serial_t, serial )
874 __field(u32, abort_code )
875 ),
876
877 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +0100878 __entry->call = call->debug_id;
David Howells005ede22017-04-06 10:12:00 +0100879 __entry->serial = serial;
880 __entry->abort_code = abort_code;
881 ),
882
David Howellsa25e21f2018-03-27 23:03:00 +0100883 TP_printk("c=%08x ABORT %08x ac=%d",
David Howells005ede22017-04-06 10:12:00 +0100884 __entry->call,
885 __entry->serial,
886 __entry->abort_code)
887 );
888
David Howells740586d2017-04-06 10:12:00 +0100889TRACE_EVENT(rxrpc_rx_rwind_change,
890 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
891 u32 rwind, bool wake),
892
893 TP_ARGS(call, serial, rwind, wake),
894
895 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100896 __field(unsigned int, call )
David Howells740586d2017-04-06 10:12:00 +0100897 __field(rxrpc_serial_t, serial )
898 __field(u32, rwind )
899 __field(bool, wake )
900 ),
901
902 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +0100903 __entry->call = call->debug_id;
David Howells740586d2017-04-06 10:12:00 +0100904 __entry->serial = serial;
905 __entry->rwind = rwind;
906 __entry->wake = wake;
907 ),
908
David Howellsa25e21f2018-03-27 23:03:00 +0100909 TP_printk("c=%08x %08x rw=%u%s",
David Howells740586d2017-04-06 10:12:00 +0100910 __entry->call,
911 __entry->serial,
912 __entry->rwind,
913 __entry->wake ? " wake" : "")
914 );
915
David Howells4764c0d2018-07-23 17:18:37 +0100916TRACE_EVENT(rxrpc_tx_packet,
917 TP_PROTO(unsigned int call_id, struct rxrpc_wire_header *whdr,
918 enum rxrpc_tx_point where),
919
920 TP_ARGS(call_id, whdr, where),
921
922 TP_STRUCT__entry(
923 __field(unsigned int, call )
924 __field(enum rxrpc_tx_point, where )
925 __field_struct(struct rxrpc_wire_header, whdr )
926 ),
927
928 TP_fast_assign(
929 __entry->call = call_id;
930 memcpy(&__entry->whdr, whdr, sizeof(__entry->whdr));
David Howells4e2abd32018-10-08 19:44:39 +0100931 __entry->where = where;
David Howells4764c0d2018-07-23 17:18:37 +0100932 ),
933
934 TP_printk("c=%08x %08x:%08x:%08x:%04x %08x %08x %02x %02x %s %s",
935 __entry->call,
936 ntohl(__entry->whdr.epoch),
937 ntohl(__entry->whdr.cid),
938 ntohl(__entry->whdr.callNumber),
939 ntohs(__entry->whdr.serviceId),
940 ntohl(__entry->whdr.serial),
941 ntohl(__entry->whdr.seq),
942 __entry->whdr.type, __entry->whdr.flags,
943 __entry->whdr.type <= 15 ?
944 __print_symbolic(__entry->whdr.type, rxrpc_pkts) : "?UNK",
945 __print_symbolic(__entry->where, rxrpc_tx_points))
946 );
947
David Howellsbe832ae2016-09-23 12:39:22 +0100948TRACE_EVENT(rxrpc_tx_data,
949 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
David Howellsa1767072016-09-29 22:37:15 +0100950 rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
David Howellsf3639df2016-09-17 10:49:13 +0100951
David Howellsa1767072016-09-29 22:37:15 +0100952 TP_ARGS(call, seq, serial, flags, retrans, lose),
David Howellsf3639df2016-09-17 10:49:13 +0100953
954 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100955 __field(unsigned int, call )
David Howellsbe832ae2016-09-23 12:39:22 +0100956 __field(rxrpc_seq_t, seq )
David Howellsf3639df2016-09-17 10:49:13 +0100957 __field(rxrpc_serial_t, serial )
David Howells4764c0d2018-07-23 17:18:37 +0100958 __field(u32, cid )
959 __field(u32, call_id )
David Howellsbe832ae2016-09-23 12:39:22 +0100960 __field(u8, flags )
David Howellsa1767072016-09-29 22:37:15 +0100961 __field(bool, retrans )
David Howellsbe832ae2016-09-23 12:39:22 +0100962 __field(bool, lose )
963 ),
964
965 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +0100966 __entry->call = call->debug_id;
David Howells4764c0d2018-07-23 17:18:37 +0100967 __entry->cid = call->cid;
968 __entry->call_id = call->call_id;
David Howellsbe832ae2016-09-23 12:39:22 +0100969 __entry->seq = seq;
970 __entry->serial = serial;
971 __entry->flags = flags;
David Howellsa1767072016-09-29 22:37:15 +0100972 __entry->retrans = retrans;
David Howellsbe832ae2016-09-23 12:39:22 +0100973 __entry->lose = lose;
974 ),
975
David Howells4764c0d2018-07-23 17:18:37 +0100976 TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s%s",
David Howellsbe832ae2016-09-23 12:39:22 +0100977 __entry->call,
David Howells4764c0d2018-07-23 17:18:37 +0100978 __entry->cid,
979 __entry->call_id,
David Howellsbe832ae2016-09-23 12:39:22 +0100980 __entry->serial,
981 __entry->seq,
982 __entry->flags,
David Howells265a44b2016-09-30 08:50:42 +0100983 __entry->retrans ? " *RETRANS*" : "",
David Howellsbe832ae2016-09-23 12:39:22 +0100984 __entry->lose ? " *LOSE*" : "")
985 );
986
987TRACE_EVENT(rxrpc_tx_ack,
David Howells4764c0d2018-07-23 17:18:37 +0100988 TP_PROTO(unsigned int call, rxrpc_serial_t serial,
David Howellsbe832ae2016-09-23 12:39:22 +0100989 rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
990 u8 reason, u8 n_acks),
991
992 TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
993
994 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +0100995 __field(unsigned int, call )
David Howellsbe832ae2016-09-23 12:39:22 +0100996 __field(rxrpc_serial_t, serial )
997 __field(rxrpc_seq_t, ack_first )
998 __field(rxrpc_serial_t, ack_serial )
David Howellsf3639df2016-09-17 10:49:13 +0100999 __field(u8, reason )
1000 __field(u8, n_acks )
1001 ),
1002
1003 TP_fast_assign(
David Howells4764c0d2018-07-23 17:18:37 +01001004 __entry->call = call;
David Howellsf3639df2016-09-17 10:49:13 +01001005 __entry->serial = serial;
David Howellsbe832ae2016-09-23 12:39:22 +01001006 __entry->ack_first = ack_first;
1007 __entry->ack_serial = ack_serial;
David Howellsf3639df2016-09-17 10:49:13 +01001008 __entry->reason = reason;
1009 __entry->n_acks = n_acks;
1010 ),
1011
David Howellsa25e21f2018-03-27 23:03:00 +01001012 TP_printk(" c=%08x ACK %08x %s f=%08x r=%08x n=%u",
David Howellsf3639df2016-09-17 10:49:13 +01001013 __entry->call,
David Howellsf3639df2016-09-17 10:49:13 +01001014 __entry->serial,
David Howellsb54a1342017-01-05 10:38:33 +00001015 __print_symbolic(__entry->reason, rxrpc_ack_names),
David Howellsbe832ae2016-09-23 12:39:22 +01001016 __entry->ack_first,
1017 __entry->ack_serial,
David Howellsf3639df2016-09-17 10:49:13 +01001018 __entry->n_acks)
1019 );
1020
David Howells58dc63c2016-09-17 10:49:13 +01001021TRACE_EVENT(rxrpc_receive,
1022 TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
1023 rxrpc_serial_t serial, rxrpc_seq_t seq),
1024
1025 TP_ARGS(call, why, serial, seq),
1026
1027 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001028 __field(unsigned int, call )
David Howells58dc63c2016-09-17 10:49:13 +01001029 __field(enum rxrpc_receive_trace, why )
1030 __field(rxrpc_serial_t, serial )
1031 __field(rxrpc_seq_t, seq )
1032 __field(rxrpc_seq_t, hard_ack )
1033 __field(rxrpc_seq_t, top )
1034 ),
1035
1036 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001037 __entry->call = call->debug_id;
David Howells58dc63c2016-09-17 10:49:13 +01001038 __entry->why = why;
1039 __entry->serial = serial;
1040 __entry->seq = seq;
1041 __entry->hard_ack = call->rx_hard_ack;
1042 __entry->top = call->rx_top;
1043 ),
1044
David Howellsa25e21f2018-03-27 23:03:00 +01001045 TP_printk("c=%08x %s r=%08x q=%08x w=%08x-%08x",
David Howells58dc63c2016-09-17 10:49:13 +01001046 __entry->call,
David Howellsb54a1342017-01-05 10:38:33 +00001047 __print_symbolic(__entry->why, rxrpc_receive_traces),
David Howells58dc63c2016-09-17 10:49:13 +01001048 __entry->serial,
1049 __entry->seq,
1050 __entry->hard_ack,
1051 __entry->top)
1052 );
1053
David Howells84997902016-09-17 11:13:31 +01001054TRACE_EVENT(rxrpc_recvmsg,
1055 TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
1056 rxrpc_seq_t seq, unsigned int offset, unsigned int len,
1057 int ret),
1058
1059 TP_ARGS(call, why, seq, offset, len, ret),
1060
1061 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001062 __field(unsigned int, call )
David Howells84997902016-09-17 11:13:31 +01001063 __field(enum rxrpc_recvmsg_trace, why )
1064 __field(rxrpc_seq_t, seq )
1065 __field(unsigned int, offset )
1066 __field(unsigned int, len )
1067 __field(int, ret )
1068 ),
1069
1070 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001071 __entry->call = call->debug_id;
David Howells84997902016-09-17 11:13:31 +01001072 __entry->why = why;
1073 __entry->seq = seq;
1074 __entry->offset = offset;
1075 __entry->len = len;
1076 __entry->ret = ret;
1077 ),
1078
David Howellsa25e21f2018-03-27 23:03:00 +01001079 TP_printk("c=%08x %s q=%08x o=%u l=%u ret=%d",
David Howells84997902016-09-17 11:13:31 +01001080 __entry->call,
David Howellsb54a1342017-01-05 10:38:33 +00001081 __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
David Howells84997902016-09-17 11:13:31 +01001082 __entry->seq,
1083 __entry->offset,
1084 __entry->len,
1085 __entry->ret)
1086 );
1087
David Howellscf1a6472016-09-22 00:41:53 +01001088TRACE_EVENT(rxrpc_rtt_tx,
1089 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
1090 rxrpc_serial_t send_serial),
1091
1092 TP_ARGS(call, why, send_serial),
1093
1094 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001095 __field(unsigned int, call )
David Howellscf1a6472016-09-22 00:41:53 +01001096 __field(enum rxrpc_rtt_tx_trace, why )
1097 __field(rxrpc_serial_t, send_serial )
1098 ),
1099
1100 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001101 __entry->call = call->debug_id;
David Howellscf1a6472016-09-22 00:41:53 +01001102 __entry->why = why;
1103 __entry->send_serial = send_serial;
1104 ),
1105
David Howellsa25e21f2018-03-27 23:03:00 +01001106 TP_printk("c=%08x %s sr=%08x",
David Howellscf1a6472016-09-22 00:41:53 +01001107 __entry->call,
David Howellsb54a1342017-01-05 10:38:33 +00001108 __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
David Howellscf1a6472016-09-22 00:41:53 +01001109 __entry->send_serial)
1110 );
1111
1112TRACE_EVENT(rxrpc_rtt_rx,
1113 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
1114 rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
1115 s64 rtt, u8 nr, s64 avg),
1116
1117 TP_ARGS(call, why, send_serial, resp_serial, rtt, nr, avg),
1118
1119 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001120 __field(unsigned int, call )
David Howellscf1a6472016-09-22 00:41:53 +01001121 __field(enum rxrpc_rtt_rx_trace, why )
1122 __field(u8, nr )
1123 __field(rxrpc_serial_t, send_serial )
1124 __field(rxrpc_serial_t, resp_serial )
1125 __field(s64, rtt )
1126 __field(u64, avg )
1127 ),
1128
1129 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001130 __entry->call = call->debug_id;
David Howellscf1a6472016-09-22 00:41:53 +01001131 __entry->why = why;
1132 __entry->send_serial = send_serial;
1133 __entry->resp_serial = resp_serial;
1134 __entry->rtt = rtt;
1135 __entry->nr = nr;
1136 __entry->avg = avg;
1137 ),
1138
David Howellsa25e21f2018-03-27 23:03:00 +01001139 TP_printk("c=%08x %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
David Howellscf1a6472016-09-22 00:41:53 +01001140 __entry->call,
David Howellsb54a1342017-01-05 10:38:33 +00001141 __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
David Howellscf1a6472016-09-22 00:41:53 +01001142 __entry->send_serial,
1143 __entry->resp_serial,
1144 __entry->rtt,
1145 __entry->nr,
1146 __entry->avg)
1147 );
1148
David Howellsfc7ab6d2016-09-23 15:22:36 +01001149TRACE_EVENT(rxrpc_timer,
1150 TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
David Howellsa158bdd2017-11-24 10:18:41 +00001151 unsigned long now),
David Howellsfc7ab6d2016-09-23 15:22:36 +01001152
David Howellsa158bdd2017-11-24 10:18:41 +00001153 TP_ARGS(call, why, now),
David Howellsfc7ab6d2016-09-23 15:22:36 +01001154
1155 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001156 __field(unsigned int, call )
David Howellsfc7ab6d2016-09-23 15:22:36 +01001157 __field(enum rxrpc_timer_trace, why )
David Howellsa158bdd2017-11-24 10:18:41 +00001158 __field(long, now )
1159 __field(long, ack_at )
David Howellsbd1fdf82017-11-24 10:18:42 +00001160 __field(long, ack_lost_at )
David Howellsa158bdd2017-11-24 10:18:41 +00001161 __field(long, resend_at )
1162 __field(long, ping_at )
1163 __field(long, expect_rx_by )
1164 __field(long, expect_req_by )
1165 __field(long, expect_term_by )
1166 __field(long, timer )
David Howellsfc7ab6d2016-09-23 15:22:36 +01001167 ),
1168
1169 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001170 __entry->call = call->debug_id;
David Howellsa158bdd2017-11-24 10:18:41 +00001171 __entry->why = why;
1172 __entry->now = now;
1173 __entry->ack_at = call->ack_at;
David Howellsbd1fdf82017-11-24 10:18:42 +00001174 __entry->ack_lost_at = call->ack_lost_at;
David Howellsa158bdd2017-11-24 10:18:41 +00001175 __entry->resend_at = call->resend_at;
1176 __entry->expect_rx_by = call->expect_rx_by;
1177 __entry->expect_req_by = call->expect_req_by;
1178 __entry->expect_term_by = call->expect_term_by;
1179 __entry->timer = call->timer.expires;
David Howellsfc7ab6d2016-09-23 15:22:36 +01001180 ),
1181
David Howellsa25e21f2018-03-27 23:03:00 +01001182 TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
David Howellsfc7ab6d2016-09-23 15:22:36 +01001183 __entry->call,
David Howellsb54a1342017-01-05 10:38:33 +00001184 __print_symbolic(__entry->why, rxrpc_timer_traces),
David Howellsa158bdd2017-11-24 10:18:41 +00001185 __entry->ack_at - __entry->now,
David Howellsbd1fdf82017-11-24 10:18:42 +00001186 __entry->ack_lost_at - __entry->now,
David Howellsa158bdd2017-11-24 10:18:41 +00001187 __entry->resend_at - __entry->now,
1188 __entry->expect_rx_by - __entry->now,
1189 __entry->expect_req_by - __entry->now,
1190 __entry->expect_term_by - __entry->now,
1191 __entry->timer - __entry->now)
David Howellsfc7ab6d2016-09-23 15:22:36 +01001192 );
1193
David Howells89b475a2016-09-23 12:39:22 +01001194TRACE_EVENT(rxrpc_rx_lose,
1195 TP_PROTO(struct rxrpc_skb_priv *sp),
1196
1197 TP_ARGS(sp),
1198
1199 TP_STRUCT__entry(
1200 __field_struct(struct rxrpc_host_header, hdr )
1201 ),
1202
1203 TP_fast_assign(
1204 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
1205 ),
1206
1207 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
1208 __entry->hdr.epoch, __entry->hdr.cid,
1209 __entry->hdr.callNumber, __entry->hdr.serviceId,
1210 __entry->hdr.serial, __entry->hdr.seq,
1211 __entry->hdr.type, __entry->hdr.flags,
David Howellsb54a1342017-01-05 10:38:33 +00001212 __entry->hdr.type <= 15 ?
1213 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
David Howells89b475a2016-09-23 12:39:22 +01001214 );
1215
David Howells9c7ad432016-09-23 13:50:40 +01001216TRACE_EVENT(rxrpc_propose_ack,
1217 TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1218 u8 ack_reason, rxrpc_serial_t serial, bool immediate,
1219 bool background, enum rxrpc_propose_ack_outcome outcome),
1220
1221 TP_ARGS(call, why, ack_reason, serial, immediate, background,
1222 outcome),
1223
1224 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001225 __field(unsigned int, call )
David Howells9c7ad432016-09-23 13:50:40 +01001226 __field(enum rxrpc_propose_ack_trace, why )
1227 __field(rxrpc_serial_t, serial )
1228 __field(u8, ack_reason )
1229 __field(bool, immediate )
1230 __field(bool, background )
1231 __field(enum rxrpc_propose_ack_outcome, outcome )
1232 ),
1233
1234 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001235 __entry->call = call->debug_id;
David Howells9c7ad432016-09-23 13:50:40 +01001236 __entry->why = why;
1237 __entry->serial = serial;
1238 __entry->ack_reason = ack_reason;
1239 __entry->immediate = immediate;
1240 __entry->background = background;
1241 __entry->outcome = outcome;
1242 ),
1243
David Howellsa25e21f2018-03-27 23:03:00 +01001244 TP_printk("c=%08x %s %s r=%08x i=%u b=%u%s",
David Howells9c7ad432016-09-23 13:50:40 +01001245 __entry->call,
David Howellsb54a1342017-01-05 10:38:33 +00001246 __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1247 __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
David Howells9c7ad432016-09-23 13:50:40 +01001248 __entry->serial,
1249 __entry->immediate,
1250 __entry->background,
David Howellsb54a1342017-01-05 10:38:33 +00001251 __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
David Howells9c7ad432016-09-23 13:50:40 +01001252 );
1253
David Howellsc6672e32016-09-23 13:58:55 +01001254TRACE_EVENT(rxrpc_retransmit,
1255 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
1256 s64 expiry),
1257
1258 TP_ARGS(call, seq, annotation, expiry),
1259
1260 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001261 __field(unsigned int, call )
David Howellsc6672e32016-09-23 13:58:55 +01001262 __field(rxrpc_seq_t, seq )
1263 __field(u8, annotation )
1264 __field(s64, expiry )
1265 ),
1266
1267 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001268 __entry->call = call->debug_id;
David Howellsc6672e32016-09-23 13:58:55 +01001269 __entry->seq = seq;
1270 __entry->annotation = annotation;
1271 __entry->expiry = expiry;
1272 ),
1273
David Howellsa25e21f2018-03-27 23:03:00 +01001274 TP_printk("c=%08x q=%x a=%02x xp=%lld",
David Howellsc6672e32016-09-23 13:58:55 +01001275 __entry->call,
1276 __entry->seq,
1277 __entry->annotation,
1278 __entry->expiry)
1279 );
1280
David Howells57494342016-09-24 18:05:27 +01001281TRACE_EVENT(rxrpc_congest,
1282 TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
1283 rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
1284
1285 TP_ARGS(call, summary, ack_serial, change),
1286
1287 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001288 __field(unsigned int, call )
David Howells57494342016-09-24 18:05:27 +01001289 __field(enum rxrpc_congest_change, change )
1290 __field(rxrpc_seq_t, hard_ack )
1291 __field(rxrpc_seq_t, top )
1292 __field(rxrpc_seq_t, lowest_nak )
1293 __field(rxrpc_serial_t, ack_serial )
1294 __field_struct(struct rxrpc_ack_summary, sum )
1295 ),
1296
1297 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001298 __entry->call = call->debug_id;
David Howells57494342016-09-24 18:05:27 +01001299 __entry->change = change;
1300 __entry->hard_ack = call->tx_hard_ack;
1301 __entry->top = call->tx_top;
1302 __entry->lowest_nak = call->acks_lowest_nak;
1303 __entry->ack_serial = ack_serial;
1304 memcpy(&__entry->sum, summary, sizeof(__entry->sum));
1305 ),
1306
David Howellsa25e21f2018-03-27 23:03:00 +01001307 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",
David Howells57494342016-09-24 18:05:27 +01001308 __entry->call,
1309 __entry->ack_serial,
David Howellsb54a1342017-01-05 10:38:33 +00001310 __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
David Howells57494342016-09-24 18:05:27 +01001311 __entry->hard_ack,
David Howellsb54a1342017-01-05 10:38:33 +00001312 __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
David Howells57494342016-09-24 18:05:27 +01001313 __entry->sum.cwnd,
1314 __entry->sum.ssthresh,
1315 __entry->sum.nr_acks, __entry->sum.nr_nacks,
1316 __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
1317 __entry->sum.nr_rot_new_acks,
1318 __entry->top - __entry->hard_ack,
1319 __entry->sum.cumulative_acks,
1320 __entry->sum.dup_acks,
1321 __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
David Howellsb54a1342017-01-05 10:38:33 +00001322 __print_symbolic(__entry->change, rxrpc_congest_changes),
David Howells57494342016-09-24 18:05:27 +01001323 __entry->sum.retrans_timeo ? " rTxTo" : "")
1324 );
1325
David Howellsb1d9f7fd2017-01-05 10:38:34 +00001326TRACE_EVENT(rxrpc_disconnect_call,
1327 TP_PROTO(struct rxrpc_call *call),
1328
1329 TP_ARGS(call),
1330
1331 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001332 __field(unsigned int, call )
David Howellsb1d9f7fd2017-01-05 10:38:34 +00001333 __field(u32, abort_code )
1334 ),
1335
1336 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001337 __entry->call = call->debug_id;
David Howellsb1d9f7fd2017-01-05 10:38:34 +00001338 __entry->abort_code = call->abort_code;
1339 ),
1340
David Howellsa25e21f2018-03-27 23:03:00 +01001341 TP_printk("c=%08x ab=%08x",
David Howellsb1d9f7fd2017-01-05 10:38:34 +00001342 __entry->call,
1343 __entry->abort_code)
1344 );
1345
1346TRACE_EVENT(rxrpc_improper_term,
1347 TP_PROTO(struct rxrpc_call *call),
1348
1349 TP_ARGS(call),
1350
1351 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001352 __field(unsigned int, call )
David Howellsb1d9f7fd2017-01-05 10:38:34 +00001353 __field(u32, abort_code )
1354 ),
1355
1356 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001357 __entry->call = call->debug_id;
David Howellsb1d9f7fd2017-01-05 10:38:34 +00001358 __entry->abort_code = call->abort_code;
1359 ),
1360
David Howellsa25e21f2018-03-27 23:03:00 +01001361 TP_printk("c=%08x ab=%08x",
David Howellsb1d9f7fd2017-01-05 10:38:34 +00001362 __entry->call,
1363 __entry->abort_code)
1364 );
1365
David Howellsfb46f6e2017-04-06 10:12:00 +01001366TRACE_EVENT(rxrpc_rx_eproto,
1367 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
1368 const char *why),
1369
1370 TP_ARGS(call, serial, why),
1371
1372 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001373 __field(unsigned int, call )
David Howellsfb46f6e2017-04-06 10:12:00 +01001374 __field(rxrpc_serial_t, serial )
1375 __field(const char *, why )
1376 ),
1377
1378 TP_fast_assign(
David Howells99f0eae62019-07-02 16:04:19 +01001379 __entry->call = call ? call->debug_id : 0;
David Howellsfb46f6e2017-04-06 10:12:00 +01001380 __entry->serial = serial;
1381 __entry->why = why;
1382 ),
1383
David Howellsa25e21f2018-03-27 23:03:00 +01001384 TP_printk("c=%08x EPROTO %08x %s",
David Howellsfb46f6e2017-04-06 10:12:00 +01001385 __entry->call,
1386 __entry->serial,
1387 __entry->why)
1388 );
1389
David Howells89ca6942017-04-06 10:12:00 +01001390TRACE_EVENT(rxrpc_connect_call,
1391 TP_PROTO(struct rxrpc_call *call),
1392
1393 TP_ARGS(call),
1394
1395 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001396 __field(unsigned int, call )
David Howells89ca6942017-04-06 10:12:00 +01001397 __field(unsigned long, user_call_ID )
1398 __field(u32, cid )
1399 __field(u32, call_id )
1400 ),
1401
1402 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001403 __entry->call = call->debug_id;
David Howells89ca6942017-04-06 10:12:00 +01001404 __entry->user_call_ID = call->user_call_ID;
1405 __entry->cid = call->cid;
1406 __entry->call_id = call->call_id;
1407 ),
1408
David Howellsa25e21f2018-03-27 23:03:00 +01001409 TP_printk("c=%08x u=%p %08x:%08x",
David Howells89ca6942017-04-06 10:12:00 +01001410 __entry->call,
1411 (void *)__entry->user_call_ID,
1412 __entry->cid,
1413 __entry->call_id)
1414 );
1415
David Howells827efed2018-03-27 23:02:47 +01001416TRACE_EVENT(rxrpc_resend,
1417 TP_PROTO(struct rxrpc_call *call, int ix),
1418
1419 TP_ARGS(call, ix),
1420
1421 TP_STRUCT__entry(
David Howellsa25e21f2018-03-27 23:03:00 +01001422 __field(unsigned int, call )
David Howells827efed2018-03-27 23:02:47 +01001423 __field(int, ix )
1424 __array(u8, anno, 64 )
1425 ),
1426
1427 TP_fast_assign(
David Howellsa25e21f2018-03-27 23:03:00 +01001428 __entry->call = call->debug_id;
David Howells827efed2018-03-27 23:02:47 +01001429 __entry->ix = ix;
1430 memcpy(__entry->anno, call->rxtx_annotations, 64);
1431 ),
1432
David Howellsa25e21f2018-03-27 23:03:00 +01001433 TP_printk("c=%08x ix=%u a=%64phN",
David Howells827efed2018-03-27 23:02:47 +01001434 __entry->call,
1435 __entry->ix,
1436 __entry->anno)
1437 );
1438
David Howells494337c2018-05-10 23:26:01 +01001439TRACE_EVENT(rxrpc_rx_icmp,
1440 TP_PROTO(struct rxrpc_peer *peer, struct sock_extended_err *ee,
1441 struct sockaddr_rxrpc *srx),
1442
1443 TP_ARGS(peer, ee, srx),
1444
1445 TP_STRUCT__entry(
1446 __field(unsigned int, peer )
1447 __field_struct(struct sock_extended_err, ee )
1448 __field_struct(struct sockaddr_rxrpc, srx )
1449 ),
1450
1451 TP_fast_assign(
1452 __entry->peer = peer->debug_id;
1453 memcpy(&__entry->ee, ee, sizeof(__entry->ee));
1454 memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1455 ),
1456
1457 TP_printk("P=%08x o=%u t=%u c=%u i=%u d=%u e=%d %pISp",
1458 __entry->peer,
1459 __entry->ee.ee_origin,
1460 __entry->ee.ee_type,
1461 __entry->ee.ee_code,
1462 __entry->ee.ee_info,
1463 __entry->ee.ee_data,
1464 __entry->ee.ee_errno,
1465 &__entry->srx.transport)
1466 );
1467
David Howells6b47fe12018-05-10 23:26:01 +01001468TRACE_EVENT(rxrpc_tx_fail,
1469 TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret,
David Howells4764c0d2018-07-23 17:18:37 +01001470 enum rxrpc_tx_point where),
David Howells6b47fe12018-05-10 23:26:01 +01001471
David Howells4764c0d2018-07-23 17:18:37 +01001472 TP_ARGS(debug_id, serial, ret, where),
David Howells6b47fe12018-05-10 23:26:01 +01001473
1474 TP_STRUCT__entry(
1475 __field(unsigned int, debug_id )
1476 __field(rxrpc_serial_t, serial )
1477 __field(int, ret )
David Howells4764c0d2018-07-23 17:18:37 +01001478 __field(enum rxrpc_tx_point, where )
David Howells6b47fe12018-05-10 23:26:01 +01001479 ),
1480
1481 TP_fast_assign(
1482 __entry->debug_id = debug_id;
1483 __entry->serial = serial;
1484 __entry->ret = ret;
David Howells4764c0d2018-07-23 17:18:37 +01001485 __entry->where = where;
David Howells6b47fe12018-05-10 23:26:01 +01001486 ),
1487
1488 TP_printk("c=%08x r=%x ret=%d %s",
1489 __entry->debug_id,
1490 __entry->serial,
1491 __entry->ret,
David Howells4764c0d2018-07-23 17:18:37 +01001492 __print_symbolic(__entry->where, rxrpc_tx_points))
David Howells6b47fe12018-05-10 23:26:01 +01001493 );
1494
David Howells1a025022018-06-03 02:17:39 +01001495TRACE_EVENT(rxrpc_call_reset,
1496 TP_PROTO(struct rxrpc_call *call),
1497
1498 TP_ARGS(call),
1499
1500 TP_STRUCT__entry(
1501 __field(unsigned int, debug_id )
1502 __field(u32, cid )
1503 __field(u32, call_id )
1504 __field(rxrpc_serial_t, call_serial )
1505 __field(rxrpc_serial_t, conn_serial )
1506 __field(rxrpc_seq_t, tx_seq )
1507 __field(rxrpc_seq_t, rx_seq )
1508 ),
1509
1510 TP_fast_assign(
1511 __entry->debug_id = call->debug_id;
1512 __entry->cid = call->cid;
1513 __entry->call_id = call->call_id;
1514 __entry->call_serial = call->rx_serial;
1515 __entry->conn_serial = call->conn->hi_serial;
1516 __entry->tx_seq = call->tx_hard_ack;
1517 __entry->rx_seq = call->ackr_seen;
1518 ),
1519
1520 TP_printk("c=%08x %08x:%08x r=%08x/%08x tx=%08x rx=%08x",
1521 __entry->debug_id,
1522 __entry->cid, __entry->call_id,
1523 __entry->call_serial, __entry->conn_serial,
1524 __entry->tx_seq, __entry->rx_seq)
1525 );
1526
David Howells4272d302018-07-23 17:18:37 +01001527TRACE_EVENT(rxrpc_notify_socket,
1528 TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial),
1529
1530 TP_ARGS(debug_id, serial),
1531
1532 TP_STRUCT__entry(
1533 __field(unsigned int, debug_id )
1534 __field(rxrpc_serial_t, serial )
1535 ),
1536
1537 TP_fast_assign(
1538 __entry->debug_id = debug_id;
1539 __entry->serial = serial;
1540 ),
1541
1542 TP_printk("c=%08x r=%08x",
1543 __entry->debug_id,
1544 __entry->serial)
1545 );
1546
David Howellsdf844fd2016-08-23 15:27:24 +01001547#endif /* _TRACE_RXRPC_H */
1548
1549/* This part must be outside protection */
1550#include <trace/define_trace.h>