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
,
52 rxrpc_conn_reap_service
,
56 enum rxrpc_client_trace
{
57 rxrpc_client_activate_chans
,
59 rxrpc_client_chan_activate
,
60 rxrpc_client_chan_disconnect
,
61 rxrpc_client_chan_pass
,
62 rxrpc_client_chan_unstarted
,
66 rxrpc_client_duplicate
,
69 rxrpc_client_to_active
,
70 rxrpc_client_to_culled
,
72 rxrpc_client_to_inactive
,
73 rxrpc_client_to_upgrade
,
74 rxrpc_client_to_waiting
,
78 enum rxrpc_call_trace
{
82 rxrpc_call_got_kernel
,
83 rxrpc_call_got_userid
,
84 rxrpc_call_new_client
,
85 rxrpc_call_new_service
,
87 rxrpc_call_put_kernel
,
88 rxrpc_call_put_noqueue
,
89 rxrpc_call_put_userid
,
91 rxrpc_call_queued_ref
,
96 enum rxrpc_transmit_trace
{
97 rxrpc_transmit_await_reply
,
100 rxrpc_transmit_queue_last
,
101 rxrpc_transmit_rotate
,
102 rxrpc_transmit_rotate_last
,
106 enum rxrpc_receive_trace
{
109 rxrpc_receive_incoming
,
111 rxrpc_receive_queue_last
,
112 rxrpc_receive_rotate
,
115 enum rxrpc_recvmsg_trace
{
117 rxrpc_recvmsg_data_return
,
118 rxrpc_recvmsg_dequeue
,
123 rxrpc_recvmsg_requeue
,
124 rxrpc_recvmsg_return
,
125 rxrpc_recvmsg_terminal
,
126 rxrpc_recvmsg_to_be_accepted
,
130 enum rxrpc_rtt_tx_trace
{
135 enum rxrpc_rtt_rx_trace
{
136 rxrpc_rtt_rx_ping_response
,
137 rxrpc_rtt_rx_requested_ack
,
140 enum rxrpc_timer_trace
{
143 rxrpc_timer_exp_hard
,
144 rxrpc_timer_exp_idle
,
145 rxrpc_timer_exp_keepalive
,
146 rxrpc_timer_exp_lost_ack
,
147 rxrpc_timer_exp_normal
,
148 rxrpc_timer_exp_ping
,
149 rxrpc_timer_exp_resend
,
151 rxrpc_timer_init_for_reply
,
152 rxrpc_timer_init_for_send_reply
,
154 rxrpc_timer_set_for_ack
,
155 rxrpc_timer_set_for_hard
,
156 rxrpc_timer_set_for_idle
,
157 rxrpc_timer_set_for_keepalive
,
158 rxrpc_timer_set_for_lost_ack
,
159 rxrpc_timer_set_for_normal
,
160 rxrpc_timer_set_for_ping
,
161 rxrpc_timer_set_for_resend
,
162 rxrpc_timer_set_for_send
,
165 enum rxrpc_propose_ack_trace
{
166 rxrpc_propose_ack_client_tx_end
,
167 rxrpc_propose_ack_input_data
,
168 rxrpc_propose_ack_ping_for_keepalive
,
169 rxrpc_propose_ack_ping_for_lost_ack
,
170 rxrpc_propose_ack_ping_for_lost_reply
,
171 rxrpc_propose_ack_ping_for_params
,
172 rxrpc_propose_ack_processing_op
,
173 rxrpc_propose_ack_respond_to_ack
,
174 rxrpc_propose_ack_respond_to_ping
,
175 rxrpc_propose_ack_retry_tx
,
176 rxrpc_propose_ack_rotate_rx
,
177 rxrpc_propose_ack_terminal_ack
,
180 enum rxrpc_propose_ack_outcome
{
181 rxrpc_propose_ack_subsume
,
182 rxrpc_propose_ack_update
,
183 rxrpc_propose_ack_use
,
186 enum rxrpc_congest_change
{
187 rxrpc_cong_begin_retransmission
,
188 rxrpc_cong_cleared_nacks
,
189 rxrpc_cong_new_low_nack
,
190 rxrpc_cong_no_change
,
192 rxrpc_cong_retransmit_again
,
193 rxrpc_cong_rtt_window_end
,
197 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
200 * Declare tracing information enums and their string mappings for display.
202 #define rxrpc_skb_traces \
203 EM(rxrpc_skb_rx_cleaned, "Rx CLN") \
204 EM(rxrpc_skb_rx_freed, "Rx FRE") \
205 EM(rxrpc_skb_rx_got, "Rx GOT") \
206 EM(rxrpc_skb_rx_lost, "Rx *L*") \
207 EM(rxrpc_skb_rx_purged, "Rx PUR") \
208 EM(rxrpc_skb_rx_received, "Rx RCV") \
209 EM(rxrpc_skb_rx_rotated, "Rx ROT") \
210 EM(rxrpc_skb_rx_seen, "Rx SEE") \
211 EM(rxrpc_skb_tx_cleaned, "Tx CLN") \
212 EM(rxrpc_skb_tx_freed, "Tx FRE") \
213 EM(rxrpc_skb_tx_got, "Tx GOT") \
214 EM(rxrpc_skb_tx_new, "Tx NEW") \
215 EM(rxrpc_skb_tx_rotated, "Tx ROT") \
216 E_(rxrpc_skb_tx_seen, "Tx SEE")
218 #define rxrpc_conn_traces \
219 EM(rxrpc_conn_got, "GOT") \
220 EM(rxrpc_conn_new_client, "NWc") \
221 EM(rxrpc_conn_new_service, "NWs") \
222 EM(rxrpc_conn_put_client, "PTc") \
223 EM(rxrpc_conn_put_service, "PTs") \
224 EM(rxrpc_conn_queued, "QUE") \
225 EM(rxrpc_conn_reap_service, "RPs") \
226 E_(rxrpc_conn_seen, "SEE")
228 #define rxrpc_client_traces \
229 EM(rxrpc_client_activate_chans, "Activa") \
230 EM(rxrpc_client_alloc, "Alloc ") \
231 EM(rxrpc_client_chan_activate, "ChActv") \
232 EM(rxrpc_client_chan_disconnect, "ChDisc") \
233 EM(rxrpc_client_chan_pass, "ChPass") \
234 EM(rxrpc_client_chan_unstarted, "ChUnst") \
235 EM(rxrpc_client_cleanup, "Clean ") \
236 EM(rxrpc_client_count, "Count ") \
237 EM(rxrpc_client_discard, "Discar") \
238 EM(rxrpc_client_duplicate, "Duplic") \
239 EM(rxrpc_client_exposed, "Expose") \
240 EM(rxrpc_client_replace, "Replac") \
241 EM(rxrpc_client_to_active, "->Actv") \
242 EM(rxrpc_client_to_culled, "->Cull") \
243 EM(rxrpc_client_to_idle, "->Idle") \
244 EM(rxrpc_client_to_inactive, "->Inac") \
245 EM(rxrpc_client_to_upgrade, "->Upgd") \
246 EM(rxrpc_client_to_waiting, "->Wait") \
247 E_(rxrpc_client_uncount, "Uncoun")
249 #define rxrpc_conn_cache_states \
250 EM(RXRPC_CONN_CLIENT_INACTIVE, "Inac") \
251 EM(RXRPC_CONN_CLIENT_WAITING, "Wait") \
252 EM(RXRPC_CONN_CLIENT_ACTIVE, "Actv") \
253 EM(RXRPC_CONN_CLIENT_UPGRADE, "Upgd") \
254 EM(RXRPC_CONN_CLIENT_CULLED, "Cull") \
255 E_(RXRPC_CONN_CLIENT_IDLE, "Idle") \
257 #define rxrpc_call_traces \
258 EM(rxrpc_call_connected, "CON") \
259 EM(rxrpc_call_error, "*E*") \
260 EM(rxrpc_call_got, "GOT") \
261 EM(rxrpc_call_got_kernel, "Gke") \
262 EM(rxrpc_call_got_userid, "Gus") \
263 EM(rxrpc_call_new_client, "NWc") \
264 EM(rxrpc_call_new_service, "NWs") \
265 EM(rxrpc_call_put, "PUT") \
266 EM(rxrpc_call_put_kernel, "Pke") \
267 EM(rxrpc_call_put_noqueue, "PNQ") \
268 EM(rxrpc_call_put_userid, "Pus") \
269 EM(rxrpc_call_queued, "QUE") \
270 EM(rxrpc_call_queued_ref, "QUR") \
271 EM(rxrpc_call_release, "RLS") \
272 E_(rxrpc_call_seen, "SEE")
274 #define rxrpc_transmit_traces \
275 EM(rxrpc_transmit_await_reply, "AWR") \
276 EM(rxrpc_transmit_end, "END") \
277 EM(rxrpc_transmit_queue, "QUE") \
278 EM(rxrpc_transmit_queue_last, "QLS") \
279 EM(rxrpc_transmit_rotate, "ROT") \
280 EM(rxrpc_transmit_rotate_last, "RLS") \
281 E_(rxrpc_transmit_wait, "WAI")
283 #define rxrpc_receive_traces \
284 EM(rxrpc_receive_end, "END") \
285 EM(rxrpc_receive_front, "FRN") \
286 EM(rxrpc_receive_incoming, "INC") \
287 EM(rxrpc_receive_queue, "QUE") \
288 EM(rxrpc_receive_queue_last, "QLS") \
289 E_(rxrpc_receive_rotate, "ROT")
291 #define rxrpc_recvmsg_traces \
292 EM(rxrpc_recvmsg_cont, "CONT") \
293 EM(rxrpc_recvmsg_data_return, "DATA") \
294 EM(rxrpc_recvmsg_dequeue, "DEQU") \
295 EM(rxrpc_recvmsg_enter, "ENTR") \
296 EM(rxrpc_recvmsg_full, "FULL") \
297 EM(rxrpc_recvmsg_hole, "HOLE") \
298 EM(rxrpc_recvmsg_next, "NEXT") \
299 EM(rxrpc_recvmsg_requeue, "REQU") \
300 EM(rxrpc_recvmsg_return, "RETN") \
301 EM(rxrpc_recvmsg_terminal, "TERM") \
302 EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \
303 E_(rxrpc_recvmsg_wait, "WAIT")
305 #define rxrpc_rtt_tx_traces \
306 EM(rxrpc_rtt_tx_data, "DATA") \
307 E_(rxrpc_rtt_tx_ping, "PING")
309 #define rxrpc_rtt_rx_traces \
310 EM(rxrpc_rtt_rx_ping_response, "PONG") \
311 E_(rxrpc_rtt_rx_requested_ack, "RACK")
313 #define rxrpc_timer_traces \
314 EM(rxrpc_timer_begin, "Begin ") \
315 EM(rxrpc_timer_expired, "*EXPR*") \
316 EM(rxrpc_timer_exp_ack, "ExpAck") \
317 EM(rxrpc_timer_exp_hard, "ExpHrd") \
318 EM(rxrpc_timer_exp_idle, "ExpIdl") \
319 EM(rxrpc_timer_exp_keepalive, "ExpKA ") \
320 EM(rxrpc_timer_exp_lost_ack, "ExpLoA") \
321 EM(rxrpc_timer_exp_normal, "ExpNml") \
322 EM(rxrpc_timer_exp_ping, "ExpPng") \
323 EM(rxrpc_timer_exp_resend, "ExpRsn") \
324 EM(rxrpc_timer_init_for_reply, "IniRpl") \
325 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
326 EM(rxrpc_timer_restart, "Restrt") \
327 EM(rxrpc_timer_set_for_ack, "SetAck") \
328 EM(rxrpc_timer_set_for_hard, "SetHrd") \
329 EM(rxrpc_timer_set_for_idle, "SetIdl") \
330 EM(rxrpc_timer_set_for_keepalive, "KeepAl") \
331 EM(rxrpc_timer_set_for_lost_ack, "SetLoA") \
332 EM(rxrpc_timer_set_for_normal, "SetNml") \
333 EM(rxrpc_timer_set_for_ping, "SetPng") \
334 EM(rxrpc_timer_set_for_resend, "SetRTx") \
335 E_(rxrpc_timer_set_for_send, "SetSnd")
337 #define rxrpc_propose_ack_traces \
338 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
339 EM(rxrpc_propose_ack_input_data, "DataIn ") \
340 EM(rxrpc_propose_ack_ping_for_keepalive, "KeepAlv") \
341 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
342 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
343 EM(rxrpc_propose_ack_ping_for_params, "Params ") \
344 EM(rxrpc_propose_ack_processing_op, "ProcOp ") \
345 EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \
346 EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \
347 EM(rxrpc_propose_ack_retry_tx, "RetryTx") \
348 EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \
349 E_(rxrpc_propose_ack_terminal_ack, "ClTerm ")
351 #define rxrpc_propose_ack_outcomes \
352 EM(rxrpc_propose_ack_subsume, " Subsume") \
353 EM(rxrpc_propose_ack_update, " Update") \
354 E_(rxrpc_propose_ack_use, "")
356 #define rxrpc_congest_modes \
357 EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \
358 EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \
359 EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \
360 E_(RXRPC_CALL_SLOW_START, "SlowStart")
362 #define rxrpc_congest_changes \
363 EM(rxrpc_cong_begin_retransmission, " Retrans") \
364 EM(rxrpc_cong_cleared_nacks, " Cleared") \
365 EM(rxrpc_cong_new_low_nack, " NewLowN") \
366 EM(rxrpc_cong_no_change, "") \
367 EM(rxrpc_cong_progress, " Progres") \
368 EM(rxrpc_cong_retransmit_again, " ReTxAgn") \
369 EM(rxrpc_cong_rtt_window_end, " RttWinE") \
370 E_(rxrpc_cong_saw_nack, " SawNack")
374 EM(RXRPC_PACKET_TYPE_DATA, "DATA") \
375 EM(RXRPC_PACKET_TYPE_ACK, "ACK") \
376 EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \
377 EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \
378 EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \
379 EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \
380 EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \
381 EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \
386 EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \
390 #define rxrpc_ack_names \
392 EM(RXRPC_ACK_REQUESTED, "REQ") \
393 EM(RXRPC_ACK_DUPLICATE, "DUP") \
394 EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \
395 EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \
396 EM(RXRPC_ACK_NOSPACE, "MEM") \
397 EM(RXRPC_ACK_PING, "PNG") \
398 EM(RXRPC_ACK_PING_RESPONSE, "PNR") \
399 EM(RXRPC_ACK_DELAY, "DLY") \
400 EM(RXRPC_ACK_IDLE, "IDL") \
401 E_(RXRPC_ACK__INVALID, "-?-")
404 * Export enum symbols via userspace.
408 #define EM(a, b) TRACE_DEFINE_ENUM(a);
409 #define E_(a, b) TRACE_DEFINE_ENUM(a);
415 rxrpc_transmit_traces
;
416 rxrpc_receive_traces
;
417 rxrpc_recvmsg_traces
;
421 rxrpc_propose_ack_traces
;
422 rxrpc_propose_ack_outcomes
;
424 rxrpc_congest_changes
;
427 * Now redefine the EM() and E_() macros to map the enums to the strings that
428 * will be printed in the output.
432 #define EM(a, b) { a, b },
433 #define E_(a, b) { a, b }
435 TRACE_EVENT(rxrpc_conn
,
436 TP_PROTO(struct rxrpc_connection
*conn
, enum rxrpc_conn_trace op
,
437 int usage
, const void *where
),
439 TP_ARGS(conn
, op
, usage
, where
),
442 __field(unsigned int, conn
)
445 __field(const void *, where
)
449 __entry
->conn
= conn
->debug_id
;
451 __entry
->usage
= usage
;
452 __entry
->where
= where
;
455 TP_printk("C=%08x %s u=%d sp=%pSR",
457 __print_symbolic(__entry
->op
, rxrpc_conn_traces
),
462 TRACE_EVENT(rxrpc_client
,
463 TP_PROTO(struct rxrpc_connection
*conn
, int channel
,
464 enum rxrpc_client_trace op
),
466 TP_ARGS(conn
, channel
, op
),
469 __field(unsigned int, conn
)
471 __field(int, channel
)
473 __field(enum rxrpc_client_trace
, op
)
474 __field(enum rxrpc_conn_cache_state
, cs
)
478 __entry
->conn
= conn
->debug_id
;
479 __entry
->channel
= channel
;
480 __entry
->usage
= atomic_read(&conn
->usage
);
482 __entry
->cid
= conn
->proto
.cid
;
483 __entry
->cs
= conn
->cache_state
;
486 TP_printk("C=%08x h=%2d %s %s i=%08x u=%d",
489 __print_symbolic(__entry
->op
, rxrpc_client_traces
),
490 __print_symbolic(__entry
->cs
, rxrpc_conn_cache_states
),
495 TRACE_EVENT(rxrpc_call
,
496 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_call_trace op
,
497 int usage
, const void *where
, const void *aux
),
499 TP_ARGS(call
, op
, usage
, where
, aux
),
502 __field(unsigned int, call
)
505 __field(const void *, where
)
506 __field(const void *, aux
)
510 __entry
->call
= call
->debug_id
;
512 __entry
->usage
= usage
;
513 __entry
->where
= where
;
517 TP_printk("c=%08x %s u=%d sp=%pSR a=%p",
519 __print_symbolic(__entry
->op
, rxrpc_call_traces
),
525 TRACE_EVENT(rxrpc_skb
,
526 TP_PROTO(struct sk_buff
*skb
, enum rxrpc_skb_trace op
,
527 int usage
, int mod_count
, const void *where
),
529 TP_ARGS(skb
, op
, usage
, mod_count
, where
),
532 __field(struct sk_buff
*, skb
)
533 __field(enum rxrpc_skb_trace
, op
)
535 __field(int, mod_count
)
536 __field(const void *, where
)
542 __entry
->usage
= usage
;
543 __entry
->mod_count
= mod_count
;
544 __entry
->where
= where
;
547 TP_printk("s=%p %s u=%d m=%d p=%pSR",
549 __print_symbolic(__entry
->op
, rxrpc_skb_traces
),
555 TRACE_EVENT(rxrpc_rx_packet
,
556 TP_PROTO(struct rxrpc_skb_priv
*sp
),
561 __field_struct(struct rxrpc_host_header
, hdr
)
565 memcpy(&__entry
->hdr
, &sp
->hdr
, sizeof(__entry
->hdr
));
568 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
569 __entry
->hdr
.epoch
, __entry
->hdr
.cid
,
570 __entry
->hdr
.callNumber
, __entry
->hdr
.serviceId
,
571 __entry
->hdr
.serial
, __entry
->hdr
.seq
,
572 __entry
->hdr
.type
, __entry
->hdr
.flags
,
573 __entry
->hdr
.type
<= 15 ?
574 __print_symbolic(__entry
->hdr
.type
, rxrpc_pkts
) : "?UNK")
577 TRACE_EVENT(rxrpc_rx_done
,
578 TP_PROTO(int result
, int abort_code
),
580 TP_ARGS(result
, abort_code
),
583 __field(int, result
)
584 __field(int, abort_code
)
588 __entry
->result
= result
;
589 __entry
->abort_code
= abort_code
;
592 TP_printk("r=%d a=%d", __entry
->result
, __entry
->abort_code
)
595 TRACE_EVENT(rxrpc_abort
,
596 TP_PROTO(unsigned int call_nr
, const char *why
, u32 cid
, u32 call_id
,
597 rxrpc_seq_t seq
, int abort_code
, int error
),
599 TP_ARGS(call_nr
, why
, cid
, call_id
, seq
, abort_code
, error
),
602 __field(unsigned int, call_nr
)
603 __array(char, why
, 4 )
605 __field(u32
, call_id
)
606 __field(rxrpc_seq_t
, seq
)
607 __field(int, abort_code
)
612 memcpy(__entry
->why
, why
, 4);
613 __entry
->call_nr
= call_nr
;
615 __entry
->call_id
= call_id
;
616 __entry
->abort_code
= abort_code
;
617 __entry
->error
= error
;
621 TP_printk("c=%08x %08x:%08x s=%u a=%d e=%d %s",
623 __entry
->cid
, __entry
->call_id
, __entry
->seq
,
624 __entry
->abort_code
, __entry
->error
, __entry
->why
)
627 TRACE_EVENT(rxrpc_transmit
,
628 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_transmit_trace why
),
633 __field(unsigned int, call
)
634 __field(enum rxrpc_transmit_trace
, why
)
635 __field(rxrpc_seq_t
, tx_hard_ack
)
636 __field(rxrpc_seq_t
, tx_top
)
637 __field(int, tx_winsize
)
641 __entry
->call
= call
->debug_id
;
643 __entry
->tx_hard_ack
= call
->tx_hard_ack
;
644 __entry
->tx_top
= call
->tx_top
;
645 __entry
->tx_winsize
= call
->tx_winsize
;
648 TP_printk("c=%08x %s f=%08x n=%u/%u",
650 __print_symbolic(__entry
->why
, rxrpc_transmit_traces
),
651 __entry
->tx_hard_ack
+ 1,
652 __entry
->tx_top
- __entry
->tx_hard_ack
,
656 TRACE_EVENT(rxrpc_rx_data
,
657 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
,
658 rxrpc_serial_t serial
, u8 flags
, u8 anno
),
660 TP_ARGS(call
, seq
, serial
, flags
, anno
),
663 __field(unsigned int, call
)
664 __field(rxrpc_seq_t
, seq
)
665 __field(rxrpc_serial_t
, serial
)
671 __entry
->call
= call
->debug_id
;
673 __entry
->serial
= serial
;
674 __entry
->flags
= flags
;
675 __entry
->anno
= anno
;
678 TP_printk("c=%08x DATA %08x q=%08x fl=%02x a=%02x",
686 TRACE_EVENT(rxrpc_rx_ack
,
687 TP_PROTO(struct rxrpc_call
*call
,
688 rxrpc_serial_t serial
, rxrpc_serial_t ack_serial
,
689 rxrpc_seq_t first
, rxrpc_seq_t prev
, u8 reason
, u8 n_acks
),
691 TP_ARGS(call
, serial
, ack_serial
, first
, prev
, reason
, n_acks
),
694 __field(unsigned int, call
)
695 __field(rxrpc_serial_t
, serial
)
696 __field(rxrpc_serial_t
, ack_serial
)
697 __field(rxrpc_seq_t
, first
)
698 __field(rxrpc_seq_t
, prev
)
704 __entry
->call
= call
->debug_id
;
705 __entry
->serial
= serial
;
706 __entry
->ack_serial
= ack_serial
;
707 __entry
->first
= first
;
708 __entry
->prev
= prev
;
709 __entry
->reason
= reason
;
710 __entry
->n_acks
= n_acks
;
713 TP_printk("c=%08x %08x %s r=%08x f=%08x p=%08x n=%u",
716 __print_symbolic(__entry
->reason
, rxrpc_ack_names
),
723 TRACE_EVENT(rxrpc_rx_abort
,
724 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
727 TP_ARGS(call
, serial
, abort_code
),
730 __field(unsigned int, call
)
731 __field(rxrpc_serial_t
, serial
)
732 __field(u32
, abort_code
)
736 __entry
->call
= call
->debug_id
;
737 __entry
->serial
= serial
;
738 __entry
->abort_code
= abort_code
;
741 TP_printk("c=%08x ABORT %08x ac=%d",
747 TRACE_EVENT(rxrpc_rx_rwind_change
,
748 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
749 u32 rwind
, bool wake
),
751 TP_ARGS(call
, serial
, rwind
, wake
),
754 __field(unsigned int, call
)
755 __field(rxrpc_serial_t
, serial
)
761 __entry
->call
= call
->debug_id
;
762 __entry
->serial
= serial
;
763 __entry
->rwind
= rwind
;
764 __entry
->wake
= wake
;
767 TP_printk("c=%08x %08x rw=%u%s",
771 __entry
->wake
? " wake" : "")
774 TRACE_EVENT(rxrpc_tx_data
,
775 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
,
776 rxrpc_serial_t serial
, u8 flags
, bool retrans
, bool lose
),
778 TP_ARGS(call
, seq
, serial
, flags
, retrans
, lose
),
781 __field(unsigned int, call
)
782 __field(rxrpc_seq_t
, seq
)
783 __field(rxrpc_serial_t
, serial
)
785 __field(bool, retrans
)
790 __entry
->call
= call
->debug_id
;
792 __entry
->serial
= serial
;
793 __entry
->flags
= flags
;
794 __entry
->retrans
= retrans
;
795 __entry
->lose
= lose
;
798 TP_printk("c=%08x DATA %08x q=%08x fl=%02x%s%s",
803 __entry
->retrans
? " *RETRANS*" : "",
804 __entry
->lose
? " *LOSE*" : "")
807 TRACE_EVENT(rxrpc_tx_ack
,
808 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
809 rxrpc_seq_t ack_first
, rxrpc_serial_t ack_serial
,
810 u8 reason
, u8 n_acks
),
812 TP_ARGS(call
, serial
, ack_first
, ack_serial
, reason
, n_acks
),
815 __field(unsigned int, call
)
816 __field(rxrpc_serial_t
, serial
)
817 __field(rxrpc_seq_t
, ack_first
)
818 __field(rxrpc_serial_t
, ack_serial
)
824 __entry
->call
= call
? call
->debug_id
: 0;
825 __entry
->serial
= serial
;
826 __entry
->ack_first
= ack_first
;
827 __entry
->ack_serial
= ack_serial
;
828 __entry
->reason
= reason
;
829 __entry
->n_acks
= n_acks
;
832 TP_printk(" c=%08x ACK %08x %s f=%08x r=%08x n=%u",
835 __print_symbolic(__entry
->reason
, rxrpc_ack_names
),
841 TRACE_EVENT(rxrpc_receive
,
842 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_receive_trace why
,
843 rxrpc_serial_t serial
, rxrpc_seq_t seq
),
845 TP_ARGS(call
, why
, serial
, seq
),
848 __field(unsigned int, call
)
849 __field(enum rxrpc_receive_trace
, why
)
850 __field(rxrpc_serial_t
, serial
)
851 __field(rxrpc_seq_t
, seq
)
852 __field(rxrpc_seq_t
, hard_ack
)
853 __field(rxrpc_seq_t
, top
)
857 __entry
->call
= call
->debug_id
;
859 __entry
->serial
= serial
;
861 __entry
->hard_ack
= call
->rx_hard_ack
;
862 __entry
->top
= call
->rx_top
;
865 TP_printk("c=%08x %s r=%08x q=%08x w=%08x-%08x",
867 __print_symbolic(__entry
->why
, rxrpc_receive_traces
),
874 TRACE_EVENT(rxrpc_recvmsg
,
875 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_recvmsg_trace why
,
876 rxrpc_seq_t seq
, unsigned int offset
, unsigned int len
,
879 TP_ARGS(call
, why
, seq
, offset
, len
, ret
),
882 __field(unsigned int, call
)
883 __field(enum rxrpc_recvmsg_trace
, why
)
884 __field(rxrpc_seq_t
, seq
)
885 __field(unsigned int, offset
)
886 __field(unsigned int, len
)
891 __entry
->call
= call
->debug_id
;
894 __entry
->offset
= offset
;
899 TP_printk("c=%08x %s q=%08x o=%u l=%u ret=%d",
901 __print_symbolic(__entry
->why
, rxrpc_recvmsg_traces
),
908 TRACE_EVENT(rxrpc_rtt_tx
,
909 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_rtt_tx_trace why
,
910 rxrpc_serial_t send_serial
),
912 TP_ARGS(call
, why
, send_serial
),
915 __field(unsigned int, call
)
916 __field(enum rxrpc_rtt_tx_trace
, why
)
917 __field(rxrpc_serial_t
, send_serial
)
921 __entry
->call
= call
->debug_id
;
923 __entry
->send_serial
= send_serial
;
926 TP_printk("c=%08x %s sr=%08x",
928 __print_symbolic(__entry
->why
, rxrpc_rtt_tx_traces
),
929 __entry
->send_serial
)
932 TRACE_EVENT(rxrpc_rtt_rx
,
933 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_rtt_rx_trace why
,
934 rxrpc_serial_t send_serial
, rxrpc_serial_t resp_serial
,
935 s64 rtt
, u8 nr
, s64 avg
),
937 TP_ARGS(call
, why
, send_serial
, resp_serial
, rtt
, nr
, avg
),
940 __field(unsigned int, call
)
941 __field(enum rxrpc_rtt_rx_trace
, why
)
943 __field(rxrpc_serial_t
, send_serial
)
944 __field(rxrpc_serial_t
, resp_serial
)
950 __entry
->call
= call
->debug_id
;
952 __entry
->send_serial
= send_serial
;
953 __entry
->resp_serial
= resp_serial
;
959 TP_printk("c=%08x %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
961 __print_symbolic(__entry
->why
, rxrpc_rtt_rx_traces
),
962 __entry
->send_serial
,
963 __entry
->resp_serial
,
969 TRACE_EVENT(rxrpc_timer
,
970 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_timer_trace why
,
973 TP_ARGS(call
, why
, now
),
976 __field(unsigned int, call
)
977 __field(enum rxrpc_timer_trace
, why
)
979 __field(long, ack_at
)
980 __field(long, ack_lost_at
)
981 __field(long, resend_at
)
982 __field(long, ping_at
)
983 __field(long, expect_rx_by
)
984 __field(long, expect_req_by
)
985 __field(long, expect_term_by
)
986 __field(long, timer
)
990 __entry
->call
= call
->debug_id
;
993 __entry
->ack_at
= call
->ack_at
;
994 __entry
->ack_lost_at
= call
->ack_lost_at
;
995 __entry
->resend_at
= call
->resend_at
;
996 __entry
->expect_rx_by
= call
->expect_rx_by
;
997 __entry
->expect_req_by
= call
->expect_req_by
;
998 __entry
->expect_term_by
= call
->expect_term_by
;
999 __entry
->timer
= call
->timer
.expires
;
1002 TP_printk("c=%08x %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
1004 __print_symbolic(__entry
->why
, rxrpc_timer_traces
),
1005 __entry
->ack_at
- __entry
->now
,
1006 __entry
->ack_lost_at
- __entry
->now
,
1007 __entry
->resend_at
- __entry
->now
,
1008 __entry
->expect_rx_by
- __entry
->now
,
1009 __entry
->expect_req_by
- __entry
->now
,
1010 __entry
->expect_term_by
- __entry
->now
,
1011 __entry
->timer
- __entry
->now
)
1014 TRACE_EVENT(rxrpc_rx_lose
,
1015 TP_PROTO(struct rxrpc_skb_priv
*sp
),
1020 __field_struct(struct rxrpc_host_header
, hdr
)
1024 memcpy(&__entry
->hdr
, &sp
->hdr
, sizeof(__entry
->hdr
));
1027 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
1028 __entry
->hdr
.epoch
, __entry
->hdr
.cid
,
1029 __entry
->hdr
.callNumber
, __entry
->hdr
.serviceId
,
1030 __entry
->hdr
.serial
, __entry
->hdr
.seq
,
1031 __entry
->hdr
.type
, __entry
->hdr
.flags
,
1032 __entry
->hdr
.type
<= 15 ?
1033 __print_symbolic(__entry
->hdr
.type
, rxrpc_pkts
) : "?UNK")
1036 TRACE_EVENT(rxrpc_propose_ack
,
1037 TP_PROTO(struct rxrpc_call
*call
, enum rxrpc_propose_ack_trace why
,
1038 u8 ack_reason
, rxrpc_serial_t serial
, bool immediate
,
1039 bool background
, enum rxrpc_propose_ack_outcome outcome
),
1041 TP_ARGS(call
, why
, ack_reason
, serial
, immediate
, background
,
1045 __field(unsigned int, call
)
1046 __field(enum rxrpc_propose_ack_trace
, why
)
1047 __field(rxrpc_serial_t
, serial
)
1048 __field(u8
, ack_reason
)
1049 __field(bool, immediate
)
1050 __field(bool, background
)
1051 __field(enum rxrpc_propose_ack_outcome
, outcome
)
1055 __entry
->call
= call
->debug_id
;
1057 __entry
->serial
= serial
;
1058 __entry
->ack_reason
= ack_reason
;
1059 __entry
->immediate
= immediate
;
1060 __entry
->background
= background
;
1061 __entry
->outcome
= outcome
;
1064 TP_printk("c=%08x %s %s r=%08x i=%u b=%u%s",
1066 __print_symbolic(__entry
->why
, rxrpc_propose_ack_traces
),
1067 __print_symbolic(__entry
->ack_reason
, rxrpc_ack_names
),
1070 __entry
->background
,
1071 __print_symbolic(__entry
->outcome
, rxrpc_propose_ack_outcomes
))
1074 TRACE_EVENT(rxrpc_retransmit
,
1075 TP_PROTO(struct rxrpc_call
*call
, rxrpc_seq_t seq
, u8 annotation
,
1078 TP_ARGS(call
, seq
, annotation
, expiry
),
1081 __field(unsigned int, call
)
1082 __field(rxrpc_seq_t
, seq
)
1083 __field(u8
, annotation
)
1084 __field(s64
, expiry
)
1088 __entry
->call
= call
->debug_id
;
1090 __entry
->annotation
= annotation
;
1091 __entry
->expiry
= expiry
;
1094 TP_printk("c=%08x q=%x a=%02x xp=%lld",
1097 __entry
->annotation
,
1101 TRACE_EVENT(rxrpc_congest
,
1102 TP_PROTO(struct rxrpc_call
*call
, struct rxrpc_ack_summary
*summary
,
1103 rxrpc_serial_t ack_serial
, enum rxrpc_congest_change change
),
1105 TP_ARGS(call
, summary
, ack_serial
, change
),
1108 __field(unsigned int, call
)
1109 __field(enum rxrpc_congest_change
, change
)
1110 __field(rxrpc_seq_t
, hard_ack
)
1111 __field(rxrpc_seq_t
, top
)
1112 __field(rxrpc_seq_t
, lowest_nak
)
1113 __field(rxrpc_serial_t
, ack_serial
)
1114 __field_struct(struct rxrpc_ack_summary
, sum
)
1118 __entry
->call
= call
->debug_id
;
1119 __entry
->change
= change
;
1120 __entry
->hard_ack
= call
->tx_hard_ack
;
1121 __entry
->top
= call
->tx_top
;
1122 __entry
->lowest_nak
= call
->acks_lowest_nak
;
1123 __entry
->ack_serial
= ack_serial
;
1124 memcpy(&__entry
->sum
, summary
, sizeof(__entry
->sum
));
1127 TP_printk("c=%08x r=%08x %s q=%08x %s cw=%u ss=%u nr=%u,%u nw=%u,%u r=%u b=%u u=%u d=%u l=%x%s%s%s",
1129 __entry
->ack_serial
,
1130 __print_symbolic(__entry
->sum
.ack_reason
, rxrpc_ack_names
),
1132 __print_symbolic(__entry
->sum
.mode
, rxrpc_congest_modes
),
1134 __entry
->sum
.ssthresh
,
1135 __entry
->sum
.nr_acks
, __entry
->sum
.nr_nacks
,
1136 __entry
->sum
.nr_new_acks
, __entry
->sum
.nr_new_nacks
,
1137 __entry
->sum
.nr_rot_new_acks
,
1138 __entry
->top
- __entry
->hard_ack
,
1139 __entry
->sum
.cumulative_acks
,
1140 __entry
->sum
.dup_acks
,
1141 __entry
->lowest_nak
, __entry
->sum
.new_low_nack
? "!" : "",
1142 __print_symbolic(__entry
->change
, rxrpc_congest_changes
),
1143 __entry
->sum
.retrans_timeo
? " rTxTo" : "")
1146 TRACE_EVENT(rxrpc_disconnect_call
,
1147 TP_PROTO(struct rxrpc_call
*call
),
1152 __field(unsigned int, call
)
1153 __field(u32
, abort_code
)
1157 __entry
->call
= call
->debug_id
;
1158 __entry
->abort_code
= call
->abort_code
;
1161 TP_printk("c=%08x ab=%08x",
1163 __entry
->abort_code
)
1166 TRACE_EVENT(rxrpc_improper_term
,
1167 TP_PROTO(struct rxrpc_call
*call
),
1172 __field(unsigned int, call
)
1173 __field(u32
, abort_code
)
1177 __entry
->call
= call
->debug_id
;
1178 __entry
->abort_code
= call
->abort_code
;
1181 TP_printk("c=%08x ab=%08x",
1183 __entry
->abort_code
)
1186 TRACE_EVENT(rxrpc_rx_eproto
,
1187 TP_PROTO(struct rxrpc_call
*call
, rxrpc_serial_t serial
,
1190 TP_ARGS(call
, serial
, why
),
1193 __field(unsigned int, call
)
1194 __field(rxrpc_serial_t
, serial
)
1195 __field(const char *, why
)
1199 __entry
->call
= call
->debug_id
;
1200 __entry
->serial
= serial
;
1204 TP_printk("c=%08x EPROTO %08x %s",
1210 TRACE_EVENT(rxrpc_connect_call
,
1211 TP_PROTO(struct rxrpc_call
*call
),
1216 __field(unsigned int, call
)
1217 __field(unsigned long, user_call_ID
)
1219 __field(u32
, call_id
)
1223 __entry
->call
= call
->debug_id
;
1224 __entry
->user_call_ID
= call
->user_call_ID
;
1225 __entry
->cid
= call
->cid
;
1226 __entry
->call_id
= call
->call_id
;
1229 TP_printk("c=%08x u=%p %08x:%08x",
1231 (void *)__entry
->user_call_ID
,
1236 TRACE_EVENT(rxrpc_resend
,
1237 TP_PROTO(struct rxrpc_call
*call
, int ix
),
1242 __field(unsigned int, call
)
1244 __array(u8
, anno
, 64 )
1248 __entry
->call
= call
->debug_id
;
1250 memcpy(__entry
->anno
, call
->rxtx_annotations
, 64);
1253 TP_printk("c=%08x ix=%u a=%64phN",
1259 #endif /* _TRACE_RXRPC_H */
1261 /* This part must be outside protection */
1262 #include <trace/define_trace.h>