linma / rpms / iproute

Forked from rpms/iproute 4 years ago
Clone

Blame SOURCES/0018-ss-add-support-for-segs_in-and-segs_out.patch

049c96
From bf3cb083a64373edcad8ef43fe1fdf7ebdd27cb4 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 segs_in and segs_out
049c96
049c96
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1269114
049c96
Upstream Status: iproute2.git commit ecb435eacd501
049c96
049c96
commit ecb435eacd50161d2a7cce5731a269ef916c0dd4
049c96
Author: Craig Gallek <kraig@google.com>
049c96
Date:   Tue May 26 14:54:41 2015 -0400
049c96
049c96
    ss: add support for segs_in and segs_out
049c96
049c96
    Two new tcp_info fields: tcpi_segs_in and tcpi_segs_out.
049c96
    (2efd055c53c06b7e89c167c98069bab9afce7e59)
049c96
049c96
    ~: ss -ti src :22
049c96
    	 cubic wscale:7,6 rto:201 rtt:0.244/0.012 ato:40 mss:1418 cwnd:21 bytes_acked:80605 bytes_received:20491 segs_out:414 segs_in:600 send 976.3Mbps lastsnd:23 lastrcv:23 lastack:22 pacing_rate 1952.7Mbps rcv_rtt:98 rcv_space:28960
049c96
049c96
    Signed-off-by: Craig Gallek <kraig@google.com>
049c96
    Reviewed-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
049c96
---
049c96
 misc/ss.c | 8 ++++++++
049c96
 1 file changed, 8 insertions(+)
049c96
049c96
diff --git a/misc/ss.c b/misc/ss.c
049c96
index b1e8a8c..7750887 100644
049c96
--- a/misc/ss.c
049c96
+++ b/misc/ss.c
049c96
@@ -763,6 +763,8 @@ struct tcpstat
049c96
 	double		    pacing_rate_max;
049c96
 	unsigned long long  bytes_acked;
049c96
 	unsigned long long  bytes_received;
049c96
+	unsigned int	    segs_out;
049c96
+	unsigned int	    segs_in;
049c96
 	unsigned int	    unacked;
049c96
 	unsigned int	    retrans;
049c96
 	unsigned int	    retrans_total;
049c96
@@ -1689,6 +1691,10 @@ static void tcp_stats_print(struct tcpstat *s)
049c96
 		printf(" bytes_acked:%llu", s->bytes_acked);
049c96
 	if (s->bytes_received)
049c96
 		printf(" bytes_received:%llu", s->bytes_received);
049c96
+	if (s->segs_out)
049c96
+		printf(" segs_out:%u", s->segs_out);
049c96
+	if (s->segs_in)
049c96
+		printf(" segs_in:%u", s->segs_in);
049c96
 
049c96
 	if (s->dctcp && s->dctcp->enabled) {
049c96
 		struct dctcpstat *dctcp = s->dctcp;
049c96
@@ -1983,6 +1989,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
049c96
 		}
049c96
 		s.bytes_acked = info->tcpi_bytes_acked;
049c96
 		s.bytes_received = info->tcpi_bytes_received;
049c96
+		s.segs_out = info->tcpi_segs_out;
049c96
+		s.segs_in = info->tcpi_segs_in;
049c96
 		tcp_stats_print(&s);
049c96
 		if (s.dctcp)
049c96
 			free(s.dctcp);
049c96
-- 
049c96
1.8.3.1
049c96