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