1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* AF_RXRPC tracepoints
4 * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
8 #define TRACE_SYSTEM rxrpc
10 #if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _TRACE_RXRPC_H
13 #include <linux/tracepoint.h>
14 #include <linux/errqueue.h>
17 * Declare tracing information enums and their string mappings for display.
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
134 #define rxrpc_timer_traces \
135 EM(rxrpc_timer_begin, "Begin ") \
136 EM(rxrpc_timer_expired, "*EXPR*") \
137 EM(rxrpc_timer_exp_ack, "ExpAck") \
138 EM(rxrpc_timer_exp_hard, "ExpHrd") \
139 EM(rxrpc_timer_exp_idle, "ExpIdl") \
140 EM(rxrpc_timer_exp_keepalive, "ExpKA ") \
141 EM(rxrpc_timer_exp_lost_ack, "ExpLoA") \
142 EM(rxrpc_timer_exp_normal, "ExpNml") \
143 EM(rxrpc_timer_exp_ping, "ExpPng") \
144 EM(rxrpc_timer_exp_resend, "ExpRsn") \
145 EM(rxrpc_timer_init_for_reply, "IniRpl") \
146 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
147 EM(rxrpc_timer_restart, "Restrt") \
148 EM(rxrpc_timer_set_for_ack, "SetAck") \
149 EM(rxrpc_timer_set_for_hard, "SetHrd") \
150 EM(rxrpc_timer_set_for_idle, "SetIdl") \
151 EM(rxrpc_timer_set_for_keepalive, "KeepAl") \
152 EM(rxrpc_timer_set_for_lost_ack, "SetLoA") \
153 EM(rxrpc_timer_set_for_normal, "SetNml") \
154 EM(rxrpc_timer_set_for_ping, "SetPng") \
155 EM(rxrpc_timer_set_for_resend, "SetRTx") \
156 E_(rxrpc_timer_set_for_send, "SetSnd")
158 #define rxrpc_propose_ack_traces \
159 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
160 EM(rxrpc_propose_ack_input_data, "DataIn ") \
161 EM(rxrpc_propose_ack_ping_for_check_life, "ChkLife") \
162 EM(rxrpc_propose_ack_ping_for_keepalive, "KeepAlv") \
163 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
164 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
165 EM(rxrpc_propose_ack_ping_for_params, "Params ") \
166 EM(rxrpc_propose_ack_processing_op, "ProcOp ") \
167 EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \
168 EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \
169 EM(rxrpc_propose_ack_retry_tx, "RetryTx") \
170 EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \
171 E_(rxrpc_propose_ack_terminal_ack, "ClTerm ")
173 #define rxrpc_propose_ack_outcomes \
174 EM(rxrpc_propose_ack_subsume, " Subsume") \
175 EM(rxrpc_propose_ack_update, " Update") \
176 E_(rxrpc_propose_ack_use, " New")
178 #define rxrpc_congest_modes \
179 EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \
180 EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \
181 EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \
182 E_(RXRPC_CALL_SLOW_START, "SlowStart")
184 #define rxrpc_congest_changes \
185 EM(rxrpc_cong_begin_retransmission, " Retrans") \
186 EM(rxrpc_cong_cleared_nacks, " Cleared") \
187 EM(rxrpc_cong_new_low_nack, " NewLowN") \
188 EM(rxrpc_cong_no_change, " -") \
189 EM(rxrpc_cong_progress, " Progres") \
190 EM(rxrpc_cong_retransmit_again, " ReTxAgn") \
191 EM(rxrpc_cong_rtt_window_end, " RttWinE") \
192 E_(rxrpc_cong_saw_nack, " SawNack")
196 EM(RXRPC_PACKET_TYPE_DATA, "DATA") \
197 EM(RXRPC_PACKET_TYPE_ACK, "ACK") \
198 EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \
199 EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \
200 EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \
201 EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \
202 EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \
203 EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \
208 EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \
212 #define rxrpc_ack_names \
214 EM(RXRPC_ACK_REQUESTED, "REQ") \
215 EM(RXRPC_ACK_DUPLICATE, "DUP") \
216 EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \
217 EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \
218 EM(RXRPC_ACK_NOSPACE, "MEM") \
219 EM(RXRPC_ACK_PING, "PNG") \
220 EM(RXRPC_ACK_PING_RESPONSE, "PNR") \
221 EM(RXRPC_ACK_DELAY, "DLY") \
222 EM(RXRPC_ACK_IDLE, "IDL") \
223 E_(RXRPC_ACK__INVALID, "-?-")
225 #define rxrpc_completions \
226 EM(RXRPC_CALL_SUCCEEDED, "Succeeded") \
227 EM(RXRPC_CALL_REMOTELY_ABORTED, "RemoteAbort") \
228 EM(RXRPC_CALL_LOCALLY_ABORTED, "LocalAbort") \
229 EM(RXRPC_CALL_LOCAL_ERROR, "LocalError") \
230 E_(RXRPC_CALL_NETWORK_ERROR, "NetError")
232 #define rxrpc_tx_points \
233 EM(rxrpc_tx_point_call_abort, "CallAbort") \
234 EM(rxrpc_tx_point_call_ack, "CallAck") \
235 EM(rxrpc_tx_point_call_data_frag, "CallDataFrag") \
236 EM(rxrpc_tx_point_call_data_nofrag, "CallDataNofrag") \
237 EM(rxrpc_tx_point_call_final_resend, "CallFinalResend") \
238 EM(rxrpc_tx_point_conn_abort, "ConnAbort") \
239 EM(rxrpc_tx_point_reject, "Reject") \
240 EM(rxrpc_tx_point_rxkad_challenge, "RxkadChall") \
241 EM(rxrpc_tx_point_rxkad_response, "RxkadResp") \
242 EM(rxrpc_tx_point_version_keepalive, "VerKeepalive") \
243 E_(rxrpc_tx_point_version_reply, "VerReply")
246 * Generate enums for tracing information.
248 #ifndef __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
249 #define __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY
256 enum rxrpc_call_trace { rxrpc_call_traces } __mode(byte);
257 enum rxrpc_client_trace { rxrpc_client_traces } __mode(byte);
258 enum rxrpc_congest_change { rxrpc_congest_changes } __mode(byte);
259 enum rxrpc_conn_trace { rxrpc_conn_traces } __mode(byte);
260 enum rxrpc_local_trace { rxrpc_local_traces } __mode(byte);
261 enum rxrpc_peer_trace { rxrpc_peer_traces } __mode(byte);
262 enum rxrpc_propose_ack_outcome { rxrpc_propose_ack_outcomes } __mode(byte);
263 enum rxrpc_propose_ack_trace { rxrpc_propose_ack_traces } __mode(byte);
264 enum rxrpc_receive_trace { rxrpc_receive_traces } __mode(byte);
265 enum rxrpc_recvmsg_trace { rxrpc_recvmsg_traces } __mode(byte);
266 enum rxrpc_rtt_rx_trace { rxrpc_rtt_rx_traces } __mode(byte);
267 enum rxrpc_rtt_tx_trace { rxrpc_rtt_tx_traces } __mode(byte);
268 enum rxrpc_skb_trace { rxrpc_skb_traces } __mode(byte);
269 enum rxrpc_timer_trace { rxrpc_timer_traces } __mode(byte);
270 enum rxrpc_transmit_trace { rxrpc_transmit_traces } __mode(byte);
271 enum rxrpc_tx_point { rxrpc_tx_points } __mode(byte);
273 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
276 * Export enum symbols via userspace.
280 #define EM(a, b) TRACE_DEFINE_ENUM(a);
281 #define E_(a, b) TRACE_DEFINE_ENUM(a);
285 rxrpc_congest_changes;
289 rxrpc_propose_ack_outcomes;
290 rxrpc_propose_ack_traces;
291 rxrpc_receive_traces;
292 rxrpc_recvmsg_traces;
297 rxrpc_transmit_traces;
301 * Now redefine the EM() and E_() macros to map the enums to the strings that
302 * will be printed in the output.
306 #define EM(a, b) { a, b },
307 #define E_(a, b) { a, b }
309 TRACE_EVENT(rxrpc_local,
310 TP_PROTO(unsigned int local_debug_id, enum rxrpc_local_trace op,
311 int usage, const void *where),
313 TP_ARGS(local_debug_id, op, usage, where),
316 __field(unsigned int, local )
319 __field(const void *, where )
323 __entry->local = local_debug_id;
325 __entry->usage = usage;
326 __entry->where = where;
329 TP_printk("L=%08x %s u=%d sp=%pSR",
331 __print_symbolic(__entry->op, rxrpc_local_traces),
336 TRACE_EVENT(rxrpc_peer,
337 TP_PROTO(unsigned int peer_debug_id, enum rxrpc_peer_trace op,
338 int usage, const void *where),
340 TP_ARGS(peer_debug_id, op, usage, where),
343 __field(unsigned int, peer )
346 __field(const void *, where )
350 __entry->peer = peer_debug_id;
352 __entry->usage = usage;
353 __entry->where = where;
356 TP_printk("P=%08x %s u=%d sp=%pSR",
358 __print_symbolic(__entry->op, rxrpc_peer_traces),
363 TRACE_EVENT(rxrpc_conn,
364 TP_PROTO(unsigned int conn_debug_id, enum rxrpc_conn_trace op,
365 int usage, const void *where),
367 TP_ARGS(conn_debug_id, op, usage, where),
370 __field(unsigned int, conn )
373 __field(const void *, where )
377 __entry->conn = conn_debug_id;
379 __entry->usage = usage;
380 __entry->where = where;
383 TP_printk("C=%08x %s u=%d sp=%pSR",
385 __print_symbolic(__entry->op, rxrpc_conn_traces),
390 TRACE_EVENT(rxrpc_client,
391 TP_PROTO(struct rxrpc_connection *conn, int channel,
392 enum rxrpc_client_trace op),
394 TP_ARGS(conn, channel, op),
397 __field(unsigned int, conn )
399 __field(int, channel )
401 __field(enum rxrpc_client_trace, op )
405 __entry->conn = conn ? conn->debug_id : 0;
406 __entry->channel = channel;
407 __entry->usage = conn ? refcount_read(&conn->ref) : -2;
409 __entry->cid = conn ? conn->proto.cid : 0;
412 TP_printk("C=%08x h=%2d %s i=%08x u=%d",
415 __print_symbolic(__entry->op, rxrpc_client_traces),
420 TRACE_EVENT(rxrpc_call,
421 TP_PROTO(unsigned int call_debug_id, enum rxrpc_call_trace op,
422 int usage, const void *where, const void *aux),
424 TP_ARGS(call_debug_id, op, usage, where, aux),
427 __field(unsigned int, call )
430 __field(const void *, where )
431 __field(const void *, aux )
435 __entry->call = call_debug_id;
437 __entry->usage = usage;
438 __entry->where = where;
442 TP_printk("c=%08x %s u=%d sp=%pSR a=%p",
444 __print_symbolic(__entry->op, rxrpc_call_traces),
450 TRACE_EVENT(rxrpc_skb,
451 TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
452 int usage, int mod_count, u8 flags, const void *where),
454 TP_ARGS(skb, op, usage, mod_count, flags, where),
457 __field(struct sk_buff *, skb )
458 __field(enum rxrpc_skb_trace, op )
461 __field(int, mod_count )
462 __field(const void *, where )
467 __entry->flags = flags;
469 __entry->usage = usage;
470 __entry->mod_count = mod_count;
471 __entry->where = where;
474 TP_printk("s=%p %cx %s u=%d m=%d p=%pSR",
476 __entry->flags & RXRPC_SKB_TX_BUFFER ? 'T' : 'R',
477 __print_symbolic(__entry->op, rxrpc_skb_traces),
483 TRACE_EVENT(rxrpc_rx_packet,
484 TP_PROTO(struct rxrpc_skb_priv *sp),
489 __field_struct(struct rxrpc_host_header, hdr )
493 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
496 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
497 __entry->hdr.epoch, __entry->hdr.cid,
498 __entry->hdr.callNumber, __entry->hdr.serviceId,
499 __entry->hdr.serial, __entry->hdr.seq,
500 __entry->hdr.type, __entry->hdr.flags,
501 __entry->hdr.type <= 15 ?
502 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
505 TRACE_EVENT(rxrpc_rx_done,
506 TP_PROTO(int result, int abort_code),
508 TP_ARGS(result, abort_code),
511 __field(int, result )
512 __field(int, abort_code )
516 __entry->result = result;
517 __entry->abort_code = abort_code;
520 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
523 TRACE_EVENT(rxrpc_abort,
524 TP_PROTO(unsigned int call_nr, const char *why, u32 cid, u32 call_id,
525 rxrpc_seq_t seq, int abort_code, int error),
527 TP_ARGS(call_nr, why, cid, call_id, seq, abort_code, error),
530 __field(unsigned int, call_nr )
531 __array(char, why, 4 )
533 __field(u32, call_id )
534 __field(rxrpc_seq_t, seq )
535 __field(int, abort_code )
540 memcpy(__entry->why, why, 4);
541 __entry->call_nr = call_nr;
543 __entry->call_id = call_id;
544 __entry->abort_code = abort_code;
545 __entry->error = error;
549 TP_printk("c=%08x %08x:%08x s=%u a=%d e=%d %s",
551 __entry->cid, __entry->call_id, __entry->seq,
552 __entry->abort_code, __entry->error, __entry->why)
555 TRACE_EVENT(rxrpc_call_complete,
556 TP_PROTO(struct rxrpc_call *call),
561 __field(unsigned int, call )
562 __field(enum rxrpc_call_completion, compl )
564 __field(u32, abort_code )
568 __entry->call = call->debug_id;
569 __entry->compl = call->completion;
570 __entry->error = call->error;
571 __entry->abort_code = call->abort_code;
574 TP_printk("c=%08x %s r=%d ac=%d",
576 __print_symbolic(__entry->compl, rxrpc_completions),
581 TRACE_EVENT(rxrpc_transmit,
582 TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
587 __field(unsigned int, call )
588 __field(enum rxrpc_transmit_trace, why )
589 __field(rxrpc_seq_t, tx_hard_ack )
590 __field(rxrpc_seq_t, tx_top )
591 __field(int, tx_winsize )
595 __entry->call = call->debug_id;
597 __entry->tx_hard_ack = call->tx_hard_ack;
598 __entry->tx_top = call->tx_top;
599 __entry->tx_winsize = call->tx_winsize;
602 TP_printk("c=%08x %s f=%08x n=%u/%u",
604 __print_symbolic(__entry->why, rxrpc_transmit_traces),
605 __entry->tx_hard_ack + 1,
606 __entry->tx_top - __entry->tx_hard_ack,
610 TRACE_EVENT(rxrpc_rx_data,
611 TP_PROTO(unsigned int call, rxrpc_seq_t seq,
612 rxrpc_serial_t serial, u8 flags, u8 anno),
614 TP_ARGS(call, seq, serial, flags, anno),
617 __field(unsigned int, call )
618 __field(rxrpc_seq_t, seq )
619 __field(rxrpc_serial_t, serial )
625 __entry->call = call;
627 __entry->serial = serial;
628 __entry->flags = flags;
629 __entry->anno = anno;
632 TP_printk("c=%08x DATA %08x q=%08x fl=%02x a=%02x",
640 TRACE_EVENT(rxrpc_rx_ack,
641 TP_PROTO(struct rxrpc_call *call,
642 rxrpc_serial_t serial, rxrpc_serial_t ack_serial,
643 rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks),
645 TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
648 __field(unsigned int, call )
649 __field(rxrpc_serial_t, serial )
650 __field(rxrpc_serial_t, ack_serial )
651 __field(rxrpc_seq_t, first )
652 __field(rxrpc_seq_t, prev )
658 __entry->call = call->debug_id;
659 __entry->serial = serial;
660 __entry->ack_serial = ack_serial;
661 __entry->first = first;
662 __entry->prev = prev;
663 __entry->reason = reason;
664 __entry->n_acks = n_acks;
667 TP_printk("c=%08x %08x %s r=%08x f=%08x p=%08x n=%u",
670 __print_symbolic(__entry->reason, rxrpc_ack_names),
677 TRACE_EVENT(rxrpc_rx_abort,
678 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
681 TP_ARGS(call, serial, abort_code),
684 __field(unsigned int, call )
685 __field(rxrpc_serial_t, serial )
686 __field(u32, abort_code )
690 __entry->call = call->debug_id;
691 __entry->serial = serial;
692 __entry->abort_code = abort_code;
695 TP_printk("c=%08x ABORT %08x ac=%d",
701 TRACE_EVENT(rxrpc_rx_rwind_change,
702 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
703 u32 rwind, bool wake),
705 TP_ARGS(call, serial, rwind, wake),
708 __field(unsigned int, call )
709 __field(rxrpc_serial_t, serial )
715 __entry->call = call->debug_id;
716 __entry->serial = serial;
717 __entry->rwind = rwind;
718 __entry->wake = wake;
721 TP_printk("c=%08x %08x rw=%u%s",
725 __entry->wake ? " wake" : "")
728 TRACE_EVENT(rxrpc_tx_packet,
729 TP_PROTO(unsigned int call_id, struct rxrpc_wire_header *whdr,
730 enum rxrpc_tx_point where),
732 TP_ARGS(call_id, whdr, where),
735 __field(unsigned int, call )
736 __field(enum rxrpc_tx_point, where )
737 __field_struct(struct rxrpc_wire_header, whdr )
741 __entry->call = call_id;
742 memcpy(&__entry->whdr, whdr, sizeof(__entry->whdr));
743 __entry->where = where;
746 TP_printk("c=%08x %08x:%08x:%08x:%04x %08x %08x %02x %02x %s %s",
748 ntohl(__entry->whdr.epoch),
749 ntohl(__entry->whdr.cid),
750 ntohl(__entry->whdr.callNumber),
751 ntohs(__entry->whdr.serviceId),
752 ntohl(__entry->whdr.serial),
753 ntohl(__entry->whdr.seq),
754 __entry->whdr.type, __entry->whdr.flags,
755 __entry->whdr.type <= 15 ?
756 __print_symbolic(__entry->whdr.type, rxrpc_pkts) : "?UNK",
757 __print_symbolic(__entry->where, rxrpc_tx_points))
760 TRACE_EVENT(rxrpc_tx_data,
761 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
762 rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
764 TP_ARGS(call, seq, serial, flags, retrans, lose),
767 __field(unsigned int, call )
768 __field(rxrpc_seq_t, seq )
769 __field(rxrpc_serial_t, serial )
771 __field(u32, call_id )
773 __field(bool, retrans )
778 __entry->call = call->debug_id;
779 __entry->cid = call->cid;
780 __entry->call_id = call->call_id;
782 __entry->serial = serial;
783 __entry->flags = flags;
784 __entry->retrans = retrans;
785 __entry->lose = lose;
788 TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s%s",
795 __entry->retrans ? " *RETRANS*" : "",
796 __entry->lose ? " *LOSE*" : "")
799 TRACE_EVENT(rxrpc_tx_ack,
800 TP_PROTO(unsigned int call, rxrpc_serial_t serial,
801 rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
802 u8 reason, u8 n_acks),
804 TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
807 __field(unsigned int, call )
808 __field(rxrpc_serial_t, serial )
809 __field(rxrpc_seq_t, ack_first )
810 __field(rxrpc_serial_t, ack_serial )
816 __entry->call = call;
817 __entry->serial = serial;
818 __entry->ack_first = ack_first;
819 __entry->ack_serial = ack_serial;
820 __entry->reason = reason;
821 __entry->n_acks = n_acks;
824 TP_printk(" c=%08x ACK %08x %s f=%08x r=%08x n=%u",
827 __print_symbolic(__entry->reason, rxrpc_ack_names),
833 TRACE_EVENT(rxrpc_receive,
834 TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
835 rxrpc_serial_t serial, rxrpc_seq_t seq),
837 TP_ARGS(call, why, serial, seq),
840 __field(unsigned int, call )
841 __field(enum rxrpc_receive_trace, why )
842 __field(rxrpc_serial_t, serial )
843 __field(rxrpc_seq_t, seq )
844 __field(rxrpc_seq_t, hard_ack )
845 __field(rxrpc_seq_t, top )
849 __entry->call = call->debug_id;
851 __entry->serial = serial;
853 __entry->hard_ack = call->rx_hard_ack;
854 __entry->top = call->rx_top;
857 TP_printk("c=%08x %s r=%08x q=%08x w=%08x-%08x",
859 __print_symbolic(__entry->why, rxrpc_receive_traces),
866 TRACE_EVENT(rxrpc_recvmsg,
867 TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
868 rxrpc_seq_t seq, unsigned int offset, unsigned int len,
871 TP_ARGS(call, why, seq, offset, len, ret),
874 __field(unsigned int, call )
875 __field(enum rxrpc_recvmsg_trace, why )
876 __field(rxrpc_seq_t, seq )
877 __field(unsigned int, offset )
878 __field(unsigned int, len )
883 __entry->call = call ? call->debug_id : 0;
886 __entry->offset = offset;
891 TP_printk("c=%08x %s q=%08x o=%u l=%u ret=%d",
893 __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
900 TRACE_EVENT(rxrpc_rtt_tx,
901 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
902 int slot, rxrpc_serial_t send_serial),
904 TP_ARGS(call, why, slot, send_serial),
907 __field(unsigned int, call )
908 __field(enum rxrpc_rtt_tx_trace, why )
910 __field(rxrpc_serial_t, send_serial )
914 __entry->call = call->debug_id;
916 __entry->slot = slot;
917 __entry->send_serial = send_serial;
920 TP_printk("c=%08x [%d] %s sr=%08x",
923 __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
924 __entry->send_serial)
927 TRACE_EVENT(rxrpc_rtt_rx,
928 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
930 rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
933 TP_ARGS(call, why, slot, send_serial, resp_serial, rtt, rto),
936 __field(unsigned int, call )
937 __field(enum rxrpc_rtt_rx_trace, why )
939 __field(rxrpc_serial_t, send_serial )
940 __field(rxrpc_serial_t, resp_serial )
946 __entry->call = call->debug_id;
948 __entry->slot = slot;
949 __entry->send_serial = send_serial;
950 __entry->resp_serial = resp_serial;
955 TP_printk("c=%08x [%d] %s sr=%08x rr=%08x rtt=%u rto=%u",
958 __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
959 __entry->send_serial,
960 __entry->resp_serial,
965 TRACE_EVENT(rxrpc_timer,
966 TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
969 TP_ARGS(call, why, now),
972 __field(unsigned int, call )
973 __field(enum rxrpc_timer_trace, why )
975 __field(long, ack_at )
976 __field(long, ack_lost_at )
977 __field(long, resend_at )
978 __field(long, ping_at )
979 __field(long, expect_rx_by )
980 __field(long, expect_req_by )
981 __field(long, expect_term_by )
982 __field(long, timer )
986 __entry->call = call->debug_id;
989 __entry->ack_at = call->ack_at;
990 __entry->ack_lost_at = call->ack_lost_at;
991 __entry->resend_at = call->resend_at;
992 __entry->expect_rx_by = call->expect_rx_by;
993 __entry->expect_req_by = call->expect_req_by;
994 __entry->expect_term_by = call->expect_term_by;
995 __entry->timer = call->timer.expires;
998 TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
1000 __print_symbolic(__entry->why, rxrpc_timer_traces),
1001 __entry->ack_at - __entry->now,
1002 __entry->ack_lost_at - __entry->now,
1003 __entry->resend_at - __entry->now,
1004 __entry->expect_rx_by - __entry->now,
1005 __entry->expect_req_by - __entry->now,
1006 __entry->expect_term_by - __entry->now,
1007 __entry->timer - __entry->now)
1010 TRACE_EVENT(rxrpc_rx_lose,
1011 TP_PROTO(struct rxrpc_skb_priv *sp),
1016 __field_struct(struct rxrpc_host_header, hdr )
1020 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
1023 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
1024 __entry->hdr.epoch, __entry->hdr.cid,
1025 __entry->hdr.callNumber, __entry->hdr.serviceId,
1026 __entry->hdr.serial, __entry->hdr.seq,
1027 __entry->hdr.type, __entry->hdr.flags,
1028 __entry->hdr.type <= 15 ?
1029 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
1032 TRACE_EVENT(rxrpc_propose_ack,
1033 TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1034 u8 ack_reason, rxrpc_serial_t serial, bool immediate,
1035 bool background, enum rxrpc_propose_ack_outcome outcome),
1037 TP_ARGS(call, why, ack_reason, serial, immediate, background,
1041 __field(unsigned int, call )
1042 __field(enum rxrpc_propose_ack_trace, why )
1043 __field(rxrpc_serial_t, serial )
1044 __field(u8, ack_reason )
1045 __field(bool, immediate )
1046 __field(bool, background )
1047 __field(enum rxrpc_propose_ack_outcome, outcome )
1051 __entry->call = call->debug_id;
1053 __entry->serial = serial;
1054 __entry->ack_reason = ack_reason;
1055 __entry->immediate = immediate;
1056 __entry->background = background;
1057 __entry->outcome = outcome;
1060 TP_printk("c=%08x %s %s r=%08x i=%u b=%u%s",
1062 __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1063 __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
1066 __entry->background,
1067 __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
1070 TRACE_EVENT(rxrpc_retransmit,
1071 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
1074 TP_ARGS(call, seq, annotation, expiry),
1077 __field(unsigned int, call )
1078 __field(rxrpc_seq_t, seq )
1079 __field(u8, annotation )
1080 __field(s64, expiry )
1084 __entry->call = call->debug_id;
1086 __entry->annotation = annotation;
1087 __entry->expiry = expiry;
1090 TP_printk("c=%08x q=%x a=%02x xp=%lld",
1093 __entry->annotation,
1097 TRACE_EVENT(rxrpc_congest,
1098 TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
1099 rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
1101 TP_ARGS(call, summary, ack_serial, change),
1104 __field(unsigned int, call )
1105 __field(enum rxrpc_congest_change, change )
1106 __field(rxrpc_seq_t, hard_ack )
1107 __field(rxrpc_seq_t, top )
1108 __field(rxrpc_seq_t, lowest_nak )
1109 __field(rxrpc_serial_t, ack_serial )
1110 __field_struct(struct rxrpc_ack_summary, sum )
1114 __entry->call = call->debug_id;
1115 __entry->change = change;
1116 __entry->hard_ack = call->tx_hard_ack;
1117 __entry->top = call->tx_top;
1118 __entry->lowest_nak = call->acks_lowest_nak;
1119 __entry->ack_serial = ack_serial;
1120 memcpy(&__entry->sum, summary, sizeof(__entry->sum));
1123 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",
1125 __entry->ack_serial,
1126 __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
1128 __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
1130 __entry->sum.ssthresh,
1131 __entry->sum.nr_acks, __entry->sum.nr_nacks,
1132 __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
1133 __entry->sum.nr_rot_new_acks,
1134 __entry->top - __entry->hard_ack,
1135 __entry->sum.cumulative_acks,
1136 __entry->sum.dup_acks,
1137 __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
1138 __print_symbolic(__entry->change, rxrpc_congest_changes),
1139 __entry->sum.retrans_timeo ? " rTxTo" : "")
1142 TRACE_EVENT(rxrpc_disconnect_call,
1143 TP_PROTO(struct rxrpc_call *call),
1148 __field(unsigned int, call )
1149 __field(u32, abort_code )
1153 __entry->call = call->debug_id;
1154 __entry->abort_code = call->abort_code;
1157 TP_printk("c=%08x ab=%08x",
1159 __entry->abort_code)
1162 TRACE_EVENT(rxrpc_improper_term,
1163 TP_PROTO(struct rxrpc_call *call),
1168 __field(unsigned int, call )
1169 __field(u32, abort_code )
1173 __entry->call = call->debug_id;
1174 __entry->abort_code = call->abort_code;
1177 TP_printk("c=%08x ab=%08x",
1179 __entry->abort_code)
1182 TRACE_EVENT(rxrpc_rx_eproto,
1183 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
1186 TP_ARGS(call, serial, why),
1189 __field(unsigned int, call )
1190 __field(rxrpc_serial_t, serial )
1191 __field(const char *, why )
1195 __entry->call = call ? call->debug_id : 0;
1196 __entry->serial = serial;
1200 TP_printk("c=%08x EPROTO %08x %s",
1206 TRACE_EVENT(rxrpc_connect_call,
1207 TP_PROTO(struct rxrpc_call *call),
1212 __field(unsigned int, call )
1213 __field(unsigned long, user_call_ID )
1215 __field(u32, call_id )
1219 __entry->call = call->debug_id;
1220 __entry->user_call_ID = call->user_call_ID;
1221 __entry->cid = call->cid;
1222 __entry->call_id = call->call_id;
1225 TP_printk("c=%08x u=%p %08x:%08x",
1227 (void *)__entry->user_call_ID,
1232 TRACE_EVENT(rxrpc_resend,
1233 TP_PROTO(struct rxrpc_call *call, int ix),
1238 __field(unsigned int, call )
1240 __array(u8, anno, 64 )
1244 __entry->call = call->debug_id;
1246 memcpy(__entry->anno, call->rxtx_annotations, 64);
1249 TP_printk("c=%08x ix=%u a=%64phN",
1255 TRACE_EVENT(rxrpc_rx_icmp,
1256 TP_PROTO(struct rxrpc_peer *peer, struct sock_extended_err *ee,
1257 struct sockaddr_rxrpc *srx),
1259 TP_ARGS(peer, ee, srx),
1262 __field(unsigned int, peer )
1263 __field_struct(struct sock_extended_err, ee )
1264 __field_struct(struct sockaddr_rxrpc, srx )
1268 __entry->peer = peer->debug_id;
1269 memcpy(&__entry->ee, ee, sizeof(__entry->ee));
1270 memcpy(&__entry->srx, srx, sizeof(__entry->srx));
1273 TP_printk("P=%08x o=%u t=%u c=%u i=%u d=%u e=%d %pISp",
1275 __entry->ee.ee_origin,
1276 __entry->ee.ee_type,
1277 __entry->ee.ee_code,
1278 __entry->ee.ee_info,
1279 __entry->ee.ee_data,
1280 __entry->ee.ee_errno,
1281 &__entry->srx.transport)
1284 TRACE_EVENT(rxrpc_tx_fail,
1285 TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial, int ret,
1286 enum rxrpc_tx_point where),
1288 TP_ARGS(debug_id, serial, ret, where),
1291 __field(unsigned int, debug_id )
1292 __field(rxrpc_serial_t, serial )
1294 __field(enum rxrpc_tx_point, where )
1298 __entry->debug_id = debug_id;
1299 __entry->serial = serial;
1301 __entry->where = where;
1304 TP_printk("c=%08x r=%x ret=%d %s",
1308 __print_symbolic(__entry->where, rxrpc_tx_points))
1311 TRACE_EVENT(rxrpc_call_reset,
1312 TP_PROTO(struct rxrpc_call *call),
1317 __field(unsigned int, debug_id )
1319 __field(u32, call_id )
1320 __field(rxrpc_serial_t, call_serial )
1321 __field(rxrpc_serial_t, conn_serial )
1322 __field(rxrpc_seq_t, tx_seq )
1323 __field(rxrpc_seq_t, rx_seq )
1327 __entry->debug_id = call->debug_id;
1328 __entry->cid = call->cid;
1329 __entry->call_id = call->call_id;
1330 __entry->call_serial = call->rx_serial;
1331 __entry->conn_serial = call->conn->hi_serial;
1332 __entry->tx_seq = call->tx_hard_ack;
1333 __entry->rx_seq = call->rx_hard_ack;
1336 TP_printk("c=%08x %08x:%08x r=%08x/%08x tx=%08x rx=%08x",
1338 __entry->cid, __entry->call_id,
1339 __entry->call_serial, __entry->conn_serial,
1340 __entry->tx_seq, __entry->rx_seq)
1343 TRACE_EVENT(rxrpc_notify_socket,
1344 TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial),
1346 TP_ARGS(debug_id, serial),
1349 __field(unsigned int, debug_id )
1350 __field(rxrpc_serial_t, serial )
1354 __entry->debug_id = debug_id;
1355 __entry->serial = serial;
1358 TP_printk("c=%08x r=%08x",
1363 TRACE_EVENT(rxrpc_rx_discard_ack,
1364 TP_PROTO(unsigned int debug_id, rxrpc_serial_t serial,
1365 rxrpc_seq_t first_soft_ack, rxrpc_seq_t call_ackr_first,
1366 rxrpc_seq_t prev_pkt, rxrpc_seq_t call_ackr_prev),
1368 TP_ARGS(debug_id, serial, first_soft_ack, call_ackr_first,
1369 prev_pkt, call_ackr_prev),
1372 __field(unsigned int, debug_id )
1373 __field(rxrpc_serial_t, serial )
1374 __field(rxrpc_seq_t, first_soft_ack)
1375 __field(rxrpc_seq_t, call_ackr_first)
1376 __field(rxrpc_seq_t, prev_pkt)
1377 __field(rxrpc_seq_t, call_ackr_prev)
1381 __entry->debug_id = debug_id;
1382 __entry->serial = serial;
1383 __entry->first_soft_ack = first_soft_ack;
1384 __entry->call_ackr_first = call_ackr_first;
1385 __entry->prev_pkt = prev_pkt;
1386 __entry->call_ackr_prev = call_ackr_prev;
1389 TP_printk("c=%08x r=%08x %08x<%08x %08x<%08x",
1392 __entry->first_soft_ack,
1393 __entry->call_ackr_first,
1395 __entry->call_ackr_prev)
1400 #endif /* _TRACE_RXRPC_H */
1402 /* This part must be outside protection */
1403 #include <trace/define_trace.h>