rxrpc: Add a tracepoint to show variables pertinent to jumbo packet size
authorDavid Howells <dhowells@redhat.com>
Wed, 4 Dec 2024 07:46:40 +0000 (07:46 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 9 Dec 2024 21:48:26 +0000 (13:48 -0800)
Add a tracepoint to be called right before packets are transmitted for the
first time that shows variable values that are pertinent to how many
subpackets will be added to a jumbo DATA packet.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20241204074710.990092-13-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/trace/events/rxrpc.h
net/rxrpc/call_event.c

index 9dcadad88e76670b5eb4b6aa18565f78e170e55b..71f07e726a90348dda3b8f302988b0b4ae60730c 100644 (file)
@@ -903,6 +903,47 @@ TRACE_EVENT(rxrpc_txqueue,
                      __entry->tx_winsize)
            );
 
+TRACE_EVENT(rxrpc_transmit,
+           TP_PROTO(struct rxrpc_call *call, int space),
+
+           TP_ARGS(call, space),
+
+           TP_STRUCT__entry(
+                   __field(unsigned int,       call)
+                   __field(rxrpc_seq_t,        seq)
+                   __field(u16,                space)
+                   __field(u16,                tx_winsize)
+                   __field(u16,                cong_cwnd)
+                   __field(u16,                cong_extra)
+                   __field(u16,                in_flight)
+                   __field(u16,                prepared)
+                   __field(u16,                pmtud_jumbo)
+                            ),
+
+           TP_fast_assign(
+                   __entry->call       = call->debug_id;
+                   __entry->seq        = call->tx_bottom;
+                   __entry->space      = space;
+                   __entry->tx_winsize = call->tx_winsize;
+                   __entry->cong_cwnd  = call->cong_cwnd;
+                   __entry->cong_extra = call->cong_extra;
+                   __entry->prepared   = call->tx_prepared - call->tx_bottom;
+                   __entry->in_flight  = call->tx_top - call->acks_hard_ack;
+                   __entry->pmtud_jumbo = call->peer->pmtud_jumbo;
+                          ),
+
+           TP_printk("c=%08x q=%08x sp=%u tw=%u cw=%u+%u pr=%u if=%u pj=%u",
+                     __entry->call,
+                     __entry->seq,
+                     __entry->space,
+                     __entry->tx_winsize,
+                     __entry->cong_cwnd,
+                     __entry->cong_extra,
+                     __entry->prepared,
+                     __entry->in_flight,
+                     __entry->pmtud_jumbo)
+           );
+
 TRACE_EVENT(rxrpc_rx_data,
            TP_PROTO(unsigned int call, rxrpc_seq_t seq,
                     rxrpc_serial_t serial, u8 flags),
index 3379adfaaf65f43dd3e726e21601b7ac45415883..1f716f09d441537ef69d0b77b2be8387a83c0fab 100644 (file)
@@ -259,6 +259,8 @@ static void rxrpc_decant_prepared_tx(struct rxrpc_call *call)
                if (list_empty(&call->tx_sendmsg))
                        break;
 
+               trace_rxrpc_transmit(call, space);
+
                spin_lock(&call->tx_lock);
                do {
                        txb = list_first_entry(&call->tx_sendmsg,