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