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_UPGRADE, "Upgd") \
237 EM(RXRPC_CONN_CLIENT_CULLED, "Cull") \
238 E_(RXRPC_CONN_CLIENT_IDLE, "Idle") \
240 #define rxrpc_call_traces \
241 EM(rxrpc_call_connected, "CON") \
242 EM(rxrpc_call_error, "*E*") \
243 EM(rxrpc_call_got, "GOT") \
244 EM(rxrpc_call_got_kernel, "Gke") \
245 EM(rxrpc_call_got_userid, "Gus") \
246 EM(rxrpc_call_new_client, "NWc") \
247 EM(rxrpc_call_new_service, "NWs") \
248 EM(rxrpc_call_put, "PUT") \
249 EM(rxrpc_call_put_kernel, "Pke") \
250 EM(rxrpc_call_put_noqueue, "PNQ") \
251 EM(rxrpc_call_put_userid, "Pus") \
252 EM(rxrpc_call_queued, "QUE") \
253 EM(rxrpc_call_queued_ref, "QUR") \
254 EM(rxrpc_call_release, "RLS") \
255 E_(rxrpc_call_seen, "SEE")
257 #define rxrpc_transmit_traces \
258 EM(rxrpc_transmit_await_reply, "AWR") \
259 EM(rxrpc_transmit_end, "END") \
260 EM(rxrpc_transmit_queue, "QUE") \
261 EM(rxrpc_transmit_queue_last, "QLS") \
262 EM(rxrpc_transmit_rotate, "ROT") \
263 EM(rxrpc_transmit_rotate_last, "RLS") \
264 E_(rxrpc_transmit_wait, "WAI")
266 #define rxrpc_receive_traces \
267 EM(rxrpc_receive_end, "END") \
268 EM(rxrpc_receive_front, "FRN") \
269 EM(rxrpc_receive_incoming, "INC") \
270 EM(rxrpc_receive_queue, "QUE") \
271 EM(rxrpc_receive_queue_last, "QLS") \
272 E_(rxrpc_receive_rotate, "ROT")
274 #define rxrpc_recvmsg_traces \
275 EM(rxrpc_recvmsg_cont, "CONT") \
276 EM(rxrpc_recvmsg_data_return, "DATA") \
277 EM(rxrpc_recvmsg_dequeue, "DEQU") \
278 EM(rxrpc_recvmsg_enter, "ENTR") \
279 EM(rxrpc_recvmsg_full, "FULL") \
280 EM(rxrpc_recvmsg_hole, "HOLE") \
281 EM(rxrpc_recvmsg_next, "NEXT") \
282 EM(rxrpc_recvmsg_requeue, "REQU") \
283 EM(rxrpc_recvmsg_return, "RETN") \
284 EM(rxrpc_recvmsg_terminal, "TERM") \
285 EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \
286 E_(rxrpc_recvmsg_wait, "WAIT")
288 #define rxrpc_rtt_tx_traces \
289 EM(rxrpc_rtt_tx_data, "DATA") \
290 E_(rxrpc_rtt_tx_ping, "PING")
292 #define rxrpc_rtt_rx_traces \
293 EM(rxrpc_rtt_rx_ping_response, "PONG") \
294 E_(rxrpc_rtt_rx_requested_ack, "RACK")
296 #define rxrpc_timer_traces \
297 EM(rxrpc_timer_begin, "Begin ") \
298 EM(rxrpc_timer_expired, "*EXPR*") \
299 EM(rxrpc_timer_init_for_reply, "IniRpl") \
300 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
301 EM(rxrpc_timer_set_for_ack, "SetAck") \
302 EM(rxrpc_timer_set_for_ping, "SetPng") \
303 EM(rxrpc_timer_set_for_resend, "SetRTx") \
304 E_(rxrpc_timer_set_for_send, "SetTx ")
306 #define rxrpc_propose_ack_traces \
307 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
308 EM(rxrpc_propose_ack_input_data, "DataIn ") \
309 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
310 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
311 EM(rxrpc_propose_ack_ping_for_params, "Params ") \
312 EM(rxrpc_propose_ack_processing_op, "ProcOp ") \
313 EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \
314 EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \
315 EM(rxrpc_propose_ack_retry_tx, "RetryTx") \
316 EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \
317 E_(rxrpc_propose_ack_terminal_ack, "ClTerm ")
319 #define rxrpc_propose_ack_outcomes \
320 EM(rxrpc_propose_ack_subsume, " Subsume") \
321 EM(rxrpc_propose_ack_update, " Update") \
322 E_(rxrpc_propose_ack_use, "")
324 #define rxrpc_congest_modes \
325 EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \
326 EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \
327 EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \
328 E_(RXRPC_CALL_SLOW_START, "SlowStart")
330 #define rxrpc_congest_changes \
331 EM(rxrpc_cong_begin_retransmission, " Retrans") \
332 EM(rxrpc_cong_cleared_nacks, " Cleared") \
333 EM(rxrpc_cong_new_low_nack, " NewLowN") \
334 EM(rxrpc_cong_no_change, "") \
335 EM(rxrpc_cong_progress, " Progres") \
336 EM(rxrpc_cong_retransmit_again, " ReTxAgn") \
337 EM(rxrpc_cong_rtt_window_end, " RttWinE") \
338 E_(rxrpc_cong_saw_nack, " SawNack")
342 EM(RXRPC_PACKET_TYPE_DATA, "DATA") \
343 EM(RXRPC_PACKET_TYPE_ACK, "ACK") \
344 EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \
345 EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \
346 EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \
347 EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \
348 EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \
349 EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \
354 EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \
358 #define rxrpc_ack_names \
360 EM(RXRPC_ACK_REQUESTED, "REQ") \
361 EM(RXRPC_ACK_DUPLICATE, "DUP") \
362 EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \
363 EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \
364 EM(RXRPC_ACK_NOSPACE, "MEM") \
365 EM(RXRPC_ACK_PING, "PNG") \
366 EM(RXRPC_ACK_PING_RESPONSE, "PNR") \
367 EM(RXRPC_ACK_DELAY, "DLY") \
368 EM(RXRPC_ACK_IDLE, "IDL") \
369 E_(RXRPC_ACK__INVALID, "-?-")
372 * Export enum symbols via userspace.
376 #define EM(a, b) TRACE_DEFINE_ENUM(a);
377 #define E_(a, b) TRACE_DEFINE_ENUM(a);
383 rxrpc_transmit_traces
;
384 rxrpc_receive_traces
;
385 rxrpc_recvmsg_traces
;
389 rxrpc_propose_ack_traces
;
390 rxrpc_propose_ack_outcomes
;
391 rxrpc_congest_changes
;
394 * Now redefine the EM() and E_() macros to map the enums to the strings that
395 * will be printed in the output.
399 #define EM(a, b) { a, b },
400 #define E_(a, b) { a, b }
402 TRACE_EVENT(rxrpc_conn
,
403 TP_PROTO(struct rxrpc_connection
*conn
, enum rxrpc_conn_trace op
,
404 int usage
, const void *where
),
406 TP_ARGS(conn
, op
, usage
, where
),
409 __field(struct rxrpc_connection
*, conn
)
412 __field(const void *, where
)
416 __entry
->conn
= conn
;
418 __entry
->usage
= usage
;
419 __entry
->where
= where
;
422 TP_printk("C=%p %s u=%d sp=%pSR",
424 __print_symbolic(__entry
->op
, rxrpc_conn_traces
),
429 TRACE_EVENT(rxrpc_client
,
430 TP_PROTO(struct rxrpc_connection
*conn
, int channel
,
431 enum rxrpc_client_trace op
),
433 TP_ARGS(conn
, channel
, op
),
436 __field(struct rxrpc_connection
*, conn
)
438 __field(int, channel
)
440 __field(enum rxrpc_client_trace
, op
)
441 __field(enum rxrpc_conn_cache_state
, cs
)
445 __entry
->conn
= conn
;
446 __entry
->channel
= channel
;
447 __entry
->usage
= atomic_read(&conn
->usage
);
449 __entry
->cid
= conn
->proto
.cid
;
450 __entry
->cs
= conn
->cache_state
;
453 TP_printk("C=%p h=%2d %s %s i=%08x u=%d",
456 __print_symbolic(__entry
->op
, rxrpc_client_traces
),
457 __print_symbolic(__entry
->cs
, rxrpc_conn_cache_states
),
462 TRACE_EVENT(rxrpc_call
,
463 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_call_trace op
,
464 int usage
, const void *where
, const void *aux
),
466 TP_ARGS(call
, op
, usage
, where
, aux
),
469 __field(struct rxrpc_call
*, call
)
472 __field(const void *, where
)
473 __field(const void *, aux
)
477 __entry
->call
= call
;
479 __entry
->usage
= usage
;
480 __entry
->where
= where
;
484 TP_printk("c=%p %s u=%d sp=%pSR a=%p",
486 __print_symbolic(__entry
->op
, rxrpc_call_traces
),
492 TRACE_EVENT(rxrpc_skb
,
493 TP_PROTO(struct sk_buff
*skb
, enum rxrpc_skb_trace op
,
494 int usage
, int mod_count
, const void *where
),
496 TP_ARGS(skb
, op
, usage
, mod_count
, where
),
499 __field(struct sk_buff
*, skb
)
500 __field(enum rxrpc_skb_trace
, op
)
502 __field(int, mod_count
)
503 __field(const void *, where
)
509 __entry
->usage
= usage
;
510 __entry
->mod_count
= mod_count
;
511 __entry
->where
= where
;
514 TP_printk("s=%p %s u=%d m=%d p=%pSR",
516 __print_symbolic(__entry
->op
, rxrpc_skb_traces
),
522 TRACE_EVENT(rxrpc_rx_packet
,
523 TP_PROTO(struct rxrpc_skb_priv
*sp
),
528 __field_struct(struct rxrpc_host_header
, hdr
)
532 memcpy(&__entry
->hdr
, &sp
->hdr
, sizeof(__entry
->hdr
));
535 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
536 __entry
->hdr
.epoch
, __entry
->hdr
.cid
,
537 __entry
->hdr
.callNumber
, __entry
->hdr
.serviceId
,
538 __entry
->hdr
.serial
, __entry
->hdr
.seq
,
539 __entry
->hdr
.type
, __entry
->hdr
.flags
,
540 __entry
->hdr
.type
<= 15 ?
541 __print_symbolic(__entry
->hdr
.type
, rxrpc_pkts
) : "?UNK")
544 TRACE_EVENT(rxrpc_rx_done
,
545 TP_PROTO(int result
, int abort_code
),
547 TP_ARGS(result
, abort_code
),
550 __field(int, result
)
551 __field(int, abort_code
)
555 __entry
->result
= result
;
556 __entry
->abort_code
= abort_code
;
559 TP_printk("r=%d a=%d", __entry
->result
, __entry
->abort_code
)
562 TRACE_EVENT(rxrpc_abort
,
563 TP_PROTO(const char *why
, u32 cid
, u32 call_id
, rxrpc_seq_t seq
,
564 int abort_code
, int error
),
566 TP_ARGS(why
, cid
, call_id
, seq
, abort_code
, error
),
569 __array(char, why
, 4 )
571 __field(u32
, call_id
)
572 __field(rxrpc_seq_t
, seq
)
573 __field(int, abort_code
)
578 memcpy(__entry
->why
, why
, 4);
580 __entry
->call_id
= call_id
;
581 __entry
->abort_code
= abort_code
;
582 __entry
->error
= error
;
586 TP_printk("%08x:%08x s=%u a=%d e=%d %s",
587 __entry
->cid
, __entry
->call_id
, __entry
->seq
,
588 __entry
->abort_code
, __entry
->error
, __entry
->why
)
591 TRACE_EVENT(rxrpc_transmit
,
592 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_transmit_trace why
),
597 __field(struct rxrpc_call
*, call
)
598 __field(enum rxrpc_transmit_trace
, why
)
599 __field(rxrpc_seq_t
, tx_hard_ack
)
600 __field(rxrpc_seq_t
, tx_top
)
601 __field(int, tx_winsize
)
605 __entry
->call
= call
;
607 __entry
->tx_hard_ack
= call
->tx_hard_ack
;
608 __entry
->tx_top
= call
->tx_top
;
609 __entry
->tx_winsize
= call
->tx_winsize
;
612 TP_printk("c=%p %s f=%08x n=%u/%u",
614 __print_symbolic(__entry
->why
, rxrpc_transmit_traces
),
615 __entry
->tx_hard_ack
+ 1,
616 __entry
->tx_top
- __entry
->tx_hard_ack
,
620 TRACE_EVENT(rxrpc_rx_data
,
621 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
,
622 rxrpc_serial_t serial
, u8 flags
, u8 anno
),
624 TP_ARGS(call
, seq
, serial
, flags
, anno
),
627 __field(struct rxrpc_call
*, call
)
628 __field(rxrpc_seq_t
, seq
)
629 __field(rxrpc_serial_t
, serial
)
635 __entry
->call
= call
;
637 __entry
->serial
= serial
;
638 __entry
->flags
= flags
;
639 __entry
->anno
= anno
;
642 TP_printk("c=%p DATA %08x q=%08x fl=%02x a=%02x",
650 TRACE_EVENT(rxrpc_rx_ack
,
651 TP_PROTO(struct rxrpc_call
*call
,
652 rxrpc_serial_t serial
, rxrpc_serial_t ack_serial
,
653 rxrpc_seq_t first
, rxrpc_seq_t prev
, u8 reason
, u8 n_acks
),
655 TP_ARGS(call
, serial
, ack_serial
, first
, prev
, reason
, n_acks
),
658 __field(struct rxrpc_call
*, call
)
659 __field(rxrpc_serial_t
, serial
)
660 __field(rxrpc_serial_t
, ack_serial
)
661 __field(rxrpc_seq_t
, first
)
662 __field(rxrpc_seq_t
, prev
)
668 __entry
->call
= call
;
669 __entry
->serial
= serial
;
670 __entry
->ack_serial
= ack_serial
;
671 __entry
->first
= first
;
672 __entry
->prev
= prev
;
673 __entry
->reason
= reason
;
674 __entry
->n_acks
= n_acks
;
677 TP_printk("c=%p %08x %s r=%08x f=%08x p=%08x n=%u",
680 __print_symbolic(__entry
->reason
, rxrpc_ack_names
),
687 TRACE_EVENT(rxrpc_rx_abort
,
688 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
691 TP_ARGS(call
, serial
, abort_code
),
694 __field(struct rxrpc_call
*, call
)
695 __field(rxrpc_serial_t
, serial
)
696 __field(u32
, abort_code
)
700 __entry
->call
= call
;
701 __entry
->serial
= serial
;
702 __entry
->abort_code
= abort_code
;
705 TP_printk("c=%p ABORT %08x ac=%d",
711 TRACE_EVENT(rxrpc_rx_rwind_change
,
712 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
713 u32 rwind
, bool wake
),
715 TP_ARGS(call
, serial
, rwind
, wake
),
718 __field(struct rxrpc_call
*, call
)
719 __field(rxrpc_serial_t
, serial
)
725 __entry
->call
= call
;
726 __entry
->serial
= serial
;
727 __entry
->rwind
= rwind
;
728 __entry
->wake
= wake
;
731 TP_printk("c=%p %08x rw=%u%s",
735 __entry
->wake
? " wake" : "")
738 TRACE_EVENT(rxrpc_tx_data
,
739 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
,
740 rxrpc_serial_t serial
, u8 flags
, bool retrans
, bool lose
),
742 TP_ARGS(call
, seq
, serial
, flags
, retrans
, lose
),
745 __field(struct rxrpc_call
*, call
)
746 __field(rxrpc_seq_t
, seq
)
747 __field(rxrpc_serial_t
, serial
)
749 __field(bool, retrans
)
754 __entry
->call
= call
;
756 __entry
->serial
= serial
;
757 __entry
->flags
= flags
;
758 __entry
->retrans
= retrans
;
759 __entry
->lose
= lose
;
762 TP_printk("c=%p DATA %08x q=%08x fl=%02x%s%s",
767 __entry
->retrans
? " *RETRANS*" : "",
768 __entry
->lose
? " *LOSE*" : "")
771 TRACE_EVENT(rxrpc_tx_ack
,
772 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
773 rxrpc_seq_t ack_first
, rxrpc_serial_t ack_serial
,
774 u8 reason
, u8 n_acks
),
776 TP_ARGS(call
, serial
, ack_first
, ack_serial
, reason
, n_acks
),
779 __field(struct rxrpc_call
*, call
)
780 __field(rxrpc_serial_t
, serial
)
781 __field(rxrpc_seq_t
, ack_first
)
782 __field(rxrpc_serial_t
, ack_serial
)
788 __entry
->call
= call
;
789 __entry
->serial
= serial
;
790 __entry
->ack_first
= ack_first
;
791 __entry
->ack_serial
= ack_serial
;
792 __entry
->reason
= reason
;
793 __entry
->n_acks
= n_acks
;
796 TP_printk(" c=%p ACK %08x %s f=%08x r=%08x n=%u",
799 __print_symbolic(__entry
->reason
, rxrpc_ack_names
),
805 TRACE_EVENT(rxrpc_receive
,
806 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_receive_trace why
,
807 rxrpc_serial_t serial
, rxrpc_seq_t seq
),
809 TP_ARGS(call
, why
, serial
, seq
),
812 __field(struct rxrpc_call
*, call
)
813 __field(enum rxrpc_receive_trace
, why
)
814 __field(rxrpc_serial_t
, serial
)
815 __field(rxrpc_seq_t
, seq
)
816 __field(rxrpc_seq_t
, hard_ack
)
817 __field(rxrpc_seq_t
, top
)
821 __entry
->call
= call
;
823 __entry
->serial
= serial
;
825 __entry
->hard_ack
= call
->rx_hard_ack
;
826 __entry
->top
= call
->rx_top
;
829 TP_printk("c=%p %s r=%08x q=%08x w=%08x-%08x",
831 __print_symbolic(__entry
->why
, rxrpc_receive_traces
),
838 TRACE_EVENT(rxrpc_recvmsg
,
839 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_recvmsg_trace why
,
840 rxrpc_seq_t seq
, unsigned int offset
, unsigned int len
,
843 TP_ARGS(call
, why
, seq
, offset
, len
, ret
),
846 __field(struct rxrpc_call
*, call
)
847 __field(enum rxrpc_recvmsg_trace
, why
)
848 __field(rxrpc_seq_t
, seq
)
849 __field(unsigned int, offset
)
850 __field(unsigned int, len
)
855 __entry
->call
= call
;
858 __entry
->offset
= offset
;
863 TP_printk("c=%p %s q=%08x o=%u l=%u ret=%d",
865 __print_symbolic(__entry
->why
, rxrpc_recvmsg_traces
),
872 TRACE_EVENT(rxrpc_rtt_tx
,
873 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_rtt_tx_trace why
,
874 rxrpc_serial_t send_serial
),
876 TP_ARGS(call
, why
, send_serial
),
879 __field(struct rxrpc_call
*, call
)
880 __field(enum rxrpc_rtt_tx_trace
, why
)
881 __field(rxrpc_serial_t
, send_serial
)
885 __entry
->call
= call
;
887 __entry
->send_serial
= send_serial
;
890 TP_printk("c=%p %s sr=%08x",
892 __print_symbolic(__entry
->why
, rxrpc_rtt_tx_traces
),
893 __entry
->send_serial
)
896 TRACE_EVENT(rxrpc_rtt_rx
,
897 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_rtt_rx_trace why
,
898 rxrpc_serial_t send_serial
, rxrpc_serial_t resp_serial
,
899 s64 rtt
, u8 nr
, s64 avg
),
901 TP_ARGS(call
, why
, send_serial
, resp_serial
, rtt
, nr
, avg
),
904 __field(struct rxrpc_call
*, call
)
905 __field(enum rxrpc_rtt_rx_trace
, why
)
907 __field(rxrpc_serial_t
, send_serial
)
908 __field(rxrpc_serial_t
, resp_serial
)
914 __entry
->call
= call
;
916 __entry
->send_serial
= send_serial
;
917 __entry
->resp_serial
= resp_serial
;
923 TP_printk("c=%p %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
925 __print_symbolic(__entry
->why
, rxrpc_rtt_rx_traces
),
926 __entry
->send_serial
,
927 __entry
->resp_serial
,
933 TRACE_EVENT(rxrpc_timer
,
934 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_timer_trace why
,
935 ktime_t now
, unsigned long now_j
),
937 TP_ARGS(call
, why
, now
, now_j
),
940 __field(struct rxrpc_call
*, call
)
941 __field(enum rxrpc_timer_trace
, why
)
942 __field_struct(ktime_t
, now
)
943 __field_struct(ktime_t
, expire_at
)
944 __field_struct(ktime_t
, ack_at
)
945 __field_struct(ktime_t
, resend_at
)
946 __field(unsigned long, now_j
)
947 __field(unsigned long, timer
)
951 __entry
->call
= call
;
954 __entry
->expire_at
= call
->expire_at
;
955 __entry
->ack_at
= call
->ack_at
;
956 __entry
->resend_at
= call
->resend_at
;
957 __entry
->now_j
= now_j
;
958 __entry
->timer
= call
->timer
.expires
;
961 TP_printk("c=%p %s x=%lld a=%lld r=%lld t=%ld",
963 __print_symbolic(__entry
->why
, rxrpc_timer_traces
),
964 ktime_to_ns(ktime_sub(__entry
->expire_at
, __entry
->now
)),
965 ktime_to_ns(ktime_sub(__entry
->ack_at
, __entry
->now
)),
966 ktime_to_ns(ktime_sub(__entry
->resend_at
, __entry
->now
)),
967 __entry
->timer
- __entry
->now_j
)
970 TRACE_EVENT(rxrpc_rx_lose
,
971 TP_PROTO(struct rxrpc_skb_priv
*sp
),
976 __field_struct(struct rxrpc_host_header
, hdr
)
980 memcpy(&__entry
->hdr
, &sp
->hdr
, sizeof(__entry
->hdr
));
983 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
984 __entry
->hdr
.epoch
, __entry
->hdr
.cid
,
985 __entry
->hdr
.callNumber
, __entry
->hdr
.serviceId
,
986 __entry
->hdr
.serial
, __entry
->hdr
.seq
,
987 __entry
->hdr
.type
, __entry
->hdr
.flags
,
988 __entry
->hdr
.type
<= 15 ?
989 __print_symbolic(__entry
->hdr
.type
, rxrpc_pkts
) : "?UNK")
992 TRACE_EVENT(rxrpc_propose_ack
,
993 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_propose_ack_trace why
,
994 u8 ack_reason
, rxrpc_serial_t serial
, bool immediate
,
995 bool background
, enum rxrpc_propose_ack_outcome outcome
),
997 TP_ARGS(call
, why
, ack_reason
, serial
, immediate
, background
,
1001 __field(struct rxrpc_call
*, call
)
1002 __field(enum rxrpc_propose_ack_trace
, why
)
1003 __field(rxrpc_serial_t
, serial
)
1004 __field(u8
, ack_reason
)
1005 __field(bool, immediate
)
1006 __field(bool, background
)
1007 __field(enum rxrpc_propose_ack_outcome
, outcome
)
1011 __entry
->call
= call
;
1013 __entry
->serial
= serial
;
1014 __entry
->ack_reason
= ack_reason
;
1015 __entry
->immediate
= immediate
;
1016 __entry
->background
= background
;
1017 __entry
->outcome
= outcome
;
1020 TP_printk("c=%p %s %s r=%08x i=%u b=%u%s",
1022 __print_symbolic(__entry
->why
, rxrpc_propose_ack_traces
),
1023 __print_symbolic(__entry
->ack_reason
, rxrpc_ack_names
),
1026 __entry
->background
,
1027 __print_symbolic(__entry
->outcome
, rxrpc_propose_ack_outcomes
))
1030 TRACE_EVENT(rxrpc_retransmit
,
1031 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
, u8 annotation
,
1034 TP_ARGS(call
, seq
, annotation
, expiry
),
1037 __field(struct rxrpc_call
*, call
)
1038 __field(rxrpc_seq_t
, seq
)
1039 __field(u8
, annotation
)
1040 __field(s64
, expiry
)
1044 __entry
->call
= call
;
1046 __entry
->annotation
= annotation
;
1047 __entry
->expiry
= expiry
;
1050 TP_printk("c=%p q=%x a=%02x xp=%lld",
1053 __entry
->annotation
,
1057 TRACE_EVENT(rxrpc_congest
,
1058 TP_PROTO(struct rxrpc_call
*call
, struct rxrpc_ack_summary
*summary
,
1059 rxrpc_serial_t ack_serial
, enum rxrpc_congest_change change
),
1061 TP_ARGS(call
, summary
, ack_serial
, change
),
1064 __field(struct rxrpc_call
*, call
)
1065 __field(enum rxrpc_congest_change
, change
)
1066 __field(rxrpc_seq_t
, hard_ack
)
1067 __field(rxrpc_seq_t
, top
)
1068 __field(rxrpc_seq_t
, lowest_nak
)
1069 __field(rxrpc_serial_t
, ack_serial
)
1070 __field_struct(struct rxrpc_ack_summary
, sum
)
1074 __entry
->call
= call
;
1075 __entry
->change
= change
;
1076 __entry
->hard_ack
= call
->tx_hard_ack
;
1077 __entry
->top
= call
->tx_top
;
1078 __entry
->lowest_nak
= call
->acks_lowest_nak
;
1079 __entry
->ack_serial
= ack_serial
;
1080 memcpy(&__entry
->sum
, summary
, sizeof(__entry
->sum
));
1083 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",
1085 __entry
->ack_serial
,
1086 __print_symbolic(__entry
->sum
.ack_reason
, rxrpc_ack_names
),
1088 __print_symbolic(__entry
->sum
.mode
, rxrpc_congest_modes
),
1090 __entry
->sum
.ssthresh
,
1091 __entry
->sum
.nr_acks
, __entry
->sum
.nr_nacks
,
1092 __entry
->sum
.nr_new_acks
, __entry
->sum
.nr_new_nacks
,
1093 __entry
->sum
.nr_rot_new_acks
,
1094 __entry
->top
- __entry
->hard_ack
,
1095 __entry
->sum
.cumulative_acks
,
1096 __entry
->sum
.dup_acks
,
1097 __entry
->lowest_nak
, __entry
->sum
.new_low_nack
? "!" : "",
1098 __print_symbolic(__entry
->change
, rxrpc_congest_changes
),
1099 __entry
->sum
.retrans_timeo
? " rTxTo" : "")
1102 TRACE_EVENT(rxrpc_disconnect_call
,
1103 TP_PROTO(struct rxrpc_call
*call
),
1108 __field(struct rxrpc_call
*, call
)
1109 __field(u32
, abort_code
)
1113 __entry
->call
= call
;
1114 __entry
->abort_code
= call
->abort_code
;
1117 TP_printk("c=%p ab=%08x",
1119 __entry
->abort_code
)
1122 TRACE_EVENT(rxrpc_improper_term
,
1123 TP_PROTO(struct rxrpc_call
*call
),
1128 __field(struct rxrpc_call
*, call
)
1129 __field(u32
, abort_code
)
1133 __entry
->call
= call
;
1134 __entry
->abort_code
= call
->abort_code
;
1137 TP_printk("c=%p ab=%08x",
1139 __entry
->abort_code
)
1142 TRACE_EVENT(rxrpc_rx_eproto
,
1143 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
1146 TP_ARGS(call
, serial
, why
),
1149 __field(struct rxrpc_call
*, call
)
1150 __field(rxrpc_serial_t
, serial
)
1151 __field(const char *, why
)
1155 __entry
->call
= call
;
1156 __entry
->serial
= serial
;
1160 TP_printk("c=%p EPROTO %08x %s",
1166 TRACE_EVENT(rxrpc_connect_call
,
1167 TP_PROTO(struct rxrpc_call
*call
),
1172 __field(struct rxrpc_call
*, call
)
1173 __field(unsigned long, user_call_ID
)
1175 __field(u32
, call_id
)
1179 __entry
->call
= call
;
1180 __entry
->user_call_ID
= call
->user_call_ID
;
1181 __entry
->cid
= call
->cid
;
1182 __entry
->call_id
= call
->call_id
;
1185 TP_printk("c=%p u=%p %08x:%08x",
1187 (void *)__entry
->user_call_ID
,
1192 #endif /* _TRACE_RXRPC_H */
1194 /* This part must be outside protection */
1195 #include <trace/define_trace.h>