Skip to content

Commit c6672e3

Browse files
committed
rxrpc: Add a tracepoint to log which packets will be retransmitted
Add a tracepoint to log in rxrpc_resend() which packets will be retransmitted. Note that if a positive ACK comes in whilst we have dropped the lock to retransmit another packet, the actual retransmission may not happen, though some of the effects will (such as altering the congestion management). Signed-off-by: David Howells <dhowells@redhat.com>
1 parent 9c7ad43 commit c6672e3

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

‎include/trace/events/rxrpc.h‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,33 @@ TRACE_EVENT(rxrpc_propose_ack,
543543
rxrpc_propose_ack_outcomes[__entry->outcome])
544544
);
545545

546+
TRACE_EVENT(rxrpc_retransmit,
547+
TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq, u8 annotation,
548+
s64 expiry),
549+
550+
TP_ARGS(call, seq, annotation, expiry),
551+
552+
TP_STRUCT__entry(
553+
__field(struct rxrpc_call *, call )
554+
__field(rxrpc_seq_t, seq )
555+
__field(u8, annotation )
556+
__field(s64, expiry )
557+
),
558+
559+
TP_fast_assign(
560+
__entry->call = call;
561+
__entry->seq = seq;
562+
__entry->annotation = annotation;
563+
__entry->expiry = expiry;
564+
),
565+
566+
TP_printk("c=%p q=%x a=%02x xp=%lld",
567+
__entry->call,
568+
__entry->seq,
569+
__entry->annotation,
570+
__entry->expiry)
571+
);
572+
546573
#endif /* _TRACE_RXRPC_H */
547574

548575
/* This part must be outside protection */

‎net/rxrpc/call_event.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ static void rxrpc_resend(struct rxrpc_call *call)
196196

197197
/* Okay, we need to retransmit a packet. */
198198
call->rxtx_annotations[ix] = RXRPC_TX_ANNO_RETRANS | annotation;
199+
trace_rxrpc_retransmit(call, seq, annotation | anno_type,
200+
ktime_to_ns(ktime_sub(skb->tstamp, max_age)));
199201
}
200202

201203
resend_at = ktime_sub(ktime_add_ms(oldest, rxrpc_resend_timeout), now);

0 commit comments

Comments
 (0)