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_exp_hard,
143 rxrpc_timer_exp_idle,
144 rxrpc_timer_exp_lost_ack,
145 rxrpc_timer_exp_normal,
146 rxrpc_timer_exp_ping,
147 rxrpc_timer_exp_resend,
149 rxrpc_timer_init_for_reply,
150 rxrpc_timer_init_for_send_reply,
152 rxrpc_timer_set_for_ack,
153 rxrpc_timer_set_for_hard,
154 rxrpc_timer_set_for_idle,
155 rxrpc_timer_set_for_lost_ack,
156 rxrpc_timer_set_for_normal,
157 rxrpc_timer_set_for_ping,
158 rxrpc_timer_set_for_resend,
159 rxrpc_timer_set_for_send,
162 enum rxrpc_propose_ack_trace {
163 rxrpc_propose_ack_client_tx_end,
164 rxrpc_propose_ack_input_data,
165 rxrpc_propose_ack_ping_for_lost_ack,
166 rxrpc_propose_ack_ping_for_lost_reply,
167 rxrpc_propose_ack_ping_for_params,
168 rxrpc_propose_ack_processing_op,
169 rxrpc_propose_ack_respond_to_ack,
170 rxrpc_propose_ack_respond_to_ping,
171 rxrpc_propose_ack_retry_tx,
172 rxrpc_propose_ack_rotate_rx,
173 rxrpc_propose_ack_terminal_ack,
176 enum rxrpc_propose_ack_outcome {
177 rxrpc_propose_ack_subsume,
178 rxrpc_propose_ack_update,
179 rxrpc_propose_ack_use,
182 enum rxrpc_congest_change {
183 rxrpc_cong_begin_retransmission,
184 rxrpc_cong_cleared_nacks,
185 rxrpc_cong_new_low_nack,
186 rxrpc_cong_no_change,
188 rxrpc_cong_retransmit_again,
189 rxrpc_cong_rtt_window_end,
193 #endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
196 * Declare tracing information enums and their string mappings for display.
198 #define rxrpc_skb_traces \
199 EM(rxrpc_skb_rx_cleaned, "Rx CLN") \
200 EM(rxrpc_skb_rx_freed, "Rx FRE") \
201 EM(rxrpc_skb_rx_got, "Rx GOT") \
202 EM(rxrpc_skb_rx_lost, "Rx *L*") \
203 EM(rxrpc_skb_rx_purged, "Rx PUR") \
204 EM(rxrpc_skb_rx_received, "Rx RCV") \
205 EM(rxrpc_skb_rx_rotated, "Rx ROT") \
206 EM(rxrpc_skb_rx_seen, "Rx SEE") \
207 EM(rxrpc_skb_tx_cleaned, "Tx CLN") \
208 EM(rxrpc_skb_tx_freed, "Tx FRE") \
209 EM(rxrpc_skb_tx_got, "Tx GOT") \
210 EM(rxrpc_skb_tx_new, "Tx NEW") \
211 EM(rxrpc_skb_tx_rotated, "Tx ROT") \
212 E_(rxrpc_skb_tx_seen, "Tx SEE")
214 #define rxrpc_conn_traces \
215 EM(rxrpc_conn_got, "GOT") \
216 EM(rxrpc_conn_new_client, "NWc") \
217 EM(rxrpc_conn_new_service, "NWs") \
218 EM(rxrpc_conn_put_client, "PTc") \
219 EM(rxrpc_conn_put_service, "PTs") \
220 EM(rxrpc_conn_queued, "QUE") \
221 E_(rxrpc_conn_seen, "SEE")
223 #define rxrpc_client_traces \
224 EM(rxrpc_client_activate_chans, "Activa") \
225 EM(rxrpc_client_alloc, "Alloc ") \
226 EM(rxrpc_client_chan_activate, "ChActv") \
227 EM(rxrpc_client_chan_disconnect, "ChDisc") \
228 EM(rxrpc_client_chan_pass, "ChPass") \
229 EM(rxrpc_client_chan_unstarted, "ChUnst") \
230 EM(rxrpc_client_cleanup, "Clean ") \
231 EM(rxrpc_client_count, "Count ") \
232 EM(rxrpc_client_discard, "Discar") \
233 EM(rxrpc_client_duplicate, "Duplic") \
234 EM(rxrpc_client_exposed, "Expose") \
235 EM(rxrpc_client_replace, "Replac") \
236 EM(rxrpc_client_to_active, "->Actv") \
237 EM(rxrpc_client_to_culled, "->Cull") \
238 EM(rxrpc_client_to_idle, "->Idle") \
239 EM(rxrpc_client_to_inactive, "->Inac") \
240 EM(rxrpc_client_to_upgrade, "->Upgd") \
241 EM(rxrpc_client_to_waiting, "->Wait") \
242 E_(rxrpc_client_uncount, "Uncoun")
244 #define rxrpc_conn_cache_states \
245 EM(RXRPC_CONN_CLIENT_INACTIVE, "Inac") \
246 EM(RXRPC_CONN_CLIENT_WAITING, "Wait") \
247 EM(RXRPC_CONN_CLIENT_ACTIVE, "Actv") \
248 EM(RXRPC_CONN_CLIENT_UPGRADE, "Upgd") \
249 EM(RXRPC_CONN_CLIENT_CULLED, "Cull") \
250 E_(RXRPC_CONN_CLIENT_IDLE, "Idle") \
252 #define rxrpc_call_traces \
253 EM(rxrpc_call_connected, "CON") \
254 EM(rxrpc_call_error, "*E*") \
255 EM(rxrpc_call_got, "GOT") \
256 EM(rxrpc_call_got_kernel, "Gke") \
257 EM(rxrpc_call_got_userid, "Gus") \
258 EM(rxrpc_call_new_client, "NWc") \
259 EM(rxrpc_call_new_service, "NWs") \
260 EM(rxrpc_call_put, "PUT") \
261 EM(rxrpc_call_put_kernel, "Pke") \
262 EM(rxrpc_call_put_noqueue, "PNQ") \
263 EM(rxrpc_call_put_userid, "Pus") \
264 EM(rxrpc_call_queued, "QUE") \
265 EM(rxrpc_call_queued_ref, "QUR") \
266 EM(rxrpc_call_release, "RLS") \
267 E_(rxrpc_call_seen, "SEE")
269 #define rxrpc_transmit_traces \
270 EM(rxrpc_transmit_await_reply, "AWR") \
271 EM(rxrpc_transmit_end, "END") \
272 EM(rxrpc_transmit_queue, "QUE") \
273 EM(rxrpc_transmit_queue_last, "QLS") \
274 EM(rxrpc_transmit_rotate, "ROT") \
275 EM(rxrpc_transmit_rotate_last, "RLS") \
276 E_(rxrpc_transmit_wait, "WAI")
278 #define rxrpc_receive_traces \
279 EM(rxrpc_receive_end, "END") \
280 EM(rxrpc_receive_front, "FRN") \
281 EM(rxrpc_receive_incoming, "INC") \
282 EM(rxrpc_receive_queue, "QUE") \
283 EM(rxrpc_receive_queue_last, "QLS") \
284 E_(rxrpc_receive_rotate, "ROT")
286 #define rxrpc_recvmsg_traces \
287 EM(rxrpc_recvmsg_cont, "CONT") \
288 EM(rxrpc_recvmsg_data_return, "DATA") \
289 EM(rxrpc_recvmsg_dequeue, "DEQU") \
290 EM(rxrpc_recvmsg_enter, "ENTR") \
291 EM(rxrpc_recvmsg_full, "FULL") \
292 EM(rxrpc_recvmsg_hole, "HOLE") \
293 EM(rxrpc_recvmsg_next, "NEXT") \
294 EM(rxrpc_recvmsg_requeue, "REQU") \
295 EM(rxrpc_recvmsg_return, "RETN") \
296 EM(rxrpc_recvmsg_terminal, "TERM") \
297 EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \
298 E_(rxrpc_recvmsg_wait, "WAIT")
300 #define rxrpc_rtt_tx_traces \
301 EM(rxrpc_rtt_tx_data, "DATA") \
302 E_(rxrpc_rtt_tx_ping, "PING")
304 #define rxrpc_rtt_rx_traces \
305 EM(rxrpc_rtt_rx_ping_response, "PONG") \
306 E_(rxrpc_rtt_rx_requested_ack, "RACK")
308 #define rxrpc_timer_traces \
309 EM(rxrpc_timer_begin, "Begin ") \
310 EM(rxrpc_timer_expired, "*EXPR*") \
311 EM(rxrpc_timer_exp_ack, "ExpAck") \
312 EM(rxrpc_timer_exp_hard, "ExpHrd") \
313 EM(rxrpc_timer_exp_idle, "ExpIdl") \
314 EM(rxrpc_timer_exp_lost_ack, "ExpLoA") \
315 EM(rxrpc_timer_exp_normal, "ExpNml") \
316 EM(rxrpc_timer_exp_ping, "ExpPng") \
317 EM(rxrpc_timer_exp_resend, "ExpRsn") \
318 EM(rxrpc_timer_init_for_reply, "IniRpl") \
319 EM(rxrpc_timer_init_for_send_reply, "SndRpl") \
320 EM(rxrpc_timer_restart, "Restrt") \
321 EM(rxrpc_timer_set_for_ack, "SetAck") \
322 EM(rxrpc_timer_set_for_hard, "SetHrd") \
323 EM(rxrpc_timer_set_for_idle, "SetIdl") \
324 EM(rxrpc_timer_set_for_lost_ack, "SetLoA") \
325 EM(rxrpc_timer_set_for_normal, "SetNml") \
326 EM(rxrpc_timer_set_for_ping, "SetPng") \
327 EM(rxrpc_timer_set_for_resend, "SetRTx") \
328 E_(rxrpc_timer_set_for_send, "SetSnd")
330 #define rxrpc_propose_ack_traces \
331 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \
332 EM(rxrpc_propose_ack_input_data, "DataIn ") \
333 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \
334 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
335 EM(rxrpc_propose_ack_ping_for_params, "Params ") \
336 EM(rxrpc_propose_ack_processing_op, "ProcOp ") \
337 EM(rxrpc_propose_ack_respond_to_ack, "Rsp2Ack") \
338 EM(rxrpc_propose_ack_respond_to_ping, "Rsp2Png") \
339 EM(rxrpc_propose_ack_retry_tx, "RetryTx") \
340 EM(rxrpc_propose_ack_rotate_rx, "RxAck ") \
341 E_(rxrpc_propose_ack_terminal_ack, "ClTerm ")
343 #define rxrpc_propose_ack_outcomes \
344 EM(rxrpc_propose_ack_subsume, " Subsume") \
345 EM(rxrpc_propose_ack_update, " Update") \
346 E_(rxrpc_propose_ack_use, "")
348 #define rxrpc_congest_modes \
349 EM(RXRPC_CALL_CONGEST_AVOIDANCE, "CongAvoid") \
350 EM(RXRPC_CALL_FAST_RETRANSMIT, "FastReTx ") \
351 EM(RXRPC_CALL_PACKET_LOSS, "PktLoss ") \
352 E_(RXRPC_CALL_SLOW_START, "SlowStart")
354 #define rxrpc_congest_changes \
355 EM(rxrpc_cong_begin_retransmission, " Retrans") \
356 EM(rxrpc_cong_cleared_nacks, " Cleared") \
357 EM(rxrpc_cong_new_low_nack, " NewLowN") \
358 EM(rxrpc_cong_no_change, "") \
359 EM(rxrpc_cong_progress, " Progres") \
360 EM(rxrpc_cong_retransmit_again, " ReTxAgn") \
361 EM(rxrpc_cong_rtt_window_end, " RttWinE") \
362 E_(rxrpc_cong_saw_nack, " SawNack")
366 EM(RXRPC_PACKET_TYPE_DATA, "DATA") \
367 EM(RXRPC_PACKET_TYPE_ACK, "ACK") \
368 EM(RXRPC_PACKET_TYPE_BUSY, "BUSY") \
369 EM(RXRPC_PACKET_TYPE_ABORT, "ABORT") \
370 EM(RXRPC_PACKET_TYPE_ACKALL, "ACKALL") \
371 EM(RXRPC_PACKET_TYPE_CHALLENGE, "CHALL") \
372 EM(RXRPC_PACKET_TYPE_RESPONSE, "RESP") \
373 EM(RXRPC_PACKET_TYPE_DEBUG, "DEBUG") \
378 EM(RXRPC_PACKET_TYPE_VERSION, "VERSION") \
382 #define rxrpc_ack_names \
384 EM(RXRPC_ACK_REQUESTED, "REQ") \
385 EM(RXRPC_ACK_DUPLICATE, "DUP") \
386 EM(RXRPC_ACK_OUT_OF_SEQUENCE, "OOS") \
387 EM(RXRPC_ACK_EXCEEDS_WINDOW, "WIN") \
388 EM(RXRPC_ACK_NOSPACE, "MEM") \
389 EM(RXRPC_ACK_PING, "PNG") \
390 EM(RXRPC_ACK_PING_RESPONSE, "PNR") \
391 EM(RXRPC_ACK_DELAY, "DLY") \
392 EM(RXRPC_ACK_IDLE, "IDL") \
393 E_(RXRPC_ACK__INVALID, "-?-")
396 * Export enum symbols via userspace.
400 #define EM(a, b) TRACE_DEFINE_ENUM(a);
401 #define E_(a, b) TRACE_DEFINE_ENUM(a);
407 rxrpc_transmit_traces;
408 rxrpc_receive_traces;
409 rxrpc_recvmsg_traces;
413 rxrpc_propose_ack_traces;
414 rxrpc_propose_ack_outcomes;
415 rxrpc_congest_changes;
418 * Now redefine the EM() and E_() macros to map the enums to the strings that
419 * will be printed in the output.
423 #define EM(a, b) { a, b },
424 #define E_(a, b) { a, b }
426 TRACE_EVENT(rxrpc_conn,
427 TP_PROTO(struct rxrpc_connection *conn, enum rxrpc_conn_trace op,
428 int usage, const void *where),
430 TP_ARGS(conn, op, usage, where),
433 __field(struct rxrpc_connection *, conn )
436 __field(const void *, where )
440 __entry->conn = conn;
442 __entry->usage = usage;
443 __entry->where = where;
446 TP_printk("C=%p %s u=%d sp=%pSR",
448 __print_symbolic(__entry->op, rxrpc_conn_traces),
453 TRACE_EVENT(rxrpc_client,
454 TP_PROTO(struct rxrpc_connection *conn, int channel,
455 enum rxrpc_client_trace op),
457 TP_ARGS(conn, channel, op),
460 __field(struct rxrpc_connection *, conn )
462 __field(int, channel )
464 __field(enum rxrpc_client_trace, op )
465 __field(enum rxrpc_conn_cache_state, cs )
469 __entry->conn = conn;
470 __entry->channel = channel;
471 __entry->usage = atomic_read(&conn->usage);
473 __entry->cid = conn->proto.cid;
474 __entry->cs = conn->cache_state;
477 TP_printk("C=%p h=%2d %s %s i=%08x u=%d",
480 __print_symbolic(__entry->op, rxrpc_client_traces),
481 __print_symbolic(__entry->cs, rxrpc_conn_cache_states),
486 TRACE_EVENT(rxrpc_call,
487 TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
488 int usage, const void *where, const void *aux),
490 TP_ARGS(call, op, usage, where, aux),
493 __field(struct rxrpc_call *, call )
496 __field(const void *, where )
497 __field(const void *, aux )
501 __entry->call = call;
503 __entry->usage = usage;
504 __entry->where = where;
508 TP_printk("c=%p %s u=%d sp=%pSR a=%p",
510 __print_symbolic(__entry->op, rxrpc_call_traces),
516 TRACE_EVENT(rxrpc_skb,
517 TP_PROTO(struct sk_buff *skb, enum rxrpc_skb_trace op,
518 int usage, int mod_count, const void *where),
520 TP_ARGS(skb, op, usage, mod_count, where),
523 __field(struct sk_buff *, skb )
524 __field(enum rxrpc_skb_trace, op )
526 __field(int, mod_count )
527 __field(const void *, where )
533 __entry->usage = usage;
534 __entry->mod_count = mod_count;
535 __entry->where = where;
538 TP_printk("s=%p %s u=%d m=%d p=%pSR",
540 __print_symbolic(__entry->op, rxrpc_skb_traces),
546 TRACE_EVENT(rxrpc_rx_packet,
547 TP_PROTO(struct rxrpc_skb_priv *sp),
552 __field_struct(struct rxrpc_host_header, hdr )
556 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
559 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s",
560 __entry->hdr.epoch, __entry->hdr.cid,
561 __entry->hdr.callNumber, __entry->hdr.serviceId,
562 __entry->hdr.serial, __entry->hdr.seq,
563 __entry->hdr.type, __entry->hdr.flags,
564 __entry->hdr.type <= 15 ?
565 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
568 TRACE_EVENT(rxrpc_rx_done,
569 TP_PROTO(int result, int abort_code),
571 TP_ARGS(result, abort_code),
574 __field(int, result )
575 __field(int, abort_code )
579 __entry->result = result;
580 __entry->abort_code = abort_code;
583 TP_printk("r=%d a=%d", __entry->result, __entry->abort_code)
586 TRACE_EVENT(rxrpc_abort,
587 TP_PROTO(const char *why, u32 cid, u32 call_id, rxrpc_seq_t seq,
588 int abort_code, int error),
590 TP_ARGS(why, cid, call_id, seq, abort_code, error),
593 __array(char, why, 4 )
595 __field(u32, call_id )
596 __field(rxrpc_seq_t, seq )
597 __field(int, abort_code )
602 memcpy(__entry->why, why, 4);
604 __entry->call_id = call_id;
605 __entry->abort_code = abort_code;
606 __entry->error = error;
610 TP_printk("%08x:%08x s=%u a=%d e=%d %s",
611 __entry->cid, __entry->call_id, __entry->seq,
612 __entry->abort_code, __entry->error, __entry->why)
615 TRACE_EVENT(rxrpc_transmit,
616 TP_PROTO(struct rxrpc_call *call, enum rxrpc_transmit_trace why),
621 __field(struct rxrpc_call *, call )
622 __field(enum rxrpc_transmit_trace, why )
623 __field(rxrpc_seq_t, tx_hard_ack )
624 __field(rxrpc_seq_t, tx_top )
625 __field(int, tx_winsize )
629 __entry->call = call;
631 __entry->tx_hard_ack = call->tx_hard_ack;
632 __entry->tx_top = call->tx_top;
633 __entry->tx_winsize = call->tx_winsize;
636 TP_printk("c=%p %s f=%08x n=%u/%u",
638 __print_symbolic(__entry->why, rxrpc_transmit_traces),
639 __entry->tx_hard_ack + 1,
640 __entry->tx_top - __entry->tx_hard_ack,
644 TRACE_EVENT(rxrpc_rx_data,
645 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
646 rxrpc_serial_t serial, u8 flags, u8 anno),
648 TP_ARGS(call, seq, serial, flags, anno),
651 __field(struct rxrpc_call *, call )
652 __field(rxrpc_seq_t, seq )
653 __field(rxrpc_serial_t, serial )
659 __entry->call = call;
661 __entry->serial = serial;
662 __entry->flags = flags;
663 __entry->anno = anno;
666 TP_printk("c=%p DATA %08x q=%08x fl=%02x a=%02x",
674 TRACE_EVENT(rxrpc_rx_ack,
675 TP_PROTO(struct rxrpc_call *call,
676 rxrpc_serial_t serial, rxrpc_serial_t ack_serial,
677 rxrpc_seq_t first, rxrpc_seq_t prev, u8 reason, u8 n_acks),
679 TP_ARGS(call, serial, ack_serial, first, prev, reason, n_acks),
682 __field(struct rxrpc_call *, call )
683 __field(rxrpc_serial_t, serial )
684 __field(rxrpc_serial_t, ack_serial )
685 __field(rxrpc_seq_t, first )
686 __field(rxrpc_seq_t, prev )
692 __entry->call = call;
693 __entry->serial = serial;
694 __entry->ack_serial = ack_serial;
695 __entry->first = first;
696 __entry->prev = prev;
697 __entry->reason = reason;
698 __entry->n_acks = n_acks;
701 TP_printk("c=%p %08x %s r=%08x f=%08x p=%08x n=%u",
704 __print_symbolic(__entry->reason, rxrpc_ack_names),
711 TRACE_EVENT(rxrpc_rx_abort,
712 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
715 TP_ARGS(call, serial, abort_code),
718 __field(struct rxrpc_call *, call )
719 __field(rxrpc_serial_t, serial )
720 __field(u32, abort_code )
724 __entry->call = call;
725 __entry->serial = serial;
726 __entry->abort_code = abort_code;
729 TP_printk("c=%p ABORT %08x ac=%d",
735 TRACE_EVENT(rxrpc_rx_rwind_change,
736 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
737 u32 rwind, bool wake),
739 TP_ARGS(call, serial, rwind, wake),
742 __field(struct rxrpc_call *, call )
743 __field(rxrpc_serial_t, serial )
749 __entry->call = call;
750 __entry->serial = serial;
751 __entry->rwind = rwind;
752 __entry->wake = wake;
755 TP_printk("c=%p %08x rw=%u%s",
759 __entry->wake ? " wake" : "")
762 TRACE_EVENT(rxrpc_tx_data,
763 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
764 rxrpc_serial_t serial, u8 flags, bool retrans, bool lose),
766 TP_ARGS(call, seq, serial, flags, retrans, lose),
769 __field(struct rxrpc_call *, call )
770 __field(rxrpc_seq_t, seq )
771 __field(rxrpc_serial_t, serial )
773 __field(bool, retrans )
778 __entry->call = call;
780 __entry->serial = serial;
781 __entry->flags = flags;
782 __entry->retrans = retrans;
783 __entry->lose = lose;
786 TP_printk("c=%p DATA %08x q=%08x fl=%02x%s%s",
791 __entry->retrans ? " *RETRANS*" : "",
792 __entry->lose ? " *LOSE*" : "")
795 TRACE_EVENT(rxrpc_tx_ack,
796 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
797 rxrpc_seq_t ack_first, rxrpc_serial_t ack_serial,
798 u8 reason, u8 n_acks),
800 TP_ARGS(call, serial, ack_first, ack_serial, reason, n_acks),
803 __field(struct rxrpc_call *, call )
804 __field(rxrpc_serial_t, serial )
805 __field(rxrpc_seq_t, ack_first )
806 __field(rxrpc_serial_t, ack_serial )
812 __entry->call = call;
813 __entry->serial = serial;
814 __entry->ack_first = ack_first;
815 __entry->ack_serial = ack_serial;
816 __entry->reason = reason;
817 __entry->n_acks = n_acks;
820 TP_printk(" c=%p ACK %08x %s f=%08x r=%08x n=%u",
823 __print_symbolic(__entry->reason, rxrpc_ack_names),
829 TRACE_EVENT(rxrpc_receive,
830 TP_PROTO(struct rxrpc_call *call, enum rxrpc_receive_trace why,
831 rxrpc_serial_t serial, rxrpc_seq_t seq),
833 TP_ARGS(call, why, serial, seq),
836 __field(struct rxrpc_call *, call )
837 __field(enum rxrpc_receive_trace, why )
838 __field(rxrpc_serial_t, serial )
839 __field(rxrpc_seq_t, seq )
840 __field(rxrpc_seq_t, hard_ack )
841 __field(rxrpc_seq_t, top )
845 __entry->call = call;
847 __entry->serial = serial;
849 __entry->hard_ack = call->rx_hard_ack;
850 __entry->top = call->rx_top;
853 TP_printk("c=%p %s r=%08x q=%08x w=%08x-%08x",
855 __print_symbolic(__entry->why, rxrpc_receive_traces),
862 TRACE_EVENT(rxrpc_recvmsg,
863 TP_PROTO(struct rxrpc_call *call, enum rxrpc_recvmsg_trace why,
864 rxrpc_seq_t seq, unsigned int offset, unsigned int len,
867 TP_ARGS(call, why, seq, offset, len, ret),
870 __field(struct rxrpc_call *, call )
871 __field(enum rxrpc_recvmsg_trace, why )
872 __field(rxrpc_seq_t, seq )
873 __field(unsigned int, offset )
874 __field(unsigned int, len )
879 __entry->call = call;
882 __entry->offset = offset;
887 TP_printk("c=%p %s q=%08x o=%u l=%u ret=%d",
889 __print_symbolic(__entry->why, rxrpc_recvmsg_traces),
896 TRACE_EVENT(rxrpc_rtt_tx,
897 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_tx_trace why,
898 rxrpc_serial_t send_serial),
900 TP_ARGS(call, why, send_serial),
903 __field(struct rxrpc_call *, call )
904 __field(enum rxrpc_rtt_tx_trace, why )
905 __field(rxrpc_serial_t, send_serial )
909 __entry->call = call;
911 __entry->send_serial = send_serial;
914 TP_printk("c=%p %s sr=%08x",
916 __print_symbolic(__entry->why, rxrpc_rtt_tx_traces),
917 __entry->send_serial)
920 TRACE_EVENT(rxrpc_rtt_rx,
921 TP_PROTO(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
922 rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
923 s64 rtt, u8 nr, s64 avg),
925 TP_ARGS(call, why, send_serial, resp_serial, rtt, nr, avg),
928 __field(struct rxrpc_call *, call )
929 __field(enum rxrpc_rtt_rx_trace, why )
931 __field(rxrpc_serial_t, send_serial )
932 __field(rxrpc_serial_t, resp_serial )
938 __entry->call = call;
940 __entry->send_serial = send_serial;
941 __entry->resp_serial = resp_serial;
947 TP_printk("c=%p %s sr=%08x rr=%08x rtt=%lld nr=%u avg=%lld",
949 __print_symbolic(__entry->why, rxrpc_rtt_rx_traces),
950 __entry->send_serial,
951 __entry->resp_serial,
957 TRACE_EVENT(rxrpc_timer,
958 TP_PROTO(struct rxrpc_call *call, enum rxrpc_timer_trace why,
961 TP_ARGS(call, why, now),
964 __field(struct rxrpc_call *, call )
965 __field(enum rxrpc_timer_trace, why )
967 __field(long, ack_at )
968 __field(long, ack_lost_at )
969 __field(long, resend_at )
970 __field(long, ping_at )
971 __field(long, expect_rx_by )
972 __field(long, expect_req_by )
973 __field(long, expect_term_by )
974 __field(long, timer )
978 __entry->call = call;
981 __entry->ack_at = call->ack_at;
982 __entry->ack_lost_at = call->ack_lost_at;
983 __entry->resend_at = call->resend_at;
984 __entry->expect_rx_by = call->expect_rx_by;
985 __entry->expect_req_by = call->expect_req_by;
986 __entry->expect_term_by = call->expect_term_by;
987 __entry->timer = call->timer.expires;
990 TP_printk("c=%p %s a=%ld la=%ld r=%ld xr=%ld xq=%ld xt=%ld t=%ld",
992 __print_symbolic(__entry->why, rxrpc_timer_traces),
993 __entry->ack_at - __entry->now,
994 __entry->ack_lost_at - __entry->now,
995 __entry->resend_at - __entry->now,
996 __entry->expect_rx_by - __entry->now,
997 __entry->expect_req_by - __entry->now,
998 __entry->expect_term_by - __entry->now,
999 __entry->timer - __entry->now)
1002 TRACE_EVENT(rxrpc_rx_lose,
1003 TP_PROTO(struct rxrpc_skb_priv *sp),
1008 __field_struct(struct rxrpc_host_header, hdr )
1012 memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
1015 TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
1016 __entry->hdr.epoch, __entry->hdr.cid,
1017 __entry->hdr.callNumber, __entry->hdr.serviceId,
1018 __entry->hdr.serial, __entry->hdr.seq,
1019 __entry->hdr.type, __entry->hdr.flags,
1020 __entry->hdr.type <= 15 ?
1021 __print_symbolic(__entry->hdr.type, rxrpc_pkts) : "?UNK")
1024 TRACE_EVENT(rxrpc_propose_ack,
1025 TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
1026 u8 ack_reason, rxrpc_serial_t serial, bool immediate,
1027 bool background, enum rxrpc_propose_ack_outcome outcome),
1029 TP_ARGS(call, why, ack_reason, serial, immediate, background,
1033 __field(struct rxrpc_call *, call )
1034 __field(enum rxrpc_propose_ack_trace, why )
1035 __field(rxrpc_serial_t, serial )
1036 __field(u8, ack_reason )
1037 __field(bool, immediate )
1038 __field(bool, background )
1039 __field(enum rxrpc_propose_ack_outcome, outcome )
1043 __entry->call = call;
1045 __entry->serial = serial;
1046 __entry->ack_reason = ack_reason;
1047 __entry->immediate = immediate;
1048 __entry->background = background;
1049 __entry->outcome = outcome;
1052 TP_printk("c=%p %s %s r=%08x i=%u b=%u%s",
1054 __print_symbolic(__entry->why, rxrpc_propose_ack_traces),
1055 __print_symbolic(__entry->ack_reason, rxrpc_ack_names),
1058 __entry->background,
1059 __print_symbolic(__entry->outcome, rxrpc_propose_ack_outcomes))
1062 TRACE_EVENT(rxrpc_retransmit,
1063 TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
1066 TP_ARGS(call, seq, annotation, expiry),
1069 __field(struct rxrpc_call *, call )
1070 __field(rxrpc_seq_t, seq )
1071 __field(u8, annotation )
1072 __field(s64, expiry )
1076 __entry->call = call;
1078 __entry->annotation = annotation;
1079 __entry->expiry = expiry;
1082 TP_printk("c=%p q=%x a=%02x xp=%lld",
1085 __entry->annotation,
1089 TRACE_EVENT(rxrpc_congest,
1090 TP_PROTO(struct rxrpc_call *call, struct rxrpc_ack_summary *summary,
1091 rxrpc_serial_t ack_serial, enum rxrpc_congest_change change),
1093 TP_ARGS(call, summary, ack_serial, change),
1096 __field(struct rxrpc_call *, call )
1097 __field(enum rxrpc_congest_change, change )
1098 __field(rxrpc_seq_t, hard_ack )
1099 __field(rxrpc_seq_t, top )
1100 __field(rxrpc_seq_t, lowest_nak )
1101 __field(rxrpc_serial_t, ack_serial )
1102 __field_struct(struct rxrpc_ack_summary, sum )
1106 __entry->call = call;
1107 __entry->change = change;
1108 __entry->hard_ack = call->tx_hard_ack;
1109 __entry->top = call->tx_top;
1110 __entry->lowest_nak = call->acks_lowest_nak;
1111 __entry->ack_serial = ack_serial;
1112 memcpy(&__entry->sum, summary, sizeof(__entry->sum));
1115 TP_printk("c=%p 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",
1117 __entry->ack_serial,
1118 __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names),
1120 __print_symbolic(__entry->sum.mode, rxrpc_congest_modes),
1122 __entry->sum.ssthresh,
1123 __entry->sum.nr_acks, __entry->sum.nr_nacks,
1124 __entry->sum.nr_new_acks, __entry->sum.nr_new_nacks,
1125 __entry->sum.nr_rot_new_acks,
1126 __entry->top - __entry->hard_ack,
1127 __entry->sum.cumulative_acks,
1128 __entry->sum.dup_acks,
1129 __entry->lowest_nak, __entry->sum.new_low_nack ? "!" : "",
1130 __print_symbolic(__entry->change, rxrpc_congest_changes),
1131 __entry->sum.retrans_timeo ? " rTxTo" : "")
1134 TRACE_EVENT(rxrpc_disconnect_call,
1135 TP_PROTO(struct rxrpc_call *call),
1140 __field(struct rxrpc_call *, call )
1141 __field(u32, abort_code )
1145 __entry->call = call;
1146 __entry->abort_code = call->abort_code;
1149 TP_printk("c=%p ab=%08x",
1151 __entry->abort_code)
1154 TRACE_EVENT(rxrpc_improper_term,
1155 TP_PROTO(struct rxrpc_call *call),
1160 __field(struct rxrpc_call *, call )
1161 __field(u32, abort_code )
1165 __entry->call = call;
1166 __entry->abort_code = call->abort_code;
1169 TP_printk("c=%p ab=%08x",
1171 __entry->abort_code)
1174 TRACE_EVENT(rxrpc_rx_eproto,
1175 TP_PROTO(struct rxrpc_call *call, rxrpc_serial_t serial,
1178 TP_ARGS(call, serial, why),
1181 __field(struct rxrpc_call *, call )
1182 __field(rxrpc_serial_t, serial )
1183 __field(const char *, why )
1187 __entry->call = call;
1188 __entry->serial = serial;
1192 TP_printk("c=%p EPROTO %08x %s",
1198 TRACE_EVENT(rxrpc_connect_call,
1199 TP_PROTO(struct rxrpc_call *call),
1204 __field(struct rxrpc_call *, call )
1205 __field(unsigned long, user_call_ID )
1207 __field(u32, call_id )
1211 __entry->call = call;
1212 __entry->user_call_ID = call->user_call_ID;
1213 __entry->cid = call->cid;
1214 __entry->call_id = call->call_id;
1217 TP_printk("c=%p u=%p %08x:%08x",
1219 (void *)__entry->user_call_ID,
1224 #endif /* _TRACE_RXRPC_H */
1226 /* This part must be outside protection */
1227 #include <trace/define_trace.h>