1 /* AF_RXRPC tracepoints
3 * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
12 #define TRACE_SYSTEM rxrpc
14 #if !defined(_TRACE_RXRPC_H) || defined(TRACE_HEADER_MULTI_READ)
15 #define _TRACE_RXRPC_H
17 #include <linux/tracepoint.h>
20 * Define enums for tracing information.
22 * These should all be kept sorted, making it easier to match the string
23 * mapping tables further on.
25 #ifndef __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
26 #define __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY
28 enum rxrpc_skb_trace {
34 rxrpc_skb_rx_received,
45 enum rxrpc_conn_trace {
47 rxrpc_conn_new_client,
48 rxrpc_conn_new_service,
49 rxrpc_conn_put_client,
50 rxrpc_conn_put_service,
55 enum rxrpc_client_trace {
56 rxrpc_client_activate_chans,
58 rxrpc_client_chan_activate,
59 rxrpc_client_chan_disconnect,
60 rxrpc_client_chan_pass,
61 rxrpc_client_chan_unstarted,
65 rxrpc_client_duplicate,
68 rxrpc_client_to_active,
69 rxrpc_client_to_culled,
71 rxrpc_client_to_inactive,
72 rxrpc_client_to_upgrade,
73 rxrpc_client_to_waiting,
77 enum rxrpc_call_trace {
81 rxrpc_call_got_kernel,
82 rxrpc_call_got_userid,
83 rxrpc_call_new_client,
84 rxrpc_call_new_service,
86 rxrpc_call_put_kernel,
87 rxrpc_call_put_noqueue,
88 rxrpc_call_put_userid,
90 rxrpc_call_queued_ref,
95 enum rxrpc_transmit_trace {
96 rxrpc_transmit_await_reply,
99 rxrpc_transmit_queue_last,
100 rxrpc_transmit_rotate,
101 rxrpc_transmit_rotate_last,
105 enum rxrpc_receive_trace {
108 rxrpc_receive_incoming,
110 rxrpc_receive_queue_last,
111 rxrpc_receive_rotate,
114 enum rxrpc_recvmsg_trace {
116 rxrpc_recvmsg_data_return,
117 rxrpc_recvmsg_dequeue,
122 rxrpc_recvmsg_requeue,
123 rxrpc_recvmsg_return,
124 rxrpc_recvmsg_terminal,
125 rxrpc_recvmsg_to_be_accepted,
129 enum rxrpc_rtt_tx_trace {
134 enum rxrpc_rtt_rx_trace {
135 rxrpc_rtt_rx_ping_response,
136 rxrpc_rtt_rx_requested_ack,
139 enum rxrpc_timer_trace {
142 rxrpc_timer_init_for_reply,
143 rxrpc_timer_init_for_send_reply,
144 rxrpc_timer_set_for_ack,
145 rxrpc_timer_set_for_ping,
146 rxrpc_timer_set_for_resend,
147 rxrpc_timer_set_for_send,
150 enum rxrpc_propose_ack_trace {
151 rxrpc_propose_ack_client_tx_end,
152 rxrpc_propose_ack_input_data,
153 rxrpc_propose_ack_ping_for_lost_ack,
154 rxrpc_propose_ack_ping_for_lost_reply,
155 rxrpc_propose_ack_ping_for_params,
156 rxrpc_propose_ack_processing_op,
157 rxrpc_propose_ack_respond_to_ack,
158 rxrpc_propose_ack_respond_to_ping,
159 rxrpc_propose_ack_retry_tx,
160 rxrpc_propose_ack_rotate_rx,
161 rxrpc_propose_ack_terminal_ack,
164 enum rxrpc_propose_ack_outcome {
165 rxrpc_propose_ack_subsume,
166 rxrpc_propose_ack_update,
167 rxrpc_propose_ack_use,
170 enum rxrpc_congest_change {
171 rxrpc_cong_begin_retransmission,
172 rxrpc_cong_cleared_nacks,
173 rxrpc_cong_new_low_nack,
174 rxrpc_cong_no_change,
176 rxrpc_cong_retransmit_again,
177 rxrpc_cong_rtt_window_end,
181 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
184 * Declare tracing information enums and their string mappings for display.
186 #define rxrpc_skb_traces \
187 EM(rxrpc_skb_rx_cleaned, "Rx CLN") \
188 EM(rxrpc_skb_rx_freed, "Rx FRE") \
189 EM(rxrpc_skb_rx_got, "Rx GOT") \
190 EM(rxrpc_skb_rx_lost, "Rx *L*") \
191 EM(rxrpc_skb_rx_purged, "Rx PUR") \
192 EM(rxrpc_skb_rx_received, "Rx RCV") \
193 EM(rxrpc_skb_rx_rotated, "Rx ROT") \
194 EM(rxrpc_skb_rx_seen, "Rx SEE") \
195 EM(rxrpc_skb_tx_cleaned, "Tx CLN") \
196 EM(rxrpc_skb_tx_freed, "Tx FRE") \
197 EM(rxrpc_skb_tx_got, "Tx GOT") \
198 EM(rxrpc_skb_tx_new, "Tx NEW") \
199 EM(rxrpc_skb_tx_rotated, "Tx ROT") \
200 E_(rxrpc_skb_tx_seen, "Tx SEE")
202 #define rxrpc_conn_traces \
203 EM(rxrpc_conn_got, "GOT") \
204 EM(rxrpc_conn_new_client, "NWc") \
205 EM(rxrpc_conn_new_service, "NWs") \
206 EM(rxrpc_conn_put_client, "PTc") \
207 EM(rxrpc_conn_put_service, "PTs") \
208 EM(rxrpc_conn_queued, "QUE") \
209 E_(rxrpc_conn_seen, "SEE")
211 #define rxrpc_client_traces \
212 EM(rxrpc_client_activate_chans, "Activa") \
213 EM(rxrpc_client_alloc, "Alloc ") \
214 EM(rxrpc_client_chan_activate, "ChActv") \
215 EM(rxrpc_client_chan_disconnect, "ChDisc") \
216 EM(rxrpc_client_chan_pass, "ChPass") \
217 EM(rxrpc_client_chan_unstarted, "ChUnst") \
218 EM(rxrpc_client_cleanup, "Clean ") \
219 EM(rxrpc_client_count, "Count ") \
220 EM(rxrpc_client_discard, "Discar") \
221 EM(rxrpc_client_duplicate, "Duplic") \
222 EM(rxrpc_client_exposed, "Expose") \
223 EM(rxrpc_client_replace, "Replac") \
224 EM(rxrpc_client_to_active, "->Actv") \
225 EM(rxrpc_client_to_culled, "->Cull") \
226 EM(rxrpc_client_to_idle, "->Idle") \
227 EM(rxrpc_client_to_inactive, "->Inac") \
228 EM(rxrpc_client_to_upgrade, "->Upgd") \
229 EM(rxrpc_client_to_waiting, "->Wait") \
230 E_(rxrpc_client_uncount, "Uncoun")
232 #define rxrpc_conn_cache_states \
233 EM(RXRPC_CONN_CLIENT_INACTIVE, "Inac") \
234 EM(RXRPC_CONN_CLIENT_WAITING, "Wait") \
235 EM(RXRPC_CONN_CLIENT_ACTIVE, "Actv") \
236 EM(RXRPC_CONN_CLIENT_CULLED, "Cull") \
237 E_(RXRPC_CONN_CLIENT_IDLE, "Idle") \
239 #define rxrpc_call_traces \
240 EM(rxrpc_call_connected, "CON") \
241 EM(rxrpc_call_error, "*E*") \
242 EM(rxrpc_call_got, "GOT") \
243 EM(rxrpc_call_got_kernel, "Gke") \
244 EM(rxrpc_call_got_userid, "Gus") \
245 EM(rxrpc_call_new_client, "NWc") \
246 EM(rxrpc_call_new_service, "NWs") \
247 EM(rxrpc_call_put, "PUT") \
248 EM(rxrpc_call_put_kernel, "Pke") \
249 EM(rxrpc_call_put_noqueue, "PNQ") \
250 EM(rxrpc_call_put_userid, "Pus") \
251 EM(rxrpc_call_queued, "QUE") \
252 EM(rxrpc_call_queued_ref, "QUR") \
253 EM(rxrpc_call_release, "RLS") \
254 E_(rxrpc_call_seen, "SEE")
256 #define rxrpc_transmit_traces \
257 EM(rxrpc_transmit_await_reply, "AWR") \
258 EM(rxrpc_transmit_end, "END") \
259 EM(rxrpc_transmit_queue, "QUE") \
260 EM(rxrpc_transmit_queue_last, "QLS") \
261 EM(rxrpc_transmit_rotate, "ROT") \
262 EM(rxrpc_transmit_rotate_last, "RLS") \
263 E_(rxrpc_transmit_wait, "WAI")
265 #define rxrpc_receive_traces \
266 EM(rxrpc_receive_end, "END") \
267 EM(rxrpc_receive_front, "FRN") \
268 EM(rxrpc_receive_incoming, "INC") \
269 EM(rxrpc_receive_queue, "QUE") \
270 EM(rxrpc_receive_queue_last, "QLS") \
271 E_(rxrpc_receive_rotate, "ROT")
273 #define rxrpc_recvmsg_traces \
274 EM(rxrpc_recvmsg_cont, "CONT") \
275 EM(rxrpc_recvmsg_data_return, "DATA") \
276 EM(rxrpc_recvmsg_dequeue, "DEQU") \
277 EM(rxrpc_recvmsg_enter, "ENTR") \
278 EM(rxrpc_recvmsg_full, "FULL") \
279 EM(rxrpc_recvmsg_hole, "HOLE") \
280 EM(rxrpc_recvmsg_next, "NEXT") \
281 EM(rxrpc_recvmsg_requeue, "REQU") \
282 EM(rxrpc_recvmsg_return, "RETN") \
283 EM(rxrpc_recvmsg_terminal, "TERM") \
284 EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \
285 E_(rxrpc_recvmsg_wait, "WAIT")
287 #define rxrpc_rtt_tx_traces \
288 EM(rxrpc_rtt_tx_data, "DATA") \
289 E_(rxrpc_rtt_tx_ping, "PING")
291 #define rxrpc_rtt_rx_traces \
292 EM(rxrpc_rtt_rx_ping_response, "PONG") \
293 E_(rxrpc_rtt_rx_requested_ack, "RACK")
295 #define rxrpc_timer_traces \
296 EM(rxrpc_timer_begin, "Begin ") \
297 EM(rxrpc_timer_expired, "*EXPR*") \
298 EM(rxrpc_timer_init_for_reply, "IniRpl") \
299 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
300 EM(rxrpc_timer_set_for_ack, "SetAck") \
301 EM(rxrpc_timer_set_for_ping, "SetPng") \
302 EM(rxrpc_timer_set_for_resend, "SetRTx") \
303 E_(rxrpc_timer_set_for_send, "SetTx ")
305 #define rxrpc_propose_ack_traces \
306 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
307 EM(rxrpc_propose_ack_input_data, "DataIn ") \
308 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
309 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
310 EM(rxrpc_propose_ack_ping_for_params, "Params ") \
311 EM(rxrpc_propose_ack_processing_op, "ProcOp ") \
312 EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \
313 EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \
314 EM(rxrpc_propose_ack_retry_tx, "RetryTx") \
315 EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \
316 E_(rxrpc_propose_ack_terminal_ack, "ClTerm ")
318 #define rxrpc_propose_ack_outcomes \
319 EM(rxrpc_propose_ack_subsume, " Subsume") \
320 EM(rxrpc_propose_ack_update, " Update") \
321 E_(rxrpc_propose_ack_use, "")
323 #define rxrpc_congest_modes \
324 EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \
325 EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \
326 EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \
327 E_(RXRPC_CALL_SLOW_START, "SlowStart")
329 #define rxrpc_congest_changes \
330 EM(rxrpc_cong_begin_retransmission, " Retrans") \
331 EM(rxrpc_cong_cleared_nacks, " Cleared") \
332 EM(rxrpc_cong_new_low_nack, " NewLowN") \
333 EM(rxrpc_cong_no_change, "") \
334 EM(rxrpc_cong_progress, " Progres") \
335 EM(rxrpc_cong_retransmit_again, " ReTxAgn") \
336 EM(rxrpc_cong_rtt_window_end, " RttWinE") \
337 E_(rxrpc_cong_saw_nack, " SawNack")
341 EM(RXRPC_PACKET_TYPE_DATA, "DATA") \
342 EM(RXRPC_PACKET_TYPE_ACK, "ACK") \
343 EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \
344 EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \
345 EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \
346 EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \
347 EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \
348 EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \
353 EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \
357 #define rxrpc_ack_names \
359 EM(RXRPC_ACK_REQUESTED, "REQ") \
360 EM(RXRPC_ACK_DUPLICATE, "DUP") \
361 EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \
362 EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \
363 EM(RXRPC_ACK_NOSPACE, "MEM") \
364 EM(RXRPC_ACK_PING, "PNG") \
365 EM(RXRPC_ACK_PING_RESPONSE, "PNR") \
366 EM(RXRPC_ACK_DELAY, "DLY") \
367 EM(RXRPC_ACK_IDLE, "IDL") \
368 E_(RXRPC_ACK__INVALID, "-?-")
371 * Export enum symbols via userspace.
375 #define EM(a, b) TRACE_DEFINE_ENUM(a);
376 #define E_(a, b) TRACE_DEFINE_ENUM(a);
382 rxrpc_transmit_traces;
383 rxrpc_receive_traces;
384 rxrpc_recvmsg_traces;
388 rxrpc_propose_ack_traces;
389 rxrpc_propose_ack_outcomes;
390 rxrpc_congest_changes;
393 * Now redefine the EM() and E_() macros to map the enums to the strings that
394 * will be printed in the output.
398 #define EM(a, b) { a, b },
399 #define E_(a, b) { a, b }
401 TRACE_EVENT(rxrpc_conn,
402 TP_PROTO(struct rxrpc_connection *conn, enum rxrpc_conn_trace op,
403 int usage, const void *where),
405 TP_ARGS(conn, op, usage, where),
408 __field(struct rxrpc_connection *, conn )
411 __field(const void *, where )
415 __entry->conn = conn;
417 __entry->usage = usage;
418 __entry->where = where;
421 TP_printk("C=%p %s u=%d sp=%pSR",
423 __print_symbolic(__entry->op, rxrpc_conn_traces),
428 TRACE_EVENT(rxrpc_client,
429 TP_PROTO(struct rxrpc_connection *conn, int channel,
430 enum rxrpc_client_trace op),
432 TP_ARGS(conn, channel, op),
435 __field(struct rxrpc_connection *, conn )
437 __field(int, channel )
439 __field(enum rxrpc_client_trace, op )
440 __field(enum rxrpc_conn_cache_state, cs )
444 __entry->conn = conn;
445 __entry->channel = channel;
446 __entry->usage = atomic_read(&conn->usage);
448 __entry->cid = conn->proto.cid;
449 __entry->cs = conn->cache_state;
452 TP_printk("C=%p h=%2d %s %s i=%08x u=%d",
455 __print_symbolic(__entry->op, rxrpc_client_traces),
456 __print_symbolic(__entry->cs, rxrpc_conn_cache_states),
461 TRACE_EVENT(rxrpc_call,
462 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
463 int usage, const void *where, const void *aux),
465 TP_ARGS(call, op, usage, where, aux),
468 __field(struct rxrpc_call *, call )
471 __field(const void *, where )
472 __field(const void *, aux )
476 __entry->call = call;
478 __entry->usage = usage;
479 __entry->where = where;
483 TP_printk("c=%p %s u=%d sp=%pSR a=%p",
485 __print_symbolic(__entry->op, rxrpc_call_traces),
491 TRACE_EVENT(rxrpc_skb,
492 TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
493 int usage, int mod_count, const void *where),
495 TP_ARGS(skb, op, usage, mod_count, where),
498 __field(struct sk_buff *, skb )
499 __field(enum rxrpc_skb_trace, op )
501 __field(int, mod_count )
502 __field(const void *, where )
508 __entry->usage = usage;
509 __entry->mod_count = mod_count;
510 __entry->where = where;
513 TP_printk("s=%p %s u=%d m=%d p=%pSR",
515 __print_symbolic(__entry->op, rxrpc_skb_traces),
521 TRACE_EVENT(rxrpc_rx_packet,
522 TP_PROTO(struct rxrpc_skb_priv *sp),
527 __field_struct(struct rxrpc_host_header, hdr )
531 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
534 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
535 __entry->hdr.epoch, __entry->hdr.cid,
536 __entry->hdr.callNumber, __entry->hdr.serviceId,
537 __entry->hdr.serial, __entry->hdr.seq,
538 __entry->hdr.type, __entry->hdr.flags,
539 __entry->hdr.type <= 15 ?
540 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
543 TRACE_EVENT(rxrpc_rx_done,
544 TP_PROTO(int result, int abort_code),
546 TP_ARGS(result, abort_code),
549 __field(int, result )
550 __field(int, abort_code )
554 __entry->result = result;
555 __entry->abort_code = abort_code;
558 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
561 TRACE_EVENT(rxrpc_abort,
562 TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq,
563 int abort_code, int error),
565 TP_ARGS(why, cid, call_id, seq, abort_code, error),
568 __array(char, why, 4 )
570 __field(u32, call_id )
571 __field(rxrpc_seq_t, seq )
572 __field(int, abort_code )
577 memcpy(__entry->why, why, 4);
579 __entry->call_id = call_id;
580 __entry->abort_code = abort_code;
581 __entry->error = error;
585 TP_printk("%08x:%08x s=%u a=%d e=%d %s",
586 __entry->cid, __entry->call_id, __entry->seq,
587 __entry->abort_code, __entry->error, __entry->why)
590 TRACE_EVENT(rxrpc_transmit,
591 TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
596 __field(struct rxrpc_call *, call )
597 __field(enum rxrpc_transmit_trace, why )
598 __field(rxrpc_seq_t, tx_hard_ack )
599 __field(rxrpc_seq_t, tx_top )
600 __field(int, tx_winsize )
604 __entry->call = call;
606 __entry->tx_hard_ack = call->tx_hard_ack;
607 __entry->tx_top = call->tx_top;
608 __entry->tx_winsize = call->tx_winsize;
611 TP_printk("c=%p %s f=%08x n=%u/%u",
613 __print_symbolic(__entry->why, rxrpc_transmit_traces),
614 __entry->tx_hard_ack + 1,
615 __entry->tx_top - __entry->tx_hard_ack,
619 TRACE_EVENT(rxrpc_rx_data,
620 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
621 rxrpc_serial_t serial, u8 flags, u8 anno),
623 TP_ARGS(call, seq, serial, flags, anno),
626 __field(struct rxrpc_call *, call )
627 __field(rxrpc_seq_t, seq )
628 __field(rxrpc_serial_t, serial )
634 __entry->call = call;
636 __entry->serial = serial;
637 __entry->flags = flags;
638 __entry->anno = anno;
641 TP_printk("c=%p DATA %08x q=%08x fl=%02x a=%02x",
649 TRACE_EVENT(rxrpc_rx_ack,
650 TP_PROTO(struct rxrpc_call *call,
651 rxrpc_serial_t serial, rxrpc_serial_t ack_serial,
652 rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks),
654 TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
657 __field(struct rxrpc_call *, call )
658 __field(rxrpc_serial_t, serial )
659 __field(rxrpc_serial_t, ack_serial )
660 __field(rxrpc_seq_t, first )
661 __field(rxrpc_seq_t, prev )
667 __entry->call = call;
668 __entry->serial = serial;
669 __entry->ack_serial = ack_serial;
670 __entry->first = first;
671 __entry->prev = prev;
672 __entry->reason = reason;
673 __entry->n_acks = n_acks;
676 TP_printk("c=%p %08x %s r=%08x f=%08x p=%08x n=%u",
679 __print_symbolic(__entry->reason, rxrpc_ack_names),
686 TRACE_EVENT(rxrpc_tx_data,
687 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
688 rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
690 TP_ARGS(call, seq, serial, flags, retrans, lose),
693 __field(struct rxrpc_call *, call )
694 __field(rxrpc_seq_t, seq )
695 __field(rxrpc_serial_t, serial )
697 __field(bool, retrans )
702 __entry->call = call;
704 __entry->serial = serial;
705 __entry->flags = flags;
706 __entry->retrans = retrans;
707 __entry->lose = lose;
710 TP_printk("c=%p DATA %08x q=%08x fl=%02x%s%s",
715 __entry->retrans ? " *RETRANS*" : "",
716 __entry->lose ? " *LOSE*" : "")
719 TRACE_EVENT(rxrpc_tx_ack,
720 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
721 rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
722 u8 reason, u8 n_acks),
724 TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
727 __field(struct rxrpc_call *, call )
728 __field(rxrpc_serial_t, serial )
729 __field(rxrpc_seq_t, ack_first )
730 __field(rxrpc_serial_t, ack_serial )
736 __entry->call = call;
737 __entry->serial = serial;
738 __entry->ack_first = ack_first;
739 __entry->ack_serial = ack_serial;
740 __entry->reason = reason;
741 __entry->n_acks = n_acks;
744 TP_printk(" c=%p ACK %08x %s f=%08x r=%08x n=%u",
747 __print_symbolic(__entry->reason, rxrpc_ack_names),
753 TRACE_EVENT(rxrpc_receive,
754 TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
755 rxrpc_serial_t serial, rxrpc_seq_t seq),
757 TP_ARGS(call, why, serial, seq),
760 __field(struct rxrpc_call *, call )
761 __field(enum rxrpc_receive_trace, why )
762 __field(rxrpc_serial_t, serial )
763 __field(rxrpc_seq_t, seq )
764 __field(rxrpc_seq_t, hard_ack )
765 __field(rxrpc_seq_t, top )
769 __entry->call = call;
771 __entry->serial = serial;
773 __entry->hard_ack = call->rx_hard_ack;
774 __entry->top = call->rx_top;
777 TP_printk("c=%p %s r=%08x q=%08x w=%08x-%08x",
779 __print_symbolic(__entry->why, rxrpc_receive_traces),
786 TRACE_EVENT(rxrpc_recvmsg,
787 TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
788 rxrpc_seq_t seq, unsigned int offset, unsigned int len,
791 TP_ARGS(call, why, seq, offset, len, ret),
794 __field(struct rxrpc_call *, call )
795 __field(enum rxrpc_recvmsg_trace, why )
796 __field(rxrpc_seq_t, seq )
797 __field(unsigned int, offset )
798 __field(unsigned int, len )
803 __entry->call = call;
806 __entry->offset = offset;
811 TP_printk("c=%p %s q=%08x o=%u l=%u ret=%d",
813 __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
820 TRACE_EVENT(rxrpc_rtt_tx,
821 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
822 rxrpc_serial_t send_serial),
824 TP_ARGS(call, why, send_serial),
827 __field(struct rxrpc_call *, call )
828 __field(enum rxrpc_rtt_tx_trace, why )
829 __field(rxrpc_serial_t, send_serial )
833 __entry->call = call;
835 __entry->send_serial = send_serial;
838 TP_printk("c=%p %s sr=%08x",
840 __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
841 __entry->send_serial)
844 TRACE_EVENT(rxrpc_rtt_rx,
845 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
846 rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
847 s64 rtt, u8 nr, s64 avg),
849 TP_ARGS(call, why, send_serial, resp_serial, rtt, nr, avg),
852 __field(struct rxrpc_call *, call )
853 __field(enum rxrpc_rtt_rx_trace, why )
855 __field(rxrpc_serial_t, send_serial )
856 __field(rxrpc_serial_t, resp_serial )
862 __entry->call = call;
864 __entry->send_serial = send_serial;
865 __entry->resp_serial = resp_serial;
871 TP_printk("c=%p %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
873 __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
874 __entry->send_serial,
875 __entry->resp_serial,
881 TRACE_EVENT(rxrpc_timer,
882 TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
883 ktime_t now, unsigned long now_j),
885 TP_ARGS(call, why, now, now_j),
888 __field(struct rxrpc_call *, call )
889 __field(enum rxrpc_timer_trace, why )
890 __field_struct(ktime_t, now )
891 __field_struct(ktime_t, expire_at )
892 __field_struct(ktime_t, ack_at )
893 __field_struct(ktime_t, resend_at )
894 __field(unsigned long, now_j )
895 __field(unsigned long, timer )
899 __entry->call = call;
902 __entry->expire_at = call->expire_at;
903 __entry->ack_at = call->ack_at;
904 __entry->resend_at = call->resend_at;
905 __entry->now_j = now_j;
906 __entry->timer = call->timer.expires;
909 TP_printk("c=%p %s x=%lld a=%lld r=%lld t=%ld",
911 __print_symbolic(__entry->why, rxrpc_timer_traces),
912 ktime_to_ns(ktime_sub(__entry->expire_at, __entry->now)),
913 ktime_to_ns(ktime_sub(__entry->ack_at, __entry->now)),
914 ktime_to_ns(ktime_sub(__entry->resend_at, __entry->now)),
915 __entry->timer - __entry->now_j)
918 TRACE_EVENT(rxrpc_rx_lose,
919 TP_PROTO(struct rxrpc_skb_priv *sp),
924 __field_struct(struct rxrpc_host_header, hdr )
928 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
931 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
932 __entry->hdr.epoch, __entry->hdr.cid,
933 __entry->hdr.callNumber, __entry->hdr.serviceId,
934 __entry->hdr.serial, __entry->hdr.seq,
935 __entry->hdr.type, __entry->hdr.flags,
936 __entry->hdr.type <= 15 ?
937 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
940 TRACE_EVENT(rxrpc_propose_ack,
941 TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
942 u8 ack_reason, rxrpc_serial_t serial, bool immediate,
943 bool background, enum rxrpc_propose_ack_outcome outcome),
945 TP_ARGS(call, why, ack_reason, serial, immediate, background,
949 __field(struct rxrpc_call *, call )
950 __field(enum rxrpc_propose_ack_trace, why )
951 __field(rxrpc_serial_t, serial )
952 __field(u8, ack_reason )
953 __field(bool, immediate )
954 __field(bool, background )
955 __field(enum rxrpc_propose_ack_outcome, outcome )
959 __entry->call = call;
961 __entry->serial = serial;
962 __entry->ack_reason = ack_reason;
963 __entry->immediate = immediate;
964 __entry->background = background;
965 __entry->outcome = outcome;
968 TP_printk("c=%p %s %s r=%08x i=%u b=%u%s",
970 __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
971 __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
975 __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
978 TRACE_EVENT(rxrpc_retransmit,
979 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
982 TP_ARGS(call, seq, annotation, expiry),
985 __field(struct rxrpc_call *, call )
986 __field(rxrpc_seq_t, seq )
987 __field(u8, annotation )
988 __field(s64, expiry )
992 __entry->call = call;
994 __entry->annotation = annotation;
995 __entry->expiry = expiry;
998 TP_printk("c=%p q=%x a=%02x xp=%lld",
1001 __entry->annotation,
1005 TRACE_EVENT(rxrpc_congest,
1006 TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
1007 rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
1009 TP_ARGS(call, summary, ack_serial, change),
1012 __field(struct rxrpc_call *, call )
1013 __field(enum rxrpc_congest_change, change )
1014 __field(rxrpc_seq_t, hard_ack )
1015 __field(rxrpc_seq_t, top )
1016 __field(rxrpc_seq_t, lowest_nak )
1017 __field(rxrpc_serial_t, ack_serial )
1018 __field_struct(struct rxrpc_ack_summary, sum )
1022 __entry->call = call;
1023 __entry->change = change;
1024 __entry->hard_ack = call->tx_hard_ack;
1025 __entry->top = call->tx_top;
1026 __entry->lowest_nak = call->acks_lowest_nak;
1027 __entry->ack_serial = ack_serial;
1028 memcpy(&__entry->sum, summary, sizeof(__entry->sum));
1031 TP_printk("c=%p %08x %s %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",
1033 __entry->ack_serial,
1034 __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
1036 __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
1038 __entry->sum.ssthresh,
1039 __entry->sum.nr_acks, __entry->sum.nr_nacks,
1040 __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
1041 __entry->sum.nr_rot_new_acks,
1042 __entry->top - __entry->hard_ack,
1043 __entry->sum.cumulative_acks,
1044 __entry->sum.dup_acks,
1045 __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
1046 __print_symbolic(__entry->change, rxrpc_congest_changes),
1047 __entry->sum.retrans_timeo ? " rTxTo" : "")
1050 TRACE_EVENT(rxrpc_disconnect_call,
1051 TP_PROTO(struct rxrpc_call *call),
1056 __field(struct rxrpc_call *, call )
1057 __field(u32, abort_code )
1061 __entry->call = call;
1062 __entry->abort_code = call->abort_code;
1065 TP_printk("c=%p ab=%08x",
1067 __entry->abort_code)
1070 TRACE_EVENT(rxrpc_improper_term,
1071 TP_PROTO(struct rxrpc_call *call),
1076 __field(struct rxrpc_call *, call )
1077 __field(u32, abort_code )
1081 __entry->call = call;
1082 __entry->abort_code = call->abort_code;
1085 TP_printk("c=%p ab=%08x",
1087 __entry->abort_code)
1090 #endif /* _TRACE_RXRPC_H */
1092 /* This part must be outside protection */
1093 #include <trace/define_trace.h>