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