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_return
,
123 rxrpc_recvmsg_terminal
,
124 rxrpc_recvmsg_to_be_accepted
,
128 enum rxrpc_rtt_tx_trace
{
133 enum rxrpc_rtt_rx_trace
{
134 rxrpc_rtt_rx_ping_response
,
135 rxrpc_rtt_rx_requested_ack
,
138 enum rxrpc_timer_trace
{
141 rxrpc_timer_init_for_reply
,
142 rxrpc_timer_init_for_send_reply
,
143 rxrpc_timer_set_for_ack
,
144 rxrpc_timer_set_for_ping
,
145 rxrpc_timer_set_for_resend
,
146 rxrpc_timer_set_for_send
,
149 enum rxrpc_propose_ack_trace
{
150 rxrpc_propose_ack_client_tx_end
,
151 rxrpc_propose_ack_input_data
,
152 rxrpc_propose_ack_ping_for_lost_ack
,
153 rxrpc_propose_ack_ping_for_lost_reply
,
154 rxrpc_propose_ack_ping_for_params
,
155 rxrpc_propose_ack_processing_op
,
156 rxrpc_propose_ack_respond_to_ack
,
157 rxrpc_propose_ack_respond_to_ping
,
158 rxrpc_propose_ack_retry_tx
,
159 rxrpc_propose_ack_rotate_rx
,
160 rxrpc_propose_ack_terminal_ack
,
163 enum rxrpc_propose_ack_outcome
{
164 rxrpc_propose_ack_subsume
,
165 rxrpc_propose_ack_update
,
166 rxrpc_propose_ack_use
,
169 enum rxrpc_congest_change
{
170 rxrpc_cong_begin_retransmission
,
171 rxrpc_cong_cleared_nacks
,
172 rxrpc_cong_new_low_nack
,
173 rxrpc_cong_no_change
,
175 rxrpc_cong_retransmit_again
,
176 rxrpc_cong_rtt_window_end
,
180 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
183 * Declare tracing information enums and their string mappings for display.
185 #define rxrpc_skb_traces \
186 EM(rxrpc_skb_rx_cleaned, "Rx CLN") \
187 EM(rxrpc_skb_rx_freed, "Rx FRE") \
188 EM(rxrpc_skb_rx_got, "Rx GOT") \
189 EM(rxrpc_skb_rx_lost, "Rx *L*") \
190 EM(rxrpc_skb_rx_purged, "Rx PUR") \
191 EM(rxrpc_skb_rx_received, "Rx RCV") \
192 EM(rxrpc_skb_rx_rotated, "Rx ROT") \
193 EM(rxrpc_skb_rx_seen, "Rx SEE") \
194 EM(rxrpc_skb_tx_cleaned, "Tx CLN") \
195 EM(rxrpc_skb_tx_freed, "Tx FRE") \
196 EM(rxrpc_skb_tx_got, "Tx GOT") \
197 EM(rxrpc_skb_tx_new, "Tx NEW") \
198 EM(rxrpc_skb_tx_rotated, "Tx ROT") \
199 E_(rxrpc_skb_tx_seen, "Tx SEE")
201 #define rxrpc_conn_traces \
202 EM(rxrpc_conn_got, "GOT") \
203 EM(rxrpc_conn_new_client, "NWc") \
204 EM(rxrpc_conn_new_service, "NWs") \
205 EM(rxrpc_conn_put_client, "PTc") \
206 EM(rxrpc_conn_put_service, "PTs") \
207 EM(rxrpc_conn_queued, "QUE") \
208 E_(rxrpc_conn_seen, "SEE")
210 #define rxrpc_client_traces \
211 EM(rxrpc_client_activate_chans, "Activa") \
212 EM(rxrpc_client_alloc, "Alloc ") \
213 EM(rxrpc_client_chan_activate, "ChActv") \
214 EM(rxrpc_client_chan_disconnect, "ChDisc") \
215 EM(rxrpc_client_chan_pass, "ChPass") \
216 EM(rxrpc_client_chan_unstarted, "ChUnst") \
217 EM(rxrpc_client_cleanup, "Clean ") \
218 EM(rxrpc_client_count, "Count ") \
219 EM(rxrpc_client_discard, "Discar") \
220 EM(rxrpc_client_duplicate, "Duplic") \
221 EM(rxrpc_client_exposed, "Expose") \
222 EM(rxrpc_client_replace, "Replac") \
223 EM(rxrpc_client_to_active, "->Actv") \
224 EM(rxrpc_client_to_culled, "->Cull") \
225 EM(rxrpc_client_to_idle, "->Idle") \
226 EM(rxrpc_client_to_inactive, "->Inac") \
227 EM(rxrpc_client_to_upgrade, "->Upgd") \
228 EM(rxrpc_client_to_waiting, "->Wait") \
229 E_(rxrpc_client_uncount, "Uncoun")
231 #define rxrpc_conn_cache_states \
232 EM(RXRPC_CONN_CLIENT_INACTIVE, "Inac") \
233 EM(RXRPC_CONN_CLIENT_WAITING, "Wait") \
234 EM(RXRPC_CONN_CLIENT_ACTIVE, "Actv") \
235 EM(RXRPC_CONN_CLIENT_CULLED, "Cull") \
236 E_(RXRPC_CONN_CLIENT_IDLE, "Idle") \
238 #define rxrpc_call_traces \
239 EM(rxrpc_call_connected, "CON") \
240 EM(rxrpc_call_error, "*E*") \
241 EM(rxrpc_call_got, "GOT") \
242 EM(rxrpc_call_got_kernel, "Gke") \
243 EM(rxrpc_call_got_userid, "Gus") \
244 EM(rxrpc_call_new_client, "NWc") \
245 EM(rxrpc_call_new_service, "NWs") \
246 EM(rxrpc_call_put, "PUT") \
247 EM(rxrpc_call_put_kernel, "Pke") \
248 EM(rxrpc_call_put_noqueue, "PNQ") \
249 EM(rxrpc_call_put_userid, "Pus") \
250 EM(rxrpc_call_queued, "QUE") \
251 EM(rxrpc_call_queued_ref, "QUR") \
252 EM(rxrpc_call_release, "RLS") \
253 E_(rxrpc_call_seen, "SEE")
255 #define rxrpc_transmit_traces \
256 EM(rxrpc_transmit_await_reply, "AWR") \
257 EM(rxrpc_transmit_end, "END") \
258 EM(rxrpc_transmit_queue, "QUE") \
259 EM(rxrpc_transmit_queue_last, "QLS") \
260 EM(rxrpc_transmit_rotate, "ROT") \
261 EM(rxrpc_transmit_rotate_last, "RLS") \
262 E_(rxrpc_transmit_wait, "WAI")
264 #define rxrpc_receive_traces \
265 EM(rxrpc_receive_end, "END") \
266 EM(rxrpc_receive_front, "FRN") \
267 EM(rxrpc_receive_incoming, "INC") \
268 EM(rxrpc_receive_queue, "QUE") \
269 EM(rxrpc_receive_queue_last, "QLS") \
270 E_(rxrpc_receive_rotate, "ROT")
272 #define rxrpc_recvmsg_traces \
273 EM(rxrpc_recvmsg_cont, "CONT") \
274 EM(rxrpc_recvmsg_data_return, "DATA") \
275 EM(rxrpc_recvmsg_dequeue, "DEQU") \
276 EM(rxrpc_recvmsg_enter, "ENTR") \
277 EM(rxrpc_recvmsg_full, "FULL") \
278 EM(rxrpc_recvmsg_hole, "HOLE") \
279 EM(rxrpc_recvmsg_next, "NEXT") \
280 EM(rxrpc_recvmsg_return, "RETN") \
281 EM(rxrpc_recvmsg_terminal, "TERM") \
282 EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \
283 E_(rxrpc_recvmsg_wait, "WAIT")
285 #define rxrpc_rtt_tx_traces \
286 EM(rxrpc_rtt_tx_data, "DATA") \
287 E_(rxrpc_rtt_tx_ping, "PING")
289 #define rxrpc_rtt_rx_traces \
290 EM(rxrpc_rtt_rx_ping_response, "PONG") \
291 E_(rxrpc_rtt_rx_requested_ack, "RACK")
293 #define rxrpc_timer_traces \
294 EM(rxrpc_timer_begin, "Begin ") \
295 EM(rxrpc_timer_expired, "*EXPR*") \
296 EM(rxrpc_timer_init_for_reply, "IniRpl") \
297 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
298 EM(rxrpc_timer_set_for_ack, "SetAck") \
299 EM(rxrpc_timer_set_for_ping, "SetPng") \
300 EM(rxrpc_timer_set_for_resend, "SetRTx") \
301 E_(rxrpc_timer_set_for_send, "SetTx ")
303 #define rxrpc_propose_ack_traces \
304 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
305 EM(rxrpc_propose_ack_input_data, "DataIn ") \
306 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
307 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
308 EM(rxrpc_propose_ack_ping_for_params, "Params ") \
309 EM(rxrpc_propose_ack_processing_op, "ProcOp ") \
310 EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \
311 EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \
312 EM(rxrpc_propose_ack_retry_tx, "RetryTx") \
313 EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \
314 E_(rxrpc_propose_ack_terminal_ack, "ClTerm ")
316 #define rxrpc_propose_ack_outcomes \
317 EM(rxrpc_propose_ack_subsume, " Subsume") \
318 EM(rxrpc_propose_ack_update, " Update") \
319 E_(rxrpc_propose_ack_use, "")
321 #define rxrpc_congest_modes \
322 EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \
323 EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \
324 EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \
325 E_(RXRPC_CALL_SLOW_START, "SlowStart")
327 #define rxrpc_congest_changes \
328 EM(rxrpc_cong_begin_retransmission, " Retrans") \
329 EM(rxrpc_cong_cleared_nacks, " Cleared") \
330 EM(rxrpc_cong_new_low_nack, " NewLowN") \
331 EM(rxrpc_cong_no_change, "") \
332 EM(rxrpc_cong_progress, " Progres") \
333 EM(rxrpc_cong_retransmit_again, " ReTxAgn") \
334 EM(rxrpc_cong_rtt_window_end, " RttWinE") \
335 E_(rxrpc_cong_saw_nack, " SawNack")
339 EM(RXRPC_PACKET_TYPE_DATA, "DATA") \
340 EM(RXRPC_PACKET_TYPE_ACK, "ACK") \
341 EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \
342 EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \
343 EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \
344 EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \
345 EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \
346 EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \
351 EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \
355 #define rxrpc_ack_names \
357 EM(RXRPC_ACK_REQUESTED, "REQ") \
358 EM(RXRPC_ACK_DUPLICATE, "DUP") \
359 EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \
360 EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \
361 EM(RXRPC_ACK_NOSPACE, "MEM") \
362 EM(RXRPC_ACK_PING, "PNG") \
363 EM(RXRPC_ACK_PING_RESPONSE, "PNR") \
364 EM(RXRPC_ACK_DELAY, "DLY") \
365 EM(RXRPC_ACK_IDLE, "IDL") \
366 E_(RXRPC_ACK__INVALID, "-?-")
369 * Export enum symbols via userspace.
373 #define EM(a, b) TRACE_DEFINE_ENUM(a);
374 #define E_(a, b) TRACE_DEFINE_ENUM(a);
380 rxrpc_transmit_traces
;
381 rxrpc_receive_traces
;
382 rxrpc_recvmsg_traces
;
386 rxrpc_propose_ack_traces
;
387 rxrpc_propose_ack_outcomes
;
388 rxrpc_congest_changes
;
391 * Now redefine the EM() and E_() macros to map the enums to the strings that
392 * will be printed in the output.
396 #define EM(a, b) { a, b },
397 #define E_(a, b) { a, b }
399 TRACE_EVENT(rxrpc_conn
,
400 TP_PROTO(struct rxrpc_connection
*conn
, enum rxrpc_conn_trace op
,
401 int usage
, const void *where
),
403 TP_ARGS(conn
, op
, usage
, where
),
406 __field(struct rxrpc_connection
*, conn
)
409 __field(const void *, where
)
413 __entry
->conn
= conn
;
415 __entry
->usage
= usage
;
416 __entry
->where
= where
;
419 TP_printk("C=%p %s u=%d sp=%pSR",
421 __print_symbolic(__entry
->op
, rxrpc_conn_traces
),
426 TRACE_EVENT(rxrpc_client
,
427 TP_PROTO(struct rxrpc_connection
*conn
, int channel
,
428 enum rxrpc_client_trace op
),
430 TP_ARGS(conn
, channel
, op
),
433 __field(struct rxrpc_connection
*, conn
)
435 __field(int, channel
)
437 __field(enum rxrpc_client_trace
, op
)
438 __field(enum rxrpc_conn_cache_state
, cs
)
442 __entry
->conn
= conn
;
443 __entry
->channel
= channel
;
444 __entry
->usage
= atomic_read(&conn
->usage
);
446 __entry
->cid
= conn
->proto
.cid
;
447 __entry
->cs
= conn
->cache_state
;
450 TP_printk("C=%p h=%2d %s %s i=%08x u=%d",
453 __print_symbolic(__entry
->op
, rxrpc_client_traces
),
454 __print_symbolic(__entry
->cs
, rxrpc_conn_cache_states
),
459 TRACE_EVENT(rxrpc_call
,
460 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_call_trace op
,
461 int usage
, const void *where
, const void *aux
),
463 TP_ARGS(call
, op
, usage
, where
, aux
),
466 __field(struct rxrpc_call
*, call
)
469 __field(const void *, where
)
470 __field(const void *, aux
)
474 __entry
->call
= call
;
476 __entry
->usage
= usage
;
477 __entry
->where
= where
;
481 TP_printk("c=%p %s u=%d sp=%pSR a=%p",
483 __print_symbolic(__entry
->op
, rxrpc_call_traces
),
489 TRACE_EVENT(rxrpc_skb
,
490 TP_PROTO(struct sk_buff
*skb
, enum rxrpc_skb_trace op
,
491 int usage
, int mod_count
, const void *where
),
493 TP_ARGS(skb
, op
, usage
, mod_count
, where
),
496 __field(struct sk_buff
*, skb
)
497 __field(enum rxrpc_skb_trace
, op
)
499 __field(int, mod_count
)
500 __field(const void *, where
)
506 __entry
->usage
= usage
;
507 __entry
->mod_count
= mod_count
;
508 __entry
->where
= where
;
511 TP_printk("s=%p %s u=%d m=%d p=%pSR",
513 __print_symbolic(__entry
->op
, rxrpc_skb_traces
),
519 TRACE_EVENT(rxrpc_rx_packet
,
520 TP_PROTO(struct rxrpc_skb_priv
*sp
),
525 __field_struct(struct rxrpc_host_header
, hdr
)
529 memcpy(&__entry
->hdr
, &sp
->hdr
, sizeof(__entry
->hdr
));
532 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
533 __entry
->hdr
.epoch
, __entry
->hdr
.cid
,
534 __entry
->hdr
.callNumber
, __entry
->hdr
.serviceId
,
535 __entry
->hdr
.serial
, __entry
->hdr
.seq
,
536 __entry
->hdr
.type
, __entry
->hdr
.flags
,
537 __entry
->hdr
.type
<= 15 ?
538 __print_symbolic(__entry
->hdr
.type
, rxrpc_pkts
) : "?UNK")
541 TRACE_EVENT(rxrpc_rx_done
,
542 TP_PROTO(int result
, int abort_code
),
544 TP_ARGS(result
, abort_code
),
547 __field(int, result
)
548 __field(int, abort_code
)
552 __entry
->result
= result
;
553 __entry
->abort_code
= abort_code
;
556 TP_printk("r=%d a=%d", __entry
->result
, __entry
->abort_code
)
559 TRACE_EVENT(rxrpc_abort
,
560 TP_PROTO(const char *why
, u32 cid
, u32 call_id
, rxrpc_seq_t seq
,
561 int abort_code
, int error
),
563 TP_ARGS(why
, cid
, call_id
, seq
, abort_code
, error
),
566 __array(char, why
, 4 )
568 __field(u32
, call_id
)
569 __field(rxrpc_seq_t
, seq
)
570 __field(int, abort_code
)
575 memcpy(__entry
->why
, why
, 4);
577 __entry
->call_id
= call_id
;
578 __entry
->abort_code
= abort_code
;
579 __entry
->error
= error
;
583 TP_printk("%08x:%08x s=%u a=%d e=%d %s",
584 __entry
->cid
, __entry
->call_id
, __entry
->seq
,
585 __entry
->abort_code
, __entry
->error
, __entry
->why
)
588 TRACE_EVENT(rxrpc_transmit
,
589 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_transmit_trace why
),
594 __field(struct rxrpc_call
*, call
)
595 __field(enum rxrpc_transmit_trace
, why
)
596 __field(rxrpc_seq_t
, tx_hard_ack
)
597 __field(rxrpc_seq_t
, tx_top
)
598 __field(int, tx_winsize
)
602 __entry
->call
= call
;
604 __entry
->tx_hard_ack
= call
->tx_hard_ack
;
605 __entry
->tx_top
= call
->tx_top
;
606 __entry
->tx_winsize
= call
->tx_winsize
;
609 TP_printk("c=%p %s f=%08x n=%u/%u",
611 __print_symbolic(__entry
->why
, rxrpc_transmit_traces
),
612 __entry
->tx_hard_ack
+ 1,
613 __entry
->tx_top
- __entry
->tx_hard_ack
,
617 TRACE_EVENT(rxrpc_rx_data
,
618 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
,
619 rxrpc_serial_t serial
, u8 flags
, u8 anno
),
621 TP_ARGS(call
, seq
, serial
, flags
, anno
),
624 __field(struct rxrpc_call
*, call
)
625 __field(rxrpc_seq_t
, seq
)
626 __field(rxrpc_serial_t
, serial
)
632 __entry
->call
= call
;
634 __entry
->serial
= serial
;
635 __entry
->flags
= flags
;
636 __entry
->anno
= anno
;
639 TP_printk("c=%p DATA %08x q=%08x fl=%02x a=%02x",
647 TRACE_EVENT(rxrpc_rx_ack
,
648 TP_PROTO(struct rxrpc_call
*call
,
649 rxrpc_serial_t serial
, rxrpc_serial_t ack_serial
,
650 rxrpc_seq_t first
, rxrpc_seq_t prev
, u8 reason
, u8 n_acks
),
652 TP_ARGS(call
, serial
, ack_serial
, first
, prev
, reason
, n_acks
),
655 __field(struct rxrpc_call
*, call
)
656 __field(rxrpc_serial_t
, serial
)
657 __field(rxrpc_serial_t
, ack_serial
)
658 __field(rxrpc_seq_t
, first
)
659 __field(rxrpc_seq_t
, prev
)
665 __entry
->call
= call
;
666 __entry
->serial
= serial
;
667 __entry
->ack_serial
= ack_serial
;
668 __entry
->first
= first
;
669 __entry
->prev
= prev
;
670 __entry
->reason
= reason
;
671 __entry
->n_acks
= n_acks
;
674 TP_printk("c=%p %08x %s r=%08x f=%08x p=%08x n=%u",
677 __print_symbolic(__entry
->reason
, rxrpc_ack_names
),
684 TRACE_EVENT(rxrpc_tx_data
,
685 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
,
686 rxrpc_serial_t serial
, u8 flags
, bool retrans
, bool lose
),
688 TP_ARGS(call
, seq
, serial
, flags
, retrans
, lose
),
691 __field(struct rxrpc_call
*, call
)
692 __field(rxrpc_seq_t
, seq
)
693 __field(rxrpc_serial_t
, serial
)
695 __field(bool, retrans
)
700 __entry
->call
= call
;
702 __entry
->serial
= serial
;
703 __entry
->flags
= flags
;
704 __entry
->retrans
= retrans
;
705 __entry
->lose
= lose
;
708 TP_printk("c=%p DATA %08x q=%08x fl=%02x%s%s",
713 __entry
->retrans
? " *RETRANS*" : "",
714 __entry
->lose
? " *LOSE*" : "")
717 TRACE_EVENT(rxrpc_tx_ack
,
718 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
719 rxrpc_seq_t ack_first
, rxrpc_serial_t ack_serial
,
720 u8 reason
, u8 n_acks
),
722 TP_ARGS(call
, serial
, ack_first
, ack_serial
, reason
, n_acks
),
725 __field(struct rxrpc_call
*, call
)
726 __field(rxrpc_serial_t
, serial
)
727 __field(rxrpc_seq_t
, ack_first
)
728 __field(rxrpc_serial_t
, ack_serial
)
734 __entry
->call
= call
;
735 __entry
->serial
= serial
;
736 __entry
->ack_first
= ack_first
;
737 __entry
->ack_serial
= ack_serial
;
738 __entry
->reason
= reason
;
739 __entry
->n_acks
= n_acks
;
742 TP_printk(" c=%p ACK %08x %s f=%08x r=%08x n=%u",
745 __print_symbolic(__entry
->reason
, rxrpc_ack_names
),
751 TRACE_EVENT(rxrpc_receive
,
752 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_receive_trace why
,
753 rxrpc_serial_t serial
, rxrpc_seq_t seq
),
755 TP_ARGS(call
, why
, serial
, seq
),
758 __field(struct rxrpc_call
*, call
)
759 __field(enum rxrpc_receive_trace
, why
)
760 __field(rxrpc_serial_t
, serial
)
761 __field(rxrpc_seq_t
, seq
)
762 __field(rxrpc_seq_t
, hard_ack
)
763 __field(rxrpc_seq_t
, top
)
767 __entry
->call
= call
;
769 __entry
->serial
= serial
;
771 __entry
->hard_ack
= call
->rx_hard_ack
;
772 __entry
->top
= call
->rx_top
;
775 TP_printk("c=%p %s r=%08x q=%08x w=%08x-%08x",
777 __print_symbolic(__entry
->why
, rxrpc_receive_traces
),
784 TRACE_EVENT(rxrpc_recvmsg
,
785 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_recvmsg_trace why
,
786 rxrpc_seq_t seq
, unsigned int offset
, unsigned int len
,
789 TP_ARGS(call
, why
, seq
, offset
, len
, ret
),
792 __field(struct rxrpc_call
*, call
)
793 __field(enum rxrpc_recvmsg_trace
, why
)
794 __field(rxrpc_seq_t
, seq
)
795 __field(unsigned int, offset
)
796 __field(unsigned int, len
)
801 __entry
->call
= call
;
804 __entry
->offset
= offset
;
809 TP_printk("c=%p %s q=%08x o=%u l=%u ret=%d",
811 __print_symbolic(__entry
->why
, rxrpc_recvmsg_traces
),
818 TRACE_EVENT(rxrpc_rtt_tx
,
819 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_rtt_tx_trace why
,
820 rxrpc_serial_t send_serial
),
822 TP_ARGS(call
, why
, send_serial
),
825 __field(struct rxrpc_call
*, call
)
826 __field(enum rxrpc_rtt_tx_trace
, why
)
827 __field(rxrpc_serial_t
, send_serial
)
831 __entry
->call
= call
;
833 __entry
->send_serial
= send_serial
;
836 TP_printk("c=%p %s sr=%08x",
838 __print_symbolic(__entry
->why
, rxrpc_rtt_tx_traces
),
839 __entry
->send_serial
)
842 TRACE_EVENT(rxrpc_rtt_rx
,
843 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_rtt_rx_trace why
,
844 rxrpc_serial_t send_serial
, rxrpc_serial_t resp_serial
,
845 s64 rtt
, u8 nr
, s64 avg
),
847 TP_ARGS(call
, why
, send_serial
, resp_serial
, rtt
, nr
, avg
),
850 __field(struct rxrpc_call
*, call
)
851 __field(enum rxrpc_rtt_rx_trace
, why
)
853 __field(rxrpc_serial_t
, send_serial
)
854 __field(rxrpc_serial_t
, resp_serial
)
860 __entry
->call
= call
;
862 __entry
->send_serial
= send_serial
;
863 __entry
->resp_serial
= resp_serial
;
869 TP_printk("c=%p %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
871 __print_symbolic(__entry
->why
, rxrpc_rtt_rx_traces
),
872 __entry
->send_serial
,
873 __entry
->resp_serial
,
879 TRACE_EVENT(rxrpc_timer
,
880 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_timer_trace why
,
881 ktime_t now
, unsigned long now_j
),
883 TP_ARGS(call
, why
, now
, now_j
),
886 __field(struct rxrpc_call
*, call
)
887 __field(enum rxrpc_timer_trace
, why
)
888 __field_struct(ktime_t
, now
)
889 __field_struct(ktime_t
, expire_at
)
890 __field_struct(ktime_t
, ack_at
)
891 __field_struct(ktime_t
, resend_at
)
892 __field(unsigned long, now_j
)
893 __field(unsigned long, timer
)
897 __entry
->call
= call
;
900 __entry
->expire_at
= call
->expire_at
;
901 __entry
->ack_at
= call
->ack_at
;
902 __entry
->resend_at
= call
->resend_at
;
903 __entry
->now_j
= now_j
;
904 __entry
->timer
= call
->timer
.expires
;
907 TP_printk("c=%p %s x=%lld a=%lld r=%lld t=%ld",
909 __print_symbolic(__entry
->why
, rxrpc_timer_traces
),
910 ktime_to_ns(ktime_sub(__entry
->expire_at
, __entry
->now
)),
911 ktime_to_ns(ktime_sub(__entry
->ack_at
, __entry
->now
)),
912 ktime_to_ns(ktime_sub(__entry
->resend_at
, __entry
->now
)),
913 __entry
->timer
- __entry
->now_j
)
916 TRACE_EVENT(rxrpc_rx_lose
,
917 TP_PROTO(struct rxrpc_skb_priv
*sp
),
922 __field_struct(struct rxrpc_host_header
, hdr
)
926 memcpy(&__entry
->hdr
, &sp
->hdr
, sizeof(__entry
->hdr
));
929 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
930 __entry
->hdr
.epoch
, __entry
->hdr
.cid
,
931 __entry
->hdr
.callNumber
, __entry
->hdr
.serviceId
,
932 __entry
->hdr
.serial
, __entry
->hdr
.seq
,
933 __entry
->hdr
.type
, __entry
->hdr
.flags
,
934 __entry
->hdr
.type
<= 15 ?
935 __print_symbolic(__entry
->hdr
.type
, rxrpc_pkts
) : "?UNK")
938 TRACE_EVENT(rxrpc_propose_ack
,
939 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_propose_ack_trace why
,
940 u8 ack_reason
, rxrpc_serial_t serial
, bool immediate
,
941 bool background
, enum rxrpc_propose_ack_outcome outcome
),
943 TP_ARGS(call
, why
, ack_reason
, serial
, immediate
, background
,
947 __field(struct rxrpc_call
*, call
)
948 __field(enum rxrpc_propose_ack_trace
, why
)
949 __field(rxrpc_serial_t
, serial
)
950 __field(u8
, ack_reason
)
951 __field(bool, immediate
)
952 __field(bool, background
)
953 __field(enum rxrpc_propose_ack_outcome
, outcome
)
957 __entry
->call
= call
;
959 __entry
->serial
= serial
;
960 __entry
->ack_reason
= ack_reason
;
961 __entry
->immediate
= immediate
;
962 __entry
->background
= background
;
963 __entry
->outcome
= outcome
;
966 TP_printk("c=%p %s %s r=%08x i=%u b=%u%s",
968 __print_symbolic(__entry
->why
, rxrpc_propose_ack_traces
),
969 __print_symbolic(__entry
->ack_reason
, rxrpc_ack_names
),
973 __print_symbolic(__entry
->outcome
, rxrpc_propose_ack_outcomes
))
976 TRACE_EVENT(rxrpc_retransmit
,
977 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
, u8 annotation
,
980 TP_ARGS(call
, seq
, annotation
, expiry
),
983 __field(struct rxrpc_call
*, call
)
984 __field(rxrpc_seq_t
, seq
)
985 __field(u8
, annotation
)
986 __field(s64
, expiry
)
990 __entry
->call
= call
;
992 __entry
->annotation
= annotation
;
993 __entry
->expiry
= expiry
;
996 TP_printk("c=%p q=%x a=%02x xp=%lld",
1003 TRACE_EVENT(rxrpc_congest
,
1004 TP_PROTO(struct rxrpc_call
*call
, struct rxrpc_ack_summary
*summary
,
1005 rxrpc_serial_t ack_serial
, enum rxrpc_congest_change change
),
1007 TP_ARGS(call
, summary
, ack_serial
, change
),
1010 __field(struct rxrpc_call
*, call
)
1011 __field(enum rxrpc_congest_change
, change
)
1012 __field(rxrpc_seq_t
, hard_ack
)
1013 __field(rxrpc_seq_t
, top
)
1014 __field(rxrpc_seq_t
, lowest_nak
)
1015 __field(rxrpc_serial_t
, ack_serial
)
1016 __field_struct(struct rxrpc_ack_summary
, sum
)
1020 __entry
->call
= call
;
1021 __entry
->change
= change
;
1022 __entry
->hard_ack
= call
->tx_hard_ack
;
1023 __entry
->top
= call
->tx_top
;
1024 __entry
->lowest_nak
= call
->acks_lowest_nak
;
1025 __entry
->ack_serial
= ack_serial
;
1026 memcpy(&__entry
->sum
, summary
, sizeof(__entry
->sum
));
1029 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",
1031 __entry
->ack_serial
,
1032 __print_symbolic(__entry
->sum
.ack_reason
, rxrpc_ack_names
),
1034 __print_symbolic(__entry
->sum
.mode
, rxrpc_congest_modes
),
1036 __entry
->sum
.ssthresh
,
1037 __entry
->sum
.nr_acks
, __entry
->sum
.nr_nacks
,
1038 __entry
->sum
.nr_new_acks
, __entry
->sum
.nr_new_nacks
,
1039 __entry
->sum
.nr_rot_new_acks
,
1040 __entry
->top
- __entry
->hard_ack
,
1041 __entry
->sum
.cumulative_acks
,
1042 __entry
->sum
.dup_acks
,
1043 __entry
->lowest_nak
, __entry
->sum
.new_low_nack
? "!" : "",
1044 __print_symbolic(__entry
->change
, rxrpc_congest_changes
),
1045 __entry
->sum
.retrans_timeo
? " rTxTo" : "")
1048 TRACE_EVENT(rxrpc_disconnect_call
,
1049 TP_PROTO(struct rxrpc_call
*call
),
1054 __field(struct rxrpc_call
*, call
)
1055 __field(u32
, abort_code
)
1059 __entry
->call
= call
;
1060 __entry
->abort_code
= call
->abort_code
;
1063 TP_printk("c=%p ab=%08x",
1065 __entry
->abort_code
)
1068 TRACE_EVENT(rxrpc_improper_term
,
1069 TP_PROTO(struct rxrpc_call
*call
),
1074 __field(struct rxrpc_call
*, call
)
1075 __field(u32
, abort_code
)
1079 __entry
->call
= call
;
1080 __entry
->abort_code
= call
->abort_code
;
1083 TP_printk("c=%p ab=%08x",
1085 __entry
->abort_code
)
1088 #endif /* _TRACE_RXRPC_H */
1090 /* This part must be outside protection */
1091 #include <trace/define_trace.h>