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