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