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