rxrpc: Define rxrpc_txbuf struct to carry data to be transmitted
[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_cleaned,                   "CLN") \
21         EM(rxrpc_skb_freed,                     "FRE") \
22         EM(rxrpc_skb_got,                       "GOT") \
23         EM(rxrpc_skb_lost,                      "*L*") \
24         EM(rxrpc_skb_new,                       "NEW") \
25         EM(rxrpc_skb_purged,                    "PUR") \
26         EM(rxrpc_skb_received,                  "RCV") \
27         EM(rxrpc_skb_rotated,                   "ROT") \
28         EM(rxrpc_skb_seen,                      "SEE") \
29         EM(rxrpc_skb_unshared,                  "UNS") \
30         E_(rxrpc_skb_unshared_nomem,            "US0")
31
32 #define rxrpc_local_traces \
33         EM(rxrpc_local_got,                     "GOT") \
34         EM(rxrpc_local_new,                     "NEW") \
35         EM(rxrpc_local_processing,              "PRO") \
36         EM(rxrpc_local_put,                     "PUT") \
37         E_(rxrpc_local_queued,                  "QUE")
38
39 #define rxrpc_peer_traces \
40         EM(rxrpc_peer_got,                      "GOT") \
41         EM(rxrpc_peer_new,                      "NEW") \
42         EM(rxrpc_peer_processing,               "PRO") \
43         E_(rxrpc_peer_put,                      "PUT")
44
45 #define rxrpc_conn_traces \
46         EM(rxrpc_conn_got,                      "GOT") \
47         EM(rxrpc_conn_new_client,               "NWc") \
48         EM(rxrpc_conn_new_service,              "NWs") \
49         EM(rxrpc_conn_put_client,               "PTc") \
50         EM(rxrpc_conn_put_service,              "PTs") \
51         EM(rxrpc_conn_queued,                   "QUE") \
52         EM(rxrpc_conn_reap_service,             "RPs") \
53         E_(rxrpc_conn_seen,                     "SEE")
54
55 #define rxrpc_client_traces \
56         EM(rxrpc_client_activate_chans,         "Activa") \
57         EM(rxrpc_client_alloc,                  "Alloc ") \
58         EM(rxrpc_client_chan_activate,          "ChActv") \
59         EM(rxrpc_client_chan_disconnect,        "ChDisc") \
60         EM(rxrpc_client_chan_pass,              "ChPass") \
61         EM(rxrpc_client_chan_wait_failed,       "ChWtFl") \
62         EM(rxrpc_client_cleanup,                "Clean ") \
63         EM(rxrpc_client_discard,                "Discar") \
64         EM(rxrpc_client_duplicate,              "Duplic") \
65         EM(rxrpc_client_exposed,                "Expose") \
66         EM(rxrpc_client_replace,                "Replac") \
67         EM(rxrpc_client_to_active,              "->Actv") \
68         E_(rxrpc_client_to_idle,                "->Idle")
69
70 #define rxrpc_call_traces \
71         EM(rxrpc_call_connected,                "CON") \
72         EM(rxrpc_call_error,                    "*E*") \
73         EM(rxrpc_call_got,                      "GOT") \
74         EM(rxrpc_call_got_kernel,               "Gke") \
75         EM(rxrpc_call_got_timer,                "GTM") \
76         EM(rxrpc_call_got_userid,               "Gus") \
77         EM(rxrpc_call_new_client,               "NWc") \
78         EM(rxrpc_call_new_service,              "NWs") \
79         EM(rxrpc_call_put,                      "PUT") \
80         EM(rxrpc_call_put_kernel,               "Pke") \
81         EM(rxrpc_call_put_noqueue,              "PnQ") \
82         EM(rxrpc_call_put_notimer,              "PnT") \
83         EM(rxrpc_call_put_timer,                "PTM") \
84         EM(rxrpc_call_put_userid,               "Pus") \
85         EM(rxrpc_call_queued,                   "QUE") \
86         EM(rxrpc_call_queued_ref,               "QUR") \
87         EM(rxrpc_call_release,                  "RLS") \
88         E_(rxrpc_call_seen,                     "SEE")
89
90 #define rxrpc_transmit_traces \
91         EM(rxrpc_transmit_await_reply,          "AWR") \
92         EM(rxrpc_transmit_end,                  "END") \
93         EM(rxrpc_transmit_queue,                "QUE") \
94         EM(rxrpc_transmit_queue_last,           "QLS") \
95         EM(rxrpc_transmit_rotate,               "ROT") \
96         EM(rxrpc_transmit_rotate_last,          "RLS") \
97         E_(rxrpc_transmit_wait,                 "WAI")
98
99 #define rxrpc_receive_traces \
100         EM(rxrpc_receive_end,                   "END") \
101         EM(rxrpc_receive_front,                 "FRN") \
102         EM(rxrpc_receive_incoming,              "INC") \
103         EM(rxrpc_receive_queue,                 "QUE") \
104         EM(rxrpc_receive_queue_last,            "QLS") \
105         E_(rxrpc_receive_rotate,                "ROT")
106
107 #define rxrpc_recvmsg_traces \
108         EM(rxrpc_recvmsg_cont,                  "CONT") \
109         EM(rxrpc_recvmsg_data_return,           "DATA") \
110         EM(rxrpc_recvmsg_dequeue,               "DEQU") \
111         EM(rxrpc_recvmsg_enter,                 "ENTR") \
112         EM(rxrpc_recvmsg_full,                  "FULL") \
113         EM(rxrpc_recvmsg_hole,                  "HOLE") \
114         EM(rxrpc_recvmsg_next,                  "NEXT") \
115         EM(rxrpc_recvmsg_requeue,               "REQU") \
116         EM(rxrpc_recvmsg_return,                "RETN") \
117         EM(rxrpc_recvmsg_terminal,              "TERM") \
118         EM(rxrpc_recvmsg_to_be_accepted,        "TBAC") \
119         E_(rxrpc_recvmsg_wait,                  "WAIT")
120
121 #define rxrpc_rtt_tx_traces \
122         EM(rxrpc_rtt_tx_cancel,                 "CNCE") \
123         EM(rxrpc_rtt_tx_data,                   "DATA") \
124         EM(rxrpc_rtt_tx_no_slot,                "FULL") \
125         E_(rxrpc_rtt_tx_ping,                   "PING")
126
127 #define rxrpc_rtt_rx_traces \
128         EM(rxrpc_rtt_rx_cancel,                 "CNCL") \
129         EM(rxrpc_rtt_rx_obsolete,               "OBSL") \
130         EM(rxrpc_rtt_rx_lost,                   "LOST") \
131         EM(rxrpc_rtt_rx_ping_response,          "PONG") \
132         E_(rxrpc_rtt_rx_requested_ack,          "RACK")
133
134 #define rxrpc_timer_traces \
135         EM(rxrpc_timer_begin,                   "Begin ") \
136         EM(rxrpc_timer_exp_ack,                 "ExpAck") \
137         EM(rxrpc_timer_exp_hard,                "ExpHrd") \
138         EM(rxrpc_timer_exp_idle,                "ExpIdl") \
139         EM(rxrpc_timer_exp_keepalive,           "ExpKA ") \
140         EM(rxrpc_timer_exp_lost_ack,            "ExpLoA") \
141         EM(rxrpc_timer_exp_normal,              "ExpNml") \
142         EM(rxrpc_timer_exp_ping,                "ExpPng") \
143         EM(rxrpc_timer_exp_resend,              "ExpRsn") \
144         EM(rxrpc_timer_init_for_reply,          "IniRpl") \
145         EM(rxrpc_timer_init_for_send_reply,     "SndRpl") \
146         EM(rxrpc_timer_restart,                 "Restrt") \
147         EM(rxrpc_timer_set_for_ack,             "SetAck") \
148         EM(rxrpc_timer_set_for_hard,            "SetHrd") \
149         EM(rxrpc_timer_set_for_idle,            "SetIdl") \
150         EM(rxrpc_timer_set_for_keepalive,       "KeepAl") \
151         EM(rxrpc_timer_set_for_lost_ack,        "SetLoA") \
152         EM(rxrpc_timer_set_for_normal,          "SetNml") \
153         EM(rxrpc_timer_set_for_ping,            "SetPng") \
154         EM(rxrpc_timer_set_for_resend,          "SetRTx") \
155         E_(rxrpc_timer_set_for_send,            "SetSnd")
156
157 #define rxrpc_propose_ack_traces \
158         EM(rxrpc_propose_ack_client_tx_end,     "ClTxEnd") \
159         EM(rxrpc_propose_ack_input_data,        "DataIn ") \
160         EM(rxrpc_propose_ack_ping_for_check_life, "ChkLife") \
161         EM(rxrpc_propose_ack_ping_for_keepalive, "KeepAlv") \
162         EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
163         EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
164         EM(rxrpc_propose_ack_ping_for_params,   "Params ") \
165         EM(rxrpc_propose_ack_processing_op,     "ProcOp ") \
166         EM(rxrpc_propose_ack_respond_to_ack,    "Rsp2Ack") \
167         EM(rxrpc_propose_ack_respond_to_ping,   "Rsp2Png") \
168         EM(rxrpc_propose_ack_retry_tx,          "RetryTx") \
169         EM(rxrpc_propose_ack_rotate_rx,         "RxAck  ") \
170         E_(rxrpc_propose_ack_terminal_ack,      "ClTerm ")
171
172 #define rxrpc_propose_ack_outcomes \
173         EM(rxrpc_propose_ack_subsume,           " Subsume") \
174         EM(rxrpc_propose_ack_update,            " Update") \
175         E_(rxrpc_propose_ack_use,               " New")
176
177 #define rxrpc_congest_modes \
178         EM(RXRPC_CALL_CONGEST_AVOIDANCE,        "CongAvoid") \
179         EM(RXRPC_CALL_FAST_RETRANSMIT,          "FastReTx ") \
180         EM(RXRPC_CALL_PACKET_LOSS,              "PktLoss  ") \
181         E_(RXRPC_CALL_SLOW_START,               "SlowStart")
182
183 #define rxrpc_congest_changes \
184         EM(rxrpc_cong_begin_retransmission,     " Retrans") \
185         EM(rxrpc_cong_cleared_nacks,            " Cleared") \
186         EM(rxrpc_cong_new_low_nack,             " NewLowN") \
187         EM(rxrpc_cong_no_change,                " -") \
188         EM(rxrpc_cong_progress,                 " Progres") \
189         EM(rxrpc_cong_retransmit_again,         " ReTxAgn") \
190         EM(rxrpc_cong_rtt_window_end,           " RttWinE") \
191         E_(rxrpc_cong_saw_nack,                 " SawNack")
192
193 #define rxrpc_pkts \
194         EM(0,                                   "?00") \
195         EM(RXRPC_PACKET_TYPE_DATA,              "DATA") \
196         EM(RXRPC_PACKET_TYPE_ACK,               "ACK") \
197         EM(RXRPC_PACKET_TYPE_BUSY,              "BUSY") \
198         EM(RXRPC_PACKET_TYPE_ABORT,             "ABORT") \
199         EM(RXRPC_PACKET_TYPE_ACKALL,            "ACKALL") \
200         EM(RXRPC_PACKET_TYPE_CHALLENGE,         "CHALL") \
201         EM(RXRPC_PACKET_TYPE_RESPONSE,          "RESP") \
202         EM(RXRPC_PACKET_TYPE_DEBUG,             "DEBUG") \
203         EM(9,                                   "?09") \
204         EM(10,                                  "?10") \
205         EM(11,                                  "?11") \
206         EM(12,                                  "?12") \
207         EM(RXRPC_PACKET_TYPE_VERSION,           "VERSION") \
208         EM(14,                                  "?14") \
209         E_(15,                                  "?15")
210
211 #define rxrpc_ack_names \
212         EM(0,                                   "-0-") \
213         EM(RXRPC_ACK_REQUESTED,                 "REQ") \
214         EM(RXRPC_ACK_DUPLICATE,                 "DUP") \
215         EM(RXRPC_ACK_OUT_OF_SEQUENCE,           "OOS") \
216         EM(RXRPC_ACK_EXCEEDS_WINDOW,            "WIN") \
217         EM(RXRPC_ACK_NOSPACE,                   "MEM") \
218         EM(RXRPC_ACK_PING,                      "PNG") \
219         EM(RXRPC_ACK_PING_RESPONSE,             "PNR") \
220         EM(RXRPC_ACK_DELAY,                     "DLY") \
221         EM(RXRPC_ACK_IDLE,                      "IDL") \
222         E_(RXRPC_ACK__INVALID,                  "-?-")
223
224 #define rxrpc_completions \
225         EM(RXRPC_CALL_SUCCEEDED,                "Succeeded") \
226         EM(RXRPC_CALL_REMOTELY_ABORTED,         "RemoteAbort") \
227         EM(RXRPC_CALL_LOCALLY_ABORTED,          "LocalAbort") \
228         EM(RXRPC_CALL_LOCAL_ERROR,              "LocalError") \
229         E_(RXRPC_CALL_NETWORK_ERROR,            "NetError")
230
231 #define rxrpc_tx_points \
232         EM(rxrpc_tx_point_call_abort,           "CallAbort") \
233         EM(rxrpc_tx_point_call_ack,             "CallAck") \
234         EM(rxrpc_tx_point_call_data_frag,       "CallDataFrag") \
235         EM(rxrpc_tx_point_call_data_nofrag,     "CallDataNofrag") \
236         EM(rxrpc_tx_point_call_final_resend,    "CallFinalResend") \
237         EM(rxrpc_tx_point_conn_abort,           "ConnAbort") \
238         EM(rxrpc_tx_point_reject,               "Reject") \
239         EM(rxrpc_tx_point_rxkad_challenge,      "RxkadChall") \
240         EM(rxrpc_tx_point_rxkad_response,       "RxkadResp") \
241         EM(rxrpc_tx_point_version_keepalive,    "VerKeepalive") \
242         E_(rxrpc_tx_point_version_reply,        "VerReply")
243
244 #define rxrpc_req_ack_traces \
245         EM(rxrpc_reqack_ack_lost,               "ACK-LOST  ")   \
246         EM(rxrpc_reqack_already_on,             "ALREADY-ON")   \
247         EM(rxrpc_reqack_more_rtt,               "MORE-RTT  ")   \
248         EM(rxrpc_reqack_no_srv_last,            "NO-SRVLAST")   \
249         EM(rxrpc_reqack_old_rtt,                "OLD-RTT   ")   \
250         EM(rxrpc_reqack_retrans,                "RETRANS   ")   \
251         EM(rxrpc_reqack_slow_start,             "SLOW-START")   \
252         E_(rxrpc_reqack_small_txwin,            "SMALL-TXWN")
253 /* ---- Must update size of stat_why_req_ack[] if more are added! */
254
255 #define rxrpc_txbuf_traces \
256         EM(rxrpc_txbuf_alloc_ack,               "ALLOC ACK  ")  \
257         EM(rxrpc_txbuf_alloc_data,              "ALLOC DATA ")  \
258         EM(rxrpc_txbuf_free,                    "FREE       ")  \
259         EM(rxrpc_txbuf_get_trans,               "GET TRANS  ")  \
260         EM(rxrpc_txbuf_get_retrans,             "GET RETRANS")  \
261         EM(rxrpc_txbuf_put_cleaned,             "PUT CLEANED")  \
262         EM(rxrpc_txbuf_put_rotated,             "PUT ROTATED")  \
263         EM(rxrpc_txbuf_put_send_aborted,        "PUT SEND-X ")  \
264         EM(rxrpc_txbuf_see_send_more,           "SEE SEND+  ")  \
265         E_(rxrpc_txbuf_see_unacked,             "SEE UNACKED")
266
267 /*
268  * Generate enums for tracing information.
269  */
270 #ifndef __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
271 #define __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
272
273 #undef EM
274 #undef E_
275 #define EM(a, b) a,
276 #define E_(a, b) a
277
278 enum rxrpc_call_trace           { rxrpc_call_traces } __mode(byte);
279 enum rxrpc_client_trace         { rxrpc_client_traces } __mode(byte);
280 enum rxrpc_congest_change       { rxrpc_congest_changes } __mode(byte);
281 enum rxrpc_conn_trace           { rxrpc_conn_traces } __mode(byte);
282 enum rxrpc_local_trace          { rxrpc_local_traces } __mode(byte);
283 enum rxrpc_peer_trace           { rxrpc_peer_traces } __mode(byte);
284 enum rxrpc_propose_ack_outcome  { rxrpc_propose_ack_outcomes } __mode(byte);
285 enum rxrpc_propose_ack_trace    { rxrpc_propose_ack_traces } __mode(byte);
286 enum rxrpc_receive_trace        { rxrpc_receive_traces } __mode(byte);
287 enum rxrpc_recvmsg_trace        { rxrpc_recvmsg_traces } __mode(byte);
288 enum rxrpc_req_ack_trace        { rxrpc_req_ack_traces } __mode(byte);
289 enum rxrpc_rtt_rx_trace         { rxrpc_rtt_rx_traces } __mode(byte);
290 enum rxrpc_rtt_tx_trace         { rxrpc_rtt_tx_traces } __mode(byte);
291 enum rxrpc_skb_trace            { rxrpc_skb_traces } __mode(byte);
292 enum rxrpc_timer_trace          { rxrpc_timer_traces } __mode(byte);
293 enum rxrpc_transmit_trace       { rxrpc_transmit_traces } __mode(byte);
294 enum rxrpc_tx_point             { rxrpc_tx_points } __mode(byte);
295 enum rxrpc_txbuf_trace          { rxrpc_txbuf_traces } __mode(byte);
296
297 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
298
299 /*
300  * Export enum symbols via userspace.
301  */
302 #undef EM
303 #undef E_
304 #define EM(a, b) TRACE_DEFINE_ENUM(a);
305 #define E_(a, b) TRACE_DEFINE_ENUM(a);
306
307 rxrpc_call_traces;
308 rxrpc_client_traces;
309 rxrpc_congest_changes;
310 rxrpc_congest_modes;
311 rxrpc_conn_traces;
312 rxrpc_local_traces;
313 rxrpc_propose_ack_outcomes;
314 rxrpc_propose_ack_traces;
315 rxrpc_receive_traces;
316 rxrpc_recvmsg_traces;
317 rxrpc_req_ack_traces;
318 rxrpc_rtt_rx_traces;
319 rxrpc_rtt_tx_traces;
320 rxrpc_skb_traces;
321 rxrpc_timer_traces;
322 rxrpc_transmit_traces;
323 rxrpc_tx_points;
324 rxrpc_txbuf_traces;
325
326 /*
327  * Now redefine the EM() and E_() macros to map the enums to the strings that
328  * will be printed in the output.
329  */
330 #undef EM
331 #undef E_
332 #define EM(a, b)        { a, b },
333 #define E_(a, b)        { a, b }
334
335 TRACE_EVENT(rxrpc_local,
336             TP_PROTO(unsigned int local_debug_id, enum rxrpc_local_trace op,
337                      int usage, const void *where),
338
339             TP_ARGS(local_debug_id, op, usage, where),
340
341             TP_STRUCT__entry(
342                     __field(unsigned int,       local           )
343                     __field(int,                op              )
344                     __field(int,                usage           )
345                     __field(const void *,       where           )
346                              ),
347
348             TP_fast_assign(
349                     __entry->local = local_debug_id;
350                     __entry->op = op;
351                     __entry->usage = usage;
352                     __entry->where = where;
353                            ),
354
355             TP_printk("L=%08x %s u=%d sp=%pSR",
356                       __entry->local,
357                       __print_symbolic(__entry->op, rxrpc_local_traces),
358                       __entry->usage,
359                       __entry->where)
360             );
361
362 TRACE_EVENT(rxrpc_peer,
363             TP_PROTO(unsigned int peer_debug_id, enum rxrpc_peer_trace op,
364                      int usage, const void *where),
365
366             TP_ARGS(peer_debug_id, op, usage, where),
367
368             TP_STRUCT__entry(
369                     __field(unsigned int,       peer            )
370                     __field(int,                op              )
371                     __field(int,                usage           )
372                     __field(const void *,       where           )
373                              ),
374
375             TP_fast_assign(
376                     __entry->peer = peer_debug_id;
377                     __entry->op = op;
378                     __entry->usage = usage;
379                     __entry->where = where;
380                            ),
381
382             TP_printk("P=%08x %s u=%d sp=%pSR",
383                       __entry->peer,
384                       __print_symbolic(__entry->op, rxrpc_peer_traces),
385                       __entry->usage,
386                       __entry->where)
387             );
388
389 TRACE_EVENT(rxrpc_conn,
390             TP_PROTO(unsigned int conn_debug_id, enum rxrpc_conn_trace op,
391                      int usage, const void *where),
392
393             TP_ARGS(conn_debug_id, op, usage, where),
394
395             TP_STRUCT__entry(
396                     __field(unsigned int,       conn            )
397                     __field(int,                op              )
398                     __field(int,                usage           )
399                     __field(const void *,       where           )
400                              ),
401
402             TP_fast_assign(
403                     __entry->conn = conn_debug_id;
404                     __entry->op = op;
405                     __entry->usage = usage;
406                     __entry->where = where;
407                            ),
408
409             TP_printk("C=%08x %s u=%d sp=%pSR",
410                       __entry->conn,
411                       __print_symbolic(__entry->op, rxrpc_conn_traces),
412                       __entry->usage,
413                       __entry->where)
414             );
415
416 TRACE_EVENT(rxrpc_client,
417             TP_PROTO(struct rxrpc_connection *conn, int channel,
418                      enum rxrpc_client_trace op),
419
420             TP_ARGS(conn, channel, op),
421
422             TP_STRUCT__entry(
423                     __field(unsigned int,               conn            )
424                     __field(u32,                        cid             )
425                     __field(int,                        channel         )
426                     __field(int,                        usage           )
427                     __field(enum rxrpc_client_trace,    op              )
428                              ),
429
430             TP_fast_assign(
431                     __entry->conn = conn ? conn->debug_id : 0;
432                     __entry->channel = channel;
433                     __entry->usage = conn ? refcount_read(&conn->ref) : -2;
434                     __entry->op = op;
435                     __entry->cid = conn ? conn->proto.cid : 0;
436                            ),
437
438             TP_printk("C=%08x h=%2d %s i=%08x u=%d",
439                       __entry->conn,
440                       __entry->channel,
441                       __print_symbolic(__entry->op, rxrpc_client_traces),
442                       __entry->cid,
443                       __entry->usage)
444             );
445
446 TRACE_EVENT(rxrpc_call,
447             TP_PROTO(unsigned int call_debug_id, enum rxrpc_call_trace op,
448                      int usage, const void *where, const void *aux),
449
450             TP_ARGS(call_debug_id, op, usage, where, aux),
451
452             TP_STRUCT__entry(
453                     __field(unsigned int,               call            )
454                     __field(int,                        op              )
455                     __field(int,                        usage           )
456                     __field(const void *,               where           )
457                     __field(const void *,               aux             )
458                              ),
459
460             TP_fast_assign(
461                     __entry->call = call_debug_id;
462                     __entry->op = op;
463                     __entry->usage = usage;
464                     __entry->where = where;
465                     __entry->aux = aux;
466                            ),
467
468             TP_printk("c=%08x %s u=%d sp=%pSR a=%p",
469                       __entry->call,
470                       __print_symbolic(__entry->op, rxrpc_call_traces),
471                       __entry->usage,
472                       __entry->where,
473                       __entry->aux)
474             );
475
476 TRACE_EVENT(rxrpc_skb,
477             TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
478                      int usage, int mod_count, const void *where),
479
480             TP_ARGS(skb, op, usage, mod_count, where),
481
482             TP_STRUCT__entry(
483                     __field(struct sk_buff *,           skb             )
484                     __field(enum rxrpc_skb_trace,       op              )
485                     __field(int,                        usage           )
486                     __field(int,                        mod_count       )
487                     __field(const void *,               where           )
488                              ),
489
490             TP_fast_assign(
491                     __entry->skb = skb;
492                     __entry->op = op;
493                     __entry->usage = usage;
494                     __entry->mod_count = mod_count;
495                     __entry->where = where;
496                            ),
497
498             TP_printk("s=%p Rx %s u=%d m=%d p=%pSR",
499                       __entry->skb,
500                       __print_symbolic(__entry->op, rxrpc_skb_traces),
501                       __entry->usage,
502                       __entry->mod_count,
503                       __entry->where)
504             );
505
506 TRACE_EVENT(rxrpc_rx_packet,
507             TP_PROTO(struct rxrpc_skb_priv *sp),
508
509             TP_ARGS(sp),
510
511             TP_STRUCT__entry(
512                     __field_struct(struct rxrpc_host_header,    hdr             )
513                              ),
514
515             TP_fast_assign(
516                     memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
517                            ),
518
519             TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
520                       __entry->hdr.epoch, __entry->hdr.cid,
521                       __entry->hdr.callNumber, __entry->hdr.serviceId,
522                       __entry->hdr.serial, __entry->hdr.seq,
523                       __entry->hdr.type, __entry->hdr.flags,
524                       __entry->hdr.type <= 15 ?
525                       __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
526             );
527
528 TRACE_EVENT(rxrpc_rx_done,
529             TP_PROTO(int result, int abort_code),
530
531             TP_ARGS(result, abort_code),
532
533             TP_STRUCT__entry(
534                     __field(int,                        result          )
535                     __field(int,                        abort_code      )
536                              ),
537
538             TP_fast_assign(
539                     __entry->result = result;
540                     __entry->abort_code = abort_code;
541                            ),
542
543             TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
544             );
545
546 TRACE_EVENT(rxrpc_abort,
547             TP_PROTO(unsigned int call_nr, const char *why, u32 cid, u32 call_id,
548                      rxrpc_seq_t seq, int abort_code, int error),
549
550             TP_ARGS(call_nr, why, cid, call_id, seq, abort_code, error),
551
552             TP_STRUCT__entry(
553                     __field(unsigned int,               call_nr         )
554                     __array(char,                       why, 4          )
555                     __field(u32,                        cid             )
556                     __field(u32,                        call_id         )
557                     __field(rxrpc_seq_t,                seq             )
558                     __field(int,                        abort_code      )
559                     __field(int,                        error           )
560                              ),
561
562             TP_fast_assign(
563                     memcpy(__entry->why, why, 4);
564                     __entry->call_nr = call_nr;
565                     __entry->cid = cid;
566                     __entry->call_id = call_id;
567                     __entry->abort_code = abort_code;
568                     __entry->error = error;
569                     __entry->seq = seq;
570                            ),
571
572             TP_printk("c=%08x %08x:%08x s=%u a=%d e=%d %s",
573                       __entry->call_nr,
574                       __entry->cid, __entry->call_id, __entry->seq,
575                       __entry->abort_code, __entry->error, __entry->why)
576             );
577
578 TRACE_EVENT(rxrpc_call_complete,
579             TP_PROTO(struct rxrpc_call *call),
580
581             TP_ARGS(call),
582
583             TP_STRUCT__entry(
584                     __field(unsigned int,               call            )
585                     __field(enum rxrpc_call_completion, compl           )
586                     __field(int,                        error           )
587                     __field(u32,                        abort_code      )
588                              ),
589
590             TP_fast_assign(
591                     __entry->call = call->debug_id;
592                     __entry->compl = call->completion;
593                     __entry->error = call->error;
594                     __entry->abort_code = call->abort_code;
595                            ),
596
597             TP_printk("c=%08x %s r=%d ac=%d",
598                       __entry->call,
599                       __print_symbolic(__entry->compl, rxrpc_completions),
600                       __entry->error,
601                       __entry->abort_code)
602             );
603
604 TRACE_EVENT(rxrpc_transmit,
605             TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
606
607             TP_ARGS(call, why),
608
609             TP_STRUCT__entry(
610                     __field(unsigned int,               call            )
611                     __field(enum rxrpc_transmit_trace,  why             )
612                     __field(rxrpc_seq_t,                tx_hard_ack     )
613                     __field(rxrpc_seq_t,                tx_top          )
614                     __field(int,                        tx_winsize      )
615                              ),
616
617             TP_fast_assign(
618                     __entry->call = call->debug_id;
619                     __entry->why = why;
620                     __entry->tx_hard_ack = call->tx_hard_ack;
621                     __entry->tx_top = call->tx_top;
622                     __entry->tx_winsize = call->tx_winsize;
623                            ),
624
625             TP_printk("c=%08x %s f=%08x n=%u/%u",
626                       __entry->call,
627                       __print_symbolic(__entry->why, rxrpc_transmit_traces),
628                       __entry->tx_hard_ack + 1,
629                       __entry->tx_top - __entry->tx_hard_ack,
630                       __entry->tx_winsize)
631             );
632
633 TRACE_EVENT(rxrpc_rx_data,
634             TP_PROTO(unsigned int call, rxrpc_seq_t seq,
635                      rxrpc_serial_t serial, u8 flags, u8 anno),
636
637             TP_ARGS(call, seq, serial, flags, anno),
638
639             TP_STRUCT__entry(
640                     __field(unsigned int,               call            )
641                     __field(rxrpc_seq_t,                seq             )
642                     __field(rxrpc_serial_t,             serial          )
643                     __field(u8,                         flags           )
644                     __field(u8,                         anno            )
645                              ),
646
647             TP_fast_assign(
648                     __entry->call = call;
649                     __entry->seq = seq;
650                     __entry->serial = serial;
651                     __entry->flags = flags;
652                     __entry->anno = anno;
653                            ),
654
655             TP_printk("c=%08x DATA %08x q=%08x fl=%02x a=%02x",
656                       __entry->call,
657                       __entry->serial,
658                       __entry->seq,
659                       __entry->flags,
660                       __entry->anno)
661             );
662
663 TRACE_EVENT(rxrpc_rx_ack,
664             TP_PROTO(struct rxrpc_call *call,
665                      rxrpc_serial_t serial, rxrpc_serial_t ack_serial,
666                      rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks),
667
668             TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
669
670             TP_STRUCT__entry(
671                     __field(unsigned int,               call            )
672                     __field(rxrpc_serial_t,             serial          )
673                     __field(rxrpc_serial_t,             ack_serial      )
674                     __field(rxrpc_seq_t,                first           )
675                     __field(rxrpc_seq_t,                prev            )
676                     __field(u8,                         reason          )
677                     __field(u8,                         n_acks          )
678                              ),
679
680             TP_fast_assign(
681                     __entry->call = call->debug_id;
682                     __entry->serial = serial;
683                     __entry->ack_serial = ack_serial;
684                     __entry->first = first;
685                     __entry->prev = prev;
686                     __entry->reason = reason;
687                     __entry->n_acks = n_acks;
688                            ),
689
690             TP_printk("c=%08x %08x %s r=%08x f=%08x p=%08x n=%u",
691                       __entry->call,
692                       __entry->serial,
693                       __print_symbolic(__entry->reason, rxrpc_ack_names),
694                       __entry->ack_serial,
695                       __entry->first,
696                       __entry->prev,
697                       __entry->n_acks)
698             );
699
700 TRACE_EVENT(rxrpc_rx_abort,
701             TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
702                      u32 abort_code),
703
704             TP_ARGS(call, serial, abort_code),
705
706             TP_STRUCT__entry(
707                     __field(unsigned int,               call            )
708                     __field(rxrpc_serial_t,             serial          )
709                     __field(u32,                        abort_code      )
710                              ),
711
712             TP_fast_assign(
713                     __entry->call = call->debug_id;
714                     __entry->serial = serial;
715                     __entry->abort_code = abort_code;
716                            ),
717
718             TP_printk("c=%08x ABORT %08x ac=%d",
719                       __entry->call,
720                       __entry->serial,
721                       __entry->abort_code)
722             );
723
724 TRACE_EVENT(rxrpc_rx_rwind_change,
725             TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
726                      u32 rwind, bool wake),
727
728             TP_ARGS(call, serial, rwind, wake),
729
730             TP_STRUCT__entry(
731                     __field(unsigned int,               call            )
732                     __field(rxrpc_serial_t,             serial          )
733                     __field(u32,                        rwind           )
734                     __field(bool,                       wake            )
735                              ),
736
737             TP_fast_assign(
738                     __entry->call = call->debug_id;
739                     __entry->serial = serial;
740                     __entry->rwind = rwind;
741                     __entry->wake = wake;
742                            ),
743
744             TP_printk("c=%08x %08x rw=%u%s",
745                       __entry->call,
746                       __entry->serial,
747                       __entry->rwind,
748                       __entry->wake ? " wake" : "")
749             );
750
751 TRACE_EVENT(rxrpc_tx_packet,
752             TP_PROTO(unsigned int call_id, struct rxrpc_wire_header *whdr,
753                      enum rxrpc_tx_point where),
754
755             TP_ARGS(call_id, whdr, where),
756
757             TP_STRUCT__entry(
758                     __field(unsigned int,                       call    )
759                     __field(enum rxrpc_tx_point,                where   )
760                     __field_struct(struct rxrpc_wire_header,    whdr    )
761                              ),
762
763             TP_fast_assign(
764                     __entry->call = call_id;
765                     memcpy(&__entry->whdr, whdr, sizeof(__entry->whdr));
766                     __entry->where = where;
767                            ),
768
769             TP_printk("c=%08x %08x:%08x:%08x:%04x %08x %08x %02x %02x %s %s",
770                       __entry->call,
771                       ntohl(__entry->whdr.epoch),
772                       ntohl(__entry->whdr.cid),
773                       ntohl(__entry->whdr.callNumber),
774                       ntohs(__entry->whdr.serviceId),
775                       ntohl(__entry->whdr.serial),
776                       ntohl(__entry->whdr.seq),
777                       __entry->whdr.type, __entry->whdr.flags,
778                       __entry->whdr.type <= 15 ?
779                       __print_symbolic(__entry->whdr.type, rxrpc_pkts) : "?UNK",
780                       __print_symbolic(__entry->where, rxrpc_tx_points))
781             );
782
783 TRACE_EVENT(rxrpc_tx_data,
784             TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
785                      rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
786
787             TP_ARGS(call, seq, serial, flags, retrans, lose),
788
789             TP_STRUCT__entry(
790                     __field(unsigned int,               call            )
791                     __field(rxrpc_seq_t,                seq             )
792                     __field(rxrpc_serial_t,             serial          )
793                     __field(u32,                        cid             )
794                     __field(u32,                        call_id         )
795                     __field(u8,                         flags           )
796                     __field(bool,                       retrans         )
797                     __field(bool,                       lose            )
798                              ),
799
800             TP_fast_assign(
801                     __entry->call = call->debug_id;
802                     __entry->cid = call->cid;
803                     __entry->call_id = call->call_id;
804                     __entry->seq = seq;
805                     __entry->serial = serial;
806                     __entry->flags = flags;
807                     __entry->retrans = retrans;
808                     __entry->lose = lose;
809                            ),
810
811             TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s%s",
812                       __entry->call,
813                       __entry->cid,
814                       __entry->call_id,
815                       __entry->serial,
816                       __entry->seq,
817                       __entry->flags,
818                       __entry->retrans ? " *RETRANS*" : "",
819                       __entry->lose ? " *LOSE*" : "")
820             );
821
822 TRACE_EVENT(rxrpc_tx_ack,
823             TP_PROTO(unsigned int call, rxrpc_serial_t serial,
824                      rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
825                      u8 reason, u8 n_acks),
826
827             TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
828
829             TP_STRUCT__entry(
830                     __field(unsigned int,               call            )
831                     __field(rxrpc_serial_t,             serial          )
832                     __field(rxrpc_seq_t,                ack_first       )
833                     __field(rxrpc_serial_t,             ack_serial      )
834                     __field(u8,                         reason          )
835                     __field(u8,                         n_acks          )
836                              ),
837
838             TP_fast_assign(
839                     __entry->call = call;
840                     __entry->serial = serial;
841                     __entry->ack_first = ack_first;
842                     __entry->ack_serial = ack_serial;
843                     __entry->reason = reason;
844                     __entry->n_acks = n_acks;
845                            ),
846
847             TP_printk(" c=%08x ACK  %08x %s f=%08x r=%08x n=%u",
848                       __entry->call,
849                       __entry->serial,
850                       __print_symbolic(__entry->reason, rxrpc_ack_names),
851                       __entry->ack_first,
852                       __entry->ack_serial,
853                       __entry->n_acks)
854             );
855
856 TRACE_EVENT(rxrpc_receive,
857             TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
858                      rxrpc_serial_t serial, rxrpc_seq_t seq),
859
860             TP_ARGS(call, why, serial, seq),
861
862             TP_STRUCT__entry(
863                     __field(unsigned int,               call            )
864                     __field(enum rxrpc_receive_trace,   why             )
865                     __field(rxrpc_serial_t,             serial          )
866                     __field(rxrpc_seq_t,                seq             )
867                     __field(rxrpc_seq_t,                hard_ack        )
868                     __field(rxrpc_seq_t,                top             )
869                              ),
870
871             TP_fast_assign(
872                     __entry->call = call->debug_id;
873                     __entry->why = why;
874                     __entry->serial = serial;
875                     __entry->seq = seq;
876                     __entry->hard_ack = call->rx_hard_ack;
877                     __entry->top = call->rx_top;
878                            ),
879
880             TP_printk("c=%08x %s r=%08x q=%08x w=%08x-%08x",
881                       __entry->call,
882                       __print_symbolic(__entry->why, rxrpc_receive_traces),
883                       __entry->serial,
884                       __entry->seq,
885                       __entry->hard_ack,
886                       __entry->top)
887             );
888
889 TRACE_EVENT(rxrpc_recvmsg,
890             TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
891                      rxrpc_seq_t seq, unsigned int offset, unsigned int len,
892                      int ret),
893
894             TP_ARGS(call, why, seq, offset, len, ret),
895
896             TP_STRUCT__entry(
897                     __field(unsigned int,               call            )
898                     __field(enum rxrpc_recvmsg_trace,   why             )
899                     __field(rxrpc_seq_t,                seq             )
900                     __field(unsigned int,               offset          )
901                     __field(unsigned int,               len             )
902                     __field(int,                        ret             )
903                              ),
904
905             TP_fast_assign(
906                     __entry->call = call ? call->debug_id : 0;
907                     __entry->why = why;
908                     __entry->seq = seq;
909                     __entry->offset = offset;
910                     __entry->len = len;
911                     __entry->ret = ret;
912                            ),
913
914             TP_printk("c=%08x %s q=%08x o=%u l=%u ret=%d",
915                       __entry->call,
916                       __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
917                       __entry->seq,
918                       __entry->offset,
919                       __entry->len,
920                       __entry->ret)
921             );
922
923 TRACE_EVENT(rxrpc_rtt_tx,
924             TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
925                      int slot, rxrpc_serial_t send_serial),
926
927             TP_ARGS(call, why, slot, send_serial),
928
929             TP_STRUCT__entry(
930                     __field(unsigned int,               call            )
931                     __field(enum rxrpc_rtt_tx_trace,    why             )
932                     __field(int,                        slot            )
933                     __field(rxrpc_serial_t,             send_serial     )
934                              ),
935
936             TP_fast_assign(
937                     __entry->call = call->debug_id;
938                     __entry->why = why;
939                     __entry->slot = slot;
940                     __entry->send_serial = send_serial;
941                            ),
942
943             TP_printk("c=%08x [%d] %s sr=%08x",
944                       __entry->call,
945                       __entry->slot,
946                       __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
947                       __entry->send_serial)
948             );
949
950 TRACE_EVENT(rxrpc_rtt_rx,
951             TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
952                      int slot,
953                      rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
954                      u32 rtt, u32 rto),
955
956             TP_ARGS(call, why, slot, send_serial, resp_serial, rtt, rto),
957
958             TP_STRUCT__entry(
959                     __field(unsigned int,               call            )
960                     __field(enum rxrpc_rtt_rx_trace,    why             )
961                     __field(int,                        slot            )
962                     __field(rxrpc_serial_t,             send_serial     )
963                     __field(rxrpc_serial_t,             resp_serial     )
964                     __field(u32,                        rtt             )
965                     __field(u32,                        rto             )
966                              ),
967
968             TP_fast_assign(
969                     __entry->call = call->debug_id;
970                     __entry->why = why;
971                     __entry->slot = slot;
972                     __entry->send_serial = send_serial;
973                     __entry->resp_serial = resp_serial;
974                     __entry->rtt = rtt;
975                     __entry->rto = rto;
976                            ),
977
978             TP_printk("c=%08x [%d] %s sr=%08x rr=%08x rtt=%u rto=%u",
979                       __entry->call,
980                       __entry->slot,
981                       __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
982                       __entry->send_serial,
983                       __entry->resp_serial,
984                       __entry->rtt,
985                       __entry->rto)
986             );
987
988 TRACE_EVENT(rxrpc_timer,
989             TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
990                      unsigned long now),
991
992             TP_ARGS(call, why, now),
993
994             TP_STRUCT__entry(
995                     __field(unsigned int,                       call            )
996                     __field(enum rxrpc_timer_trace,             why             )
997                     __field(long,                               now             )
998                     __field(long,                               ack_at          )
999                     __field(long,                               ack_lost_at     )
1000                     __field(long,                               resend_at       )
1001                     __field(long,                               ping_at         )
1002                     __field(long,                               expect_rx_by    )
1003                     __field(long,                               expect_req_by   )
1004                     __field(long,                               expect_term_by  )
1005                     __field(long,                               timer           )
1006                              ),
1007
1008             TP_fast_assign(
1009                     __entry->call               = call->debug_id;
1010                     __entry->why                = why;
1011                     __entry->now                = now;
1012                     __entry->ack_at             = call->ack_at;
1013                     __entry->ack_lost_at        = call->ack_lost_at;
1014                     __entry->resend_at          = call->resend_at;
1015                     __entry->expect_rx_by       = call->expect_rx_by;
1016                     __entry->expect_req_by      = call->expect_req_by;
1017                     __entry->expect_term_by     = call->expect_term_by;
1018                     __entry->timer              = call->timer.expires;
1019                            ),
1020
1021             TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
1022                       __entry->call,
1023                       __print_symbolic(__entry->why, rxrpc_timer_traces),
1024                       __entry->ack_at - __entry->now,
1025                       __entry->ack_lost_at - __entry->now,
1026                       __entry->resend_at - __entry->now,
1027                       __entry->expect_rx_by - __entry->now,
1028                       __entry->expect_req_by - __entry->now,
1029                       __entry->expect_term_by - __entry->now,
1030                       __entry->timer - __entry->now)
1031             );
1032
1033 TRACE_EVENT(rxrpc_timer_expired,
1034             TP_PROTO(struct rxrpc_call *call, unsigned long now),
1035
1036             TP_ARGS(call, now),
1037
1038             TP_STRUCT__entry(
1039                     __field(unsigned int,                       call            )
1040                     __field(long,                               now             )
1041                     __field(long,                               ack_at          )
1042                     __field(long,                               ack_lost_at     )
1043                     __field(long,                               resend_at       )
1044                     __field(long,                               ping_at         )
1045                     __field(long,                               expect_rx_by    )
1046                     __field(long,                               expect_req_by   )
1047                     __field(long,                               expect_term_by  )
1048                     __field(long,                               timer           )
1049                              ),
1050
1051             TP_fast_assign(
1052                     __entry->call               = call->debug_id;
1053                     __entry->now                = now;
1054                     __entry->ack_at             = call->ack_at;
1055                     __entry->ack_lost_at        = call->ack_lost_at;
1056                     __entry->resend_at          = call->resend_at;
1057                     __entry->expect_rx_by       = call->expect_rx_by;
1058                     __entry->expect_req_by      = call->expect_req_by;
1059                     __entry->expect_term_by     = call->expect_term_by;
1060                     __entry->timer              = call->timer.expires;
1061                            ),
1062
1063             TP_printk("c=%08x EXPIRED a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
1064                       __entry->call,
1065                       __entry->ack_at - __entry->now,
1066                       __entry->ack_lost_at - __entry->now,
1067                       __entry->resend_at - __entry->now,
1068                       __entry->expect_rx_by - __entry->now,
1069                       __entry->expect_req_by - __entry->now,
1070                       __entry->expect_term_by - __entry->now,
1071                       __entry->timer - __entry->now)
1072             );
1073
1074 TRACE_EVENT(rxrpc_rx_lose,
1075             TP_PROTO(struct rxrpc_skb_priv *sp),
1076
1077             TP_ARGS(sp),
1078
1079             TP_STRUCT__entry(
1080                     __field_struct(struct rxrpc_host_header,    hdr             )
1081                              ),
1082
1083             TP_fast_assign(
1084                     memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
1085                            ),
1086
1087             TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
1088                       __entry->hdr.epoch, __entry->hdr.cid,
1089                       __entry->hdr.callNumber, __entry->hdr.serviceId,
1090                       __entry->hdr.serial, __entry->hdr.seq,
1091                       __entry->hdr.type, __entry->hdr.flags,
1092                       __entry->hdr.type <= 15 ?
1093                       __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
1094             );
1095
1096 TRACE_EVENT(rxrpc_propose_ack,
1097             TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1098                      u8 ack_reason, rxrpc_serial_t serial, bool immediate,
1099                      bool background, enum rxrpc_propose_ack_outcome outcome),
1100
1101             TP_ARGS(call, why, ack_reason, serial, immediate, background,
1102                     outcome),
1103
1104             TP_STRUCT__entry(
1105                     __field(unsigned int,                       call            )
1106                     __field(enum rxrpc_propose_ack_trace,       why             )
1107                     __field(rxrpc_serial_t,                     serial          )
1108                     __field(u8,                                 ack_reason      )
1109                     __field(bool,                               immediate       )
1110                     __field(bool,                               background      )
1111                     __field(enum rxrpc_propose_ack_outcome,     outcome         )
1112                              ),
1113
1114             TP_fast_assign(
1115                     __entry->call       = call->debug_id;
1116                     __entry->why        = why;
1117                     __entry->serial     = serial;
1118                     __entry->ack_reason = ack_reason;
1119                     __entry->immediate  = immediate;
1120                     __entry->background = background;
1121                     __entry->outcome    = outcome;
1122                            ),
1123
1124             TP_printk("c=%08x %s %s r=%08x i=%u b=%u%s",
1125                       __entry->call,
1126                       __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1127                       __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
1128                       __entry->serial,
1129                       __entry->immediate,
1130                       __entry->background,
1131                       __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
1132             );
1133
1134 TRACE_EVENT(rxrpc_retransmit,
1135             TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
1136                      s64 expiry),
1137
1138             TP_ARGS(call, seq, annotation, expiry),
1139
1140             TP_STRUCT__entry(
1141                     __field(unsigned int,               call            )
1142                     __field(rxrpc_seq_t,                seq             )
1143                     __field(u8,                         annotation      )
1144                     __field(s64,                        expiry          )
1145                              ),
1146
1147             TP_fast_assign(
1148                     __entry->call = call->debug_id;
1149                     __entry->seq = seq;
1150                     __entry->annotation = annotation;
1151                     __entry->expiry = expiry;
1152                            ),
1153
1154             TP_printk("c=%08x q=%x a=%02x xp=%lld",
1155                       __entry->call,
1156                       __entry->seq,
1157                       __entry->annotation,
1158                       __entry->expiry)
1159             );
1160
1161 TRACE_EVENT(rxrpc_congest,
1162             TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
1163                      rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
1164
1165             TP_ARGS(call, summary, ack_serial, change),
1166
1167             TP_STRUCT__entry(
1168                     __field(unsigned int,                       call            )
1169                     __field(enum rxrpc_congest_change,          change          )
1170                     __field(rxrpc_seq_t,                        hard_ack        )
1171                     __field(rxrpc_seq_t,                        top             )
1172                     __field(rxrpc_seq_t,                        lowest_nak      )
1173                     __field(rxrpc_serial_t,                     ack_serial      )
1174                     __field_struct(struct rxrpc_ack_summary,    sum             )
1175                              ),
1176
1177             TP_fast_assign(
1178                     __entry->call       = call->debug_id;
1179                     __entry->change     = change;
1180                     __entry->hard_ack   = call->tx_hard_ack;
1181                     __entry->top        = call->tx_top;
1182                     __entry->lowest_nak = call->acks_lowest_nak;
1183                     __entry->ack_serial = ack_serial;
1184                     memcpy(&__entry->sum, summary, sizeof(__entry->sum));
1185                            ),
1186
1187             TP_printk("c=%08x r=%08x %s q=%08x %s cw=%u ss=%u nr=%u,%u nw=%u,%u r=%u b=%u u=%u d=%u l=%x%s%s%s",
1188                       __entry->call,
1189                       __entry->ack_serial,
1190                       __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
1191                       __entry->hard_ack,
1192                       __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
1193                       __entry->sum.cwnd,
1194                       __entry->sum.ssthresh,
1195                       __entry->sum.nr_acks, __entry->sum.nr_nacks,
1196                       __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
1197                       __entry->sum.nr_rot_new_acks,
1198                       __entry->top - __entry->hard_ack,
1199                       __entry->sum.cumulative_acks,
1200                       __entry->sum.dup_acks,
1201                       __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
1202                       __print_symbolic(__entry->change, rxrpc_congest_changes),
1203                       __entry->sum.retrans_timeo ? " rTxTo" : "")
1204             );
1205
1206 TRACE_EVENT(rxrpc_disconnect_call,
1207             TP_PROTO(struct rxrpc_call *call),
1208
1209             TP_ARGS(call),
1210
1211             TP_STRUCT__entry(
1212                     __field(unsigned int,               call            )
1213                     __field(u32,                        abort_code      )
1214                              ),
1215
1216             TP_fast_assign(
1217                     __entry->call = call->debug_id;
1218                     __entry->abort_code = call->abort_code;
1219                            ),
1220
1221             TP_printk("c=%08x ab=%08x",
1222                       __entry->call,
1223                       __entry->abort_code)
1224             );
1225
1226 TRACE_EVENT(rxrpc_improper_term,
1227             TP_PROTO(struct rxrpc_call *call),
1228
1229             TP_ARGS(call),
1230
1231             TP_STRUCT__entry(
1232                     __field(unsigned int,               call            )
1233                     __field(u32,                        abort_code      )
1234                              ),
1235
1236             TP_fast_assign(
1237                     __entry->call = call->debug_id;
1238                     __entry->abort_code = call->abort_code;
1239                            ),
1240
1241             TP_printk("c=%08x ab=%08x",
1242                       __entry->call,
1243                       __entry->abort_code)
1244             );
1245
1246 TRACE_EVENT(rxrpc_rx_eproto,
1247             TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
1248                      const char *why),
1249
1250             TP_ARGS(call, serial, why),
1251
1252             TP_STRUCT__entry(
1253                     __field(unsigned int,               call            )
1254                     __field(rxrpc_serial_t,             serial          )
1255                     __field(const char *,               why             )
1256                              ),
1257
1258             TP_fast_assign(
1259                     __entry->call = call ? call->debug_id : 0;
1260                     __entry->serial = serial;
1261                     __entry->why = why;
1262                            ),
1263
1264             TP_printk("c=%08x EPROTO %08x %s",
1265                       __entry->call,
1266                       __entry->serial,
1267                       __entry->why)
1268             );
1269
1270 TRACE_EVENT(rxrpc_connect_call,
1271             TP_PROTO(struct rxrpc_call *call),
1272
1273             TP_ARGS(call),
1274
1275             TP_STRUCT__entry(
1276                     __field(unsigned int,               call            )
1277                     __field(unsigned long,              user_call_ID    )
1278                     __field(u32,                        cid             )
1279                     __field(u32,                        call_id         )
1280                              ),
1281
1282             TP_fast_assign(
1283                     __entry->call = call->debug_id;
1284                     __entry->user_call_ID = call->user_call_ID;
1285                     __entry->cid = call->cid;
1286                     __entry->call_id = call->call_id;
1287                            ),
1288
1289             TP_printk("c=%08x u=%p %08x:%08x",
1290                       __entry->call,
1291                       (void *)__entry->user_call_ID,
1292                       __entry->cid,
1293                       __entry->call_id)
1294             );
1295
1296 TRACE_EVENT(rxrpc_resend,
1297             TP_PROTO(struct rxrpc_call *call, int ix),
1298
1299             TP_ARGS(call, ix),
1300
1301             TP_STRUCT__entry(
1302                     __field(unsigned int,               call            )
1303                     __field(int,                        ix              )
1304                     __array(u8,                         anno, 64        )
1305                              ),
1306
1307             TP_fast_assign(
1308                     __entry->call = call->debug_id;
1309                     __entry->ix = ix;
1310                     memcpy(__entry->anno, call->rxtx_annotations, 64);
1311                            ),
1312
1313             TP_printk("c=%08x ix=%u a=%64phN",
1314                       __entry->call,
1315                       __entry->ix,
1316                       __entry->anno)
1317             );
1318
1319 TRACE_EVENT(rxrpc_rx_icmp,
1320             TP_PROTO(struct rxrpc_peer *peer, struct sock_extended_err *ee,
1321                      struct sockaddr_rxrpc *srx),
1322
1323             TP_ARGS(peer, ee, srx),
1324
1325             TP_STRUCT__entry(
1326                     __field(unsigned int,                       peer    )
1327                     __field_struct(struct sock_extended_err,    ee      )
1328                     __field_struct(struct sockaddr_rxrpc,       srx     )
1329                              ),
1330
1331             TP_fast_assign(
1332                     __entry->peer = peer->debug_id;
1333                     memcpy(&__entry->ee, ee, sizeof(__entry->ee));
1334                     memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1335                            ),
1336
1337             TP_printk("P=%08x o=%u t=%u c=%u i=%u d=%u e=%d %pISp",
1338                       __entry->peer,
1339                       __entry->ee.ee_origin,
1340                       __entry->ee.ee_type,
1341                       __entry->ee.ee_code,
1342                       __entry->ee.ee_info,
1343                       __entry->ee.ee_data,
1344                       __entry->ee.ee_errno,
1345                       &__entry->srx.transport)
1346             );
1347
1348 TRACE_EVENT(rxrpc_tx_fail,
1349             TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret,
1350                      enum rxrpc_tx_point where),
1351
1352             TP_ARGS(debug_id, serial, ret, where),
1353
1354             TP_STRUCT__entry(
1355                     __field(unsigned int,               debug_id        )
1356                     __field(rxrpc_serial_t,             serial          )
1357                     __field(int,                        ret             )
1358                     __field(enum rxrpc_tx_point,        where           )
1359                              ),
1360
1361             TP_fast_assign(
1362                     __entry->debug_id = debug_id;
1363                     __entry->serial = serial;
1364                     __entry->ret = ret;
1365                     __entry->where = where;
1366                            ),
1367
1368             TP_printk("c=%08x r=%x ret=%d %s",
1369                       __entry->debug_id,
1370                       __entry->serial,
1371                       __entry->ret,
1372                       __print_symbolic(__entry->where, rxrpc_tx_points))
1373             );
1374
1375 TRACE_EVENT(rxrpc_call_reset,
1376             TP_PROTO(struct rxrpc_call *call),
1377
1378             TP_ARGS(call),
1379
1380             TP_STRUCT__entry(
1381                     __field(unsigned int,               debug_id        )
1382                     __field(u32,                        cid             )
1383                     __field(u32,                        call_id         )
1384                     __field(rxrpc_serial_t,             call_serial     )
1385                     __field(rxrpc_serial_t,             conn_serial     )
1386                     __field(rxrpc_seq_t,                tx_seq          )
1387                     __field(rxrpc_seq_t,                rx_seq          )
1388                              ),
1389
1390             TP_fast_assign(
1391                     __entry->debug_id = call->debug_id;
1392                     __entry->cid = call->cid;
1393                     __entry->call_id = call->call_id;
1394                     __entry->call_serial = call->rx_serial;
1395                     __entry->conn_serial = call->conn->hi_serial;
1396                     __entry->tx_seq = call->tx_hard_ack;
1397                     __entry->rx_seq = call->rx_hard_ack;
1398                            ),
1399
1400             TP_printk("c=%08x %08x:%08x r=%08x/%08x tx=%08x rx=%08x",
1401                       __entry->debug_id,
1402                       __entry->cid, __entry->call_id,
1403                       __entry->call_serial, __entry->conn_serial,
1404                       __entry->tx_seq, __entry->rx_seq)
1405             );
1406
1407 TRACE_EVENT(rxrpc_notify_socket,
1408             TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial),
1409
1410             TP_ARGS(debug_id, serial),
1411
1412             TP_STRUCT__entry(
1413                     __field(unsigned int,               debug_id        )
1414                     __field(rxrpc_serial_t,             serial          )
1415                              ),
1416
1417             TP_fast_assign(
1418                     __entry->debug_id = debug_id;
1419                     __entry->serial = serial;
1420                            ),
1421
1422             TP_printk("c=%08x r=%08x",
1423                       __entry->debug_id,
1424                       __entry->serial)
1425             );
1426
1427 TRACE_EVENT(rxrpc_rx_discard_ack,
1428             TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial,
1429                      rxrpc_seq_t first_soft_ack, rxrpc_seq_t call_ackr_first,
1430                      rxrpc_seq_t prev_pkt, rxrpc_seq_t call_ackr_prev),
1431
1432             TP_ARGS(debug_id, serial, first_soft_ack, call_ackr_first,
1433                     prev_pkt, call_ackr_prev),
1434
1435             TP_STRUCT__entry(
1436                     __field(unsigned int,       debug_id        )
1437                     __field(rxrpc_serial_t,     serial          )
1438                     __field(rxrpc_seq_t,        first_soft_ack)
1439                     __field(rxrpc_seq_t,        call_ackr_first)
1440                     __field(rxrpc_seq_t,        prev_pkt)
1441                     __field(rxrpc_seq_t,        call_ackr_prev)
1442                              ),
1443
1444             TP_fast_assign(
1445                     __entry->debug_id           = debug_id;
1446                     __entry->serial             = serial;
1447                     __entry->first_soft_ack     = first_soft_ack;
1448                     __entry->call_ackr_first    = call_ackr_first;
1449                     __entry->prev_pkt           = prev_pkt;
1450                     __entry->call_ackr_prev     = call_ackr_prev;
1451                            ),
1452
1453             TP_printk("c=%08x r=%08x %08x<%08x %08x<%08x",
1454                       __entry->debug_id,
1455                       __entry->serial,
1456                       __entry->first_soft_ack,
1457                       __entry->call_ackr_first,
1458                       __entry->prev_pkt,
1459                       __entry->call_ackr_prev)
1460             );
1461
1462 TRACE_EVENT(rxrpc_req_ack,
1463             TP_PROTO(unsigned int call_debug_id, rxrpc_seq_t seq,
1464                      enum rxrpc_req_ack_trace why),
1465
1466             TP_ARGS(call_debug_id, seq, why),
1467
1468             TP_STRUCT__entry(
1469                     __field(unsigned int,               call_debug_id   )
1470                     __field(rxrpc_seq_t,                seq             )
1471                     __field(enum rxrpc_req_ack_trace,   why             )
1472                              ),
1473
1474             TP_fast_assign(
1475                     __entry->call_debug_id = call_debug_id;
1476                     __entry->seq = seq;
1477                     __entry->why = why;
1478                            ),
1479
1480             TP_printk("c=%08x q=%08x REQ-%s",
1481                       __entry->call_debug_id,
1482                       __entry->seq,
1483                       __print_symbolic(__entry->why, rxrpc_req_ack_traces))
1484             );
1485
1486 TRACE_EVENT(rxrpc_txbuf,
1487             TP_PROTO(unsigned int debug_id,
1488                      unsigned int call_debug_id, rxrpc_seq_t seq,
1489                      int ref, enum rxrpc_txbuf_trace what),
1490
1491             TP_ARGS(debug_id, call_debug_id, seq, ref, what),
1492
1493             TP_STRUCT__entry(
1494                     __field(unsigned int,               debug_id        )
1495                     __field(unsigned int,               call_debug_id   )
1496                     __field(rxrpc_seq_t,                seq             )
1497                     __field(int,                        ref             )
1498                     __field(enum rxrpc_txbuf_trace,     what            )
1499                              ),
1500
1501             TP_fast_assign(
1502                     __entry->debug_id = debug_id;
1503                     __entry->call_debug_id = call_debug_id;
1504                     __entry->seq = seq;
1505                     __entry->ref = ref;
1506                     __entry->what = what;
1507                            ),
1508
1509             TP_printk("B=%08x c=%08x q=%08x %s r=%d",
1510                       __entry->debug_id,
1511                       __entry->call_debug_id,
1512                       __entry->seq,
1513                       __print_symbolic(__entry->what, rxrpc_txbuf_traces),
1514                       __entry->ref)
1515             );
1516
1517 #undef EM
1518 #undef E_
1519 #endif /* _TRACE_RXRPC_H */
1520
1521 /* This part must be outside protection */
1522 #include <trace/define_trace.h>