Skip to content

Commit 24990d8

Browse files
edumazetkuba-moo
authored andcommitted
trace: tcp: add three metrics to trace_tcp_rcvbuf_grow()
While chasing yet another receive autotuning bug, I found useful to add rcv_ssthresh, window_clamp and rcv_wnd. tcp_stream 40597 [068] 2172.978198: tcp:tcp_rcvbuf_grow: time=50307 rtt_us=50179 copied=77824 inq=0 space=40960 ooo=0 scaling_ratio=219 rcvbuf=131072 rcv_ssthresh=107474 window_clamp=112128 rcv_wnd=110592 tcp_stream 40597 [068] 2173.028528: tcp:tcp_rcvbuf_grow: time=50336 rtt_us=50206 copied=110592 inq=0 space=77824 ooo=0 scaling_ratio=219 rcvbuf=509444 rcv_ssthresh=328658 window_clamp=435813 rcv_wnd=331776 tcp_stream 40597 [068] 2173.078830: tcp:tcp_rcvbuf_grow: time=50305 rtt_us=50070 copied=270336 inq=0 space=110592 ooo=0 scaling_ratio=219 rcvbuf=509444 rcv_ssthresh=431159 window_clamp=435813 rcv_wnd=434176 tcp_stream 40597 [068] 2173.129137: tcp:tcp_rcvbuf_grow: time=50313 rtt_us=50118 copied=434176 inq=0 space=270336 ooo=0 scaling_ratio=219 rcvbuf=2457847 rcv_ssthresh=1299511 window_clamp=2102611 rcv_wnd=1302528 tcp_stream 40597 [068] 2173.179451: tcp:tcp_rcvbuf_grow: time=50318 rtt_us=50041 copied=1019904 inq=0 space=434176 ooo=0 scaling_ratio=219 rcvbuf=2457847 rcv_ssthresh=2087445 window_clamp=2102611 rcv_wnd=2088960 Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Neal Cardwell <ncardwell@google.com> Link: https://patch.msgid.link/20251028-net-tcp-recv-autotune-v3-2-74b43ba4c84c@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a6f0459 commit 24990d8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • include/trace/events

include/trace/events/tcp.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ TRACE_EVENT(tcp_rcvbuf_grow,
218218
__field(__u32, space)
219219
__field(__u32, ooo_space)
220220
__field(__u32, rcvbuf)
221+
__field(__u32, rcv_ssthresh)
222+
__field(__u32, window_clamp)
223+
__field(__u32, rcv_wnd)
221224
__field(__u8, scaling_ratio)
222225
__field(__u16, sport)
223226
__field(__u16, dport)
@@ -245,6 +248,9 @@ TRACE_EVENT(tcp_rcvbuf_grow,
245248
tp->rcv_nxt;
246249

247250
__entry->rcvbuf = sk->sk_rcvbuf;
251+
__entry->rcv_ssthresh = tp->rcv_ssthresh;
252+
__entry->window_clamp = tp->window_clamp;
253+
__entry->rcv_wnd = tp->rcv_wnd;
248254
__entry->scaling_ratio = tp->scaling_ratio;
249255
__entry->sport = ntohs(inet->inet_sport);
250256
__entry->dport = ntohs(inet->inet_dport);
@@ -264,11 +270,14 @@ TRACE_EVENT(tcp_rcvbuf_grow,
264270
),
265271

266272
TP_printk("time=%u rtt_us=%u copied=%u inq=%u space=%u ooo=%u scaling_ratio=%u rcvbuf=%u "
273+
"rcv_ssthresh=%u window_clamp=%u rcv_wnd=%u "
267274
"family=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 "
268275
"saddrv6=%pI6c daddrv6=%pI6c skaddr=%p sock_cookie=%llx",
269276
__entry->time, __entry->rtt_us, __entry->copied,
270277
__entry->inq, __entry->space, __entry->ooo_space,
271278
__entry->scaling_ratio, __entry->rcvbuf,
279+
__entry->rcv_ssthresh, __entry->window_clamp,
280+
__entry->rcv_wnd,
272281
show_family_name(__entry->family),
273282
__entry->sport, __entry->dport,
274283
__entry->saddr, __entry->daddr,

0 commit comments

Comments
 (0)