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_rx_abort
,
687 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
690 TP_ARGS(call
, serial
, abort_code
),
693 __field(struct rxrpc_call
*, call
)
694 __field(rxrpc_serial_t
, serial
)
695 __field(u32
, abort_code
)
699 __entry
->call
= call
;
700 __entry
->serial
= serial
;
701 __entry
->abort_code
= abort_code
;
704 TP_printk("c=%p ABORT %08x ac=%d",
710 TRACE_EVENT(rxrpc_tx_data
,
711 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
,
712 rxrpc_serial_t serial
, u8 flags
, bool retrans
, bool lose
),
714 TP_ARGS(call
, seq
, serial
, flags
, retrans
, lose
),
717 __field(struct rxrpc_call
*, call
)
718 __field(rxrpc_seq_t
, seq
)
719 __field(rxrpc_serial_t
, serial
)
721 __field(bool, retrans
)
726 __entry
->call
= call
;
728 __entry
->serial
= serial
;
729 __entry
->flags
= flags
;
730 __entry
->retrans
= retrans
;
731 __entry
->lose
= lose
;
734 TP_printk("c=%p DATA %08x q=%08x fl=%02x%s%s",
739 __entry
->retrans
? " *RETRANS*" : "",
740 __entry
->lose
? " *LOSE*" : "")
743 TRACE_EVENT(rxrpc_tx_ack
,
744 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
745 rxrpc_seq_t ack_first
, rxrpc_serial_t ack_serial
,
746 u8 reason
, u8 n_acks
),
748 TP_ARGS(call
, serial
, ack_first
, ack_serial
, reason
, n_acks
),
751 __field(struct rxrpc_call
*, call
)
752 __field(rxrpc_serial_t
, serial
)
753 __field(rxrpc_seq_t
, ack_first
)
754 __field(rxrpc_serial_t
, ack_serial
)
760 __entry
->call
= call
;
761 __entry
->serial
= serial
;
762 __entry
->ack_first
= ack_first
;
763 __entry
->ack_serial
= ack_serial
;
764 __entry
->reason
= reason
;
765 __entry
->n_acks
= n_acks
;
768 TP_printk(" c=%p ACK %08x %s f=%08x r=%08x n=%u",
771 __print_symbolic(__entry
->reason
, rxrpc_ack_names
),
777 TRACE_EVENT(rxrpc_receive
,
778 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_receive_trace why
,
779 rxrpc_serial_t serial
, rxrpc_seq_t seq
),
781 TP_ARGS(call
, why
, serial
, seq
),
784 __field(struct rxrpc_call
*, call
)
785 __field(enum rxrpc_receive_trace
, why
)
786 __field(rxrpc_serial_t
, serial
)
787 __field(rxrpc_seq_t
, seq
)
788 __field(rxrpc_seq_t
, hard_ack
)
789 __field(rxrpc_seq_t
, top
)
793 __entry
->call
= call
;
795 __entry
->serial
= serial
;
797 __entry
->hard_ack
= call
->rx_hard_ack
;
798 __entry
->top
= call
->rx_top
;
801 TP_printk("c=%p %s r=%08x q=%08x w=%08x-%08x",
803 __print_symbolic(__entry
->why
, rxrpc_receive_traces
),
810 TRACE_EVENT(rxrpc_recvmsg
,
811 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_recvmsg_trace why
,
812 rxrpc_seq_t seq
, unsigned int offset
, unsigned int len
,
815 TP_ARGS(call
, why
, seq
, offset
, len
, ret
),
818 __field(struct rxrpc_call
*, call
)
819 __field(enum rxrpc_recvmsg_trace
, why
)
820 __field(rxrpc_seq_t
, seq
)
821 __field(unsigned int, offset
)
822 __field(unsigned int, len
)
827 __entry
->call
= call
;
830 __entry
->offset
= offset
;
835 TP_printk("c=%p %s q=%08x o=%u l=%u ret=%d",
837 __print_symbolic(__entry
->why
, rxrpc_recvmsg_traces
),
844 TRACE_EVENT(rxrpc_rtt_tx
,
845 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_rtt_tx_trace why
,
846 rxrpc_serial_t send_serial
),
848 TP_ARGS(call
, why
, send_serial
),
851 __field(struct rxrpc_call
*, call
)
852 __field(enum rxrpc_rtt_tx_trace
, why
)
853 __field(rxrpc_serial_t
, send_serial
)
857 __entry
->call
= call
;
859 __entry
->send_serial
= send_serial
;
862 TP_printk("c=%p %s sr=%08x",
864 __print_symbolic(__entry
->why
, rxrpc_rtt_tx_traces
),
865 __entry
->send_serial
)
868 TRACE_EVENT(rxrpc_rtt_rx
,
869 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_rtt_rx_trace why
,
870 rxrpc_serial_t send_serial
, rxrpc_serial_t resp_serial
,
871 s64 rtt
, u8 nr
, s64 avg
),
873 TP_ARGS(call
, why
, send_serial
, resp_serial
, rtt
, nr
, avg
),
876 __field(struct rxrpc_call
*, call
)
877 __field(enum rxrpc_rtt_rx_trace
, why
)
879 __field(rxrpc_serial_t
, send_serial
)
880 __field(rxrpc_serial_t
, resp_serial
)
886 __entry
->call
= call
;
888 __entry
->send_serial
= send_serial
;
889 __entry
->resp_serial
= resp_serial
;
895 TP_printk("c=%p %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
897 __print_symbolic(__entry
->why
, rxrpc_rtt_rx_traces
),
898 __entry
->send_serial
,
899 __entry
->resp_serial
,
905 TRACE_EVENT(rxrpc_timer
,
906 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_timer_trace why
,
907 ktime_t now
, unsigned long now_j
),
909 TP_ARGS(call
, why
, now
, now_j
),
912 __field(struct rxrpc_call
*, call
)
913 __field(enum rxrpc_timer_trace
, why
)
914 __field_struct(ktime_t
, now
)
915 __field_struct(ktime_t
, expire_at
)
916 __field_struct(ktime_t
, ack_at
)
917 __field_struct(ktime_t
, resend_at
)
918 __field(unsigned long, now_j
)
919 __field(unsigned long, timer
)
923 __entry
->call
= call
;
926 __entry
->expire_at
= call
->expire_at
;
927 __entry
->ack_at
= call
->ack_at
;
928 __entry
->resend_at
= call
->resend_at
;
929 __entry
->now_j
= now_j
;
930 __entry
->timer
= call
->timer
.expires
;
933 TP_printk("c=%p %s x=%lld a=%lld r=%lld t=%ld",
935 __print_symbolic(__entry
->why
, rxrpc_timer_traces
),
936 ktime_to_ns(ktime_sub(__entry
->expire_at
, __entry
->now
)),
937 ktime_to_ns(ktime_sub(__entry
->ack_at
, __entry
->now
)),
938 ktime_to_ns(ktime_sub(__entry
->resend_at
, __entry
->now
)),
939 __entry
->timer
- __entry
->now_j
)
942 TRACE_EVENT(rxrpc_rx_lose
,
943 TP_PROTO(struct rxrpc_skb_priv
*sp
),
948 __field_struct(struct rxrpc_host_header
, hdr
)
952 memcpy(&__entry
->hdr
, &sp
->hdr
, sizeof(__entry
->hdr
));
955 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
956 __entry
->hdr
.epoch
, __entry
->hdr
.cid
,
957 __entry
->hdr
.callNumber
, __entry
->hdr
.serviceId
,
958 __entry
->hdr
.serial
, __entry
->hdr
.seq
,
959 __entry
->hdr
.type
, __entry
->hdr
.flags
,
960 __entry
->hdr
.type
<= 15 ?
961 __print_symbolic(__entry
->hdr
.type
, rxrpc_pkts
) : "?UNK")
964 TRACE_EVENT(rxrpc_propose_ack
,
965 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_propose_ack_trace why
,
966 u8 ack_reason
, rxrpc_serial_t serial
, bool immediate
,
967 bool background
, enum rxrpc_propose_ack_outcome outcome
),
969 TP_ARGS(call
, why
, ack_reason
, serial
, immediate
, background
,
973 __field(struct rxrpc_call
*, call
)
974 __field(enum rxrpc_propose_ack_trace
, why
)
975 __field(rxrpc_serial_t
, serial
)
976 __field(u8
, ack_reason
)
977 __field(bool, immediate
)
978 __field(bool, background
)
979 __field(enum rxrpc_propose_ack_outcome
, outcome
)
983 __entry
->call
= call
;
985 __entry
->serial
= serial
;
986 __entry
->ack_reason
= ack_reason
;
987 __entry
->immediate
= immediate
;
988 __entry
->background
= background
;
989 __entry
->outcome
= outcome
;
992 TP_printk("c=%p %s %s r=%08x i=%u b=%u%s",
994 __print_symbolic(__entry
->why
, rxrpc_propose_ack_traces
),
995 __print_symbolic(__entry
->ack_reason
, rxrpc_ack_names
),
999 __print_symbolic(__entry
->outcome
, rxrpc_propose_ack_outcomes
))
1002 TRACE_EVENT(rxrpc_retransmit
,
1003 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
, u8 annotation
,
1006 TP_ARGS(call
, seq
, annotation
, expiry
),
1009 __field(struct rxrpc_call
*, call
)
1010 __field(rxrpc_seq_t
, seq
)
1011 __field(u8
, annotation
)
1012 __field(s64
, expiry
)
1016 __entry
->call
= call
;
1018 __entry
->annotation
= annotation
;
1019 __entry
->expiry
= expiry
;
1022 TP_printk("c=%p q=%x a=%02x xp=%lld",
1025 __entry
->annotation
,
1029 TRACE_EVENT(rxrpc_congest
,
1030 TP_PROTO(struct rxrpc_call
*call
, struct rxrpc_ack_summary
*summary
,
1031 rxrpc_serial_t ack_serial
, enum rxrpc_congest_change change
),
1033 TP_ARGS(call
, summary
, ack_serial
, change
),
1036 __field(struct rxrpc_call
*, call
)
1037 __field(enum rxrpc_congest_change
, change
)
1038 __field(rxrpc_seq_t
, hard_ack
)
1039 __field(rxrpc_seq_t
, top
)
1040 __field(rxrpc_seq_t
, lowest_nak
)
1041 __field(rxrpc_serial_t
, ack_serial
)
1042 __field_struct(struct rxrpc_ack_summary
, sum
)
1046 __entry
->call
= call
;
1047 __entry
->change
= change
;
1048 __entry
->hard_ack
= call
->tx_hard_ack
;
1049 __entry
->top
= call
->tx_top
;
1050 __entry
->lowest_nak
= call
->acks_lowest_nak
;
1051 __entry
->ack_serial
= ack_serial
;
1052 memcpy(&__entry
->sum
, summary
, sizeof(__entry
->sum
));
1055 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",
1057 __entry
->ack_serial
,
1058 __print_symbolic(__entry
->sum
.ack_reason
, rxrpc_ack_names
),
1060 __print_symbolic(__entry
->sum
.mode
, rxrpc_congest_modes
),
1062 __entry
->sum
.ssthresh
,
1063 __entry
->sum
.nr_acks
, __entry
->sum
.nr_nacks
,
1064 __entry
->sum
.nr_new_acks
, __entry
->sum
.nr_new_nacks
,
1065 __entry
->sum
.nr_rot_new_acks
,
1066 __entry
->top
- __entry
->hard_ack
,
1067 __entry
->sum
.cumulative_acks
,
1068 __entry
->sum
.dup_acks
,
1069 __entry
->lowest_nak
, __entry
->sum
.new_low_nack
? "!" : "",
1070 __print_symbolic(__entry
->change
, rxrpc_congest_changes
),
1071 __entry
->sum
.retrans_timeo
? " rTxTo" : "")
1074 TRACE_EVENT(rxrpc_disconnect_call
,
1075 TP_PROTO(struct rxrpc_call
*call
),
1080 __field(struct rxrpc_call
*, call
)
1081 __field(u32
, abort_code
)
1085 __entry
->call
= call
;
1086 __entry
->abort_code
= call
->abort_code
;
1089 TP_printk("c=%p ab=%08x",
1091 __entry
->abort_code
)
1094 TRACE_EVENT(rxrpc_improper_term
,
1095 TP_PROTO(struct rxrpc_call
*call
),
1100 __field(struct rxrpc_call
*, call
)
1101 __field(u32
, abort_code
)
1105 __entry
->call
= call
;
1106 __entry
->abort_code
= call
->abort_code
;
1109 TP_printk("c=%p ab=%08x",
1111 __entry
->abort_code
)
1114 TRACE_EVENT(rxrpc_rx_eproto
,
1115 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
1118 TP_ARGS(call
, serial
, why
),
1121 __field(struct rxrpc_call
*, call
)
1122 __field(rxrpc_serial_t
, serial
)
1123 __field(const char *, why
)
1127 __entry
->call
= call
;
1128 __entry
->serial
= serial
;
1132 TP_printk("c=%p EPROTO %08x %s",
1138 #endif /* _TRACE_RXRPC_H */
1140 /* This part must be outside protection */
1141 #include <trace/define_trace.h>