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