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