]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: add support for bytes_acked & bytes_received
authorEric Dumazet <edumazet@google.com>
Mon, 11 May 2015 17:03:49 +0000 (10:03 -0700)
committerStephen Hemminger <shemming@brocade.com>
Thu, 21 May 2015 22:21:04 +0000 (15:21 -0700)
tcp_info has 2 new fields : bytes_acked & bytes_received

$ ss -ti src :22
...
 cubic wscale:7,6 rto:234 rtt:33.199/17.225 ato:17.225 mss:1418 cwnd:9
ssthresh:9 send 3.1Mbps lastsnd:3 lastrcv:4 lastack:193
bytes_acked:188396 bytes_received:13639 pacing_rate 6.2Mbps unacked:1
retrans:0/4 reordering:4 rcv_rtt:47.25 rcv_space:28960

Signed-off-by: Eric Dumazet <edumazet@google.com>
misc/ss.c

index 347e3a12d082199aa392e1169604026e58b1d0e2..dba0901791c7b954aa35152379ca4a643114b27a 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -767,6 +767,8 @@ struct tcpstat
        unsigned int        lastack;
        double              pacing_rate;
        double              pacing_rate_max;
+       unsigned long long  bytes_acked;
+       unsigned long long  bytes_received;
        unsigned int        unacked;
        unsigned int        retrans;
        unsigned int        retrans_total;
@@ -1689,6 +1691,11 @@ static void tcp_stats_print(struct tcpstat *s)
        if (s->ssthresh)
                printf(" ssthresh:%d", s->ssthresh);
 
+       if (s->bytes_acked)
+               printf(" bytes_acked:%llu", s->bytes_acked);
+       if (s->bytes_received)
+               printf(" bytes_received:%llu", s->bytes_received);
+
        if (s->dctcp && s->dctcp->enabled) {
                struct dctcpstat *dctcp = s->dctcp;
 
@@ -1981,6 +1988,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
                                        info->tcpi_max_pacing_rate != ~0ULL)
                                s.pacing_rate_max = info->tcpi_max_pacing_rate * 8.;
                }
+               s.bytes_acked = info->tcpi_bytes_acked;
+               s.bytes_received = info->tcpi_bytes_received;
                tcp_stats_print(&s);
                if (s.dctcp)
                        free(s.dctcp);