naccyde / rpms / iproute

Forked from rpms/iproute 5 months ago
Clone

Blame SOURCES/0017-ss-add-support-for-bytes_acked-bytes_received.patch

049c96
From a4f7690739cb14ef83adfccebf32a628c9718ce0 Mon Sep 17 00:00:00 2001
049c96
From: Phil Sutter <psutter@redhat.com>
049c96
Date: Thu, 18 Feb 2016 13:36:34 +0100
049c96
Subject: [PATCH] ss: add support for bytes_acked & bytes_received
049c96
049c96
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1269114
049c96
Upstream Status: iproute2.git commit 1a4dda7103bcd
049c96
049c96
commit 1a4dda7103bcd5efcca72ffe03eef43318897dae
049c96
Author: Eric Dumazet <edumazet@google.com>
049c96
Date:   Mon May 11 10:03:49 2015 -0700
049c96
049c96
    ss: add support for bytes_acked & bytes_received
049c96
049c96
    tcp_info has 2 new fields : bytes_acked & bytes_received
049c96
049c96
    $ ss -ti src :22
049c96
    ...
049c96
    	 cubic wscale:7,6 rto:234 rtt:33.199/17.225 ato:17.225 mss:1418 cwnd:9
049c96
    ssthresh:9 send 3.1Mbps lastsnd:3 lastrcv:4 lastack:193
049c96
    bytes_acked:188396 bytes_received:13639 pacing_rate 6.2Mbps unacked:1
049c96
    retrans:0/4 reordering:4 rcv_rtt:47.25 rcv_space:28960
049c96
049c96
    Signed-off-by: Eric Dumazet <edumazet@google.com>
049c96
---
049c96
 misc/ss.c | 9 +++++++++
049c96
 1 file changed, 9 insertions(+)
049c96
049c96
diff --git a/misc/ss.c b/misc/ss.c
049c96
index b9b2081..b1e8a8c 100644
049c96
--- a/misc/ss.c
049c96
+++ b/misc/ss.c
049c96
@@ -761,6 +761,8 @@ struct tcpstat
049c96
 	unsigned int	    lastack;
049c96
 	double		    pacing_rate;
049c96
 	double		    pacing_rate_max;
049c96
+	unsigned long long  bytes_acked;
049c96
+	unsigned long long  bytes_received;
049c96
 	unsigned int	    unacked;
049c96
 	unsigned int	    retrans;
049c96
 	unsigned int	    retrans_total;
049c96
@@ -1683,6 +1685,11 @@ static void tcp_stats_print(struct tcpstat *s)
049c96
 	if (s->ssthresh)
049c96
 		printf(" ssthresh:%d", s->ssthresh);
049c96
 
049c96
+	if (s->bytes_acked)
049c96
+		printf(" bytes_acked:%llu", s->bytes_acked);
049c96
+	if (s->bytes_received)
049c96
+		printf(" bytes_received:%llu", s->bytes_received);
049c96
+
049c96
 	if (s->dctcp && s->dctcp->enabled) {
049c96
 		struct dctcpstat *dctcp = s->dctcp;
049c96
 
049c96
@@ -1974,6 +1981,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
049c96
 					info->tcpi_max_pacing_rate != ~0ULL)
049c96
 				s.pacing_rate_max = info->tcpi_max_pacing_rate * 8.;
049c96
 		}
049c96
+		s.bytes_acked = info->tcpi_bytes_acked;
049c96
+		s.bytes_received = info->tcpi_bytes_received;
049c96
 		tcp_stats_print(&s);
049c96
 		if (s.dctcp)
049c96
 			free(s.dctcp);
049c96
-- 
049c96
1.8.3.1
049c96