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