From patchwork Wed Oct 1 11:17:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 395481 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 929F314012E for ; Wed, 1 Oct 2014 21:17:21 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751526AbaJALRP (ORCPT ); Wed, 1 Oct 2014 07:17:15 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:47931 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382AbaJALRN (ORCPT ); Wed, 1 Oct 2014 07:17:13 -0400 Received: by mail-pa0-f53.google.com with SMTP id kq14so95906pab.12 for ; Wed, 01 Oct 2014 04:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type :content-transfer-encoding:mime-version; bh=DSHJ0as3WGQzSXtpYhkVyQKRcla5L8e5iDpP0WkZy30=; b=RJWrIeRmrFpfOHibXnjB6pYjetgitIS6whlczzu8I9eexrPmEb1OQkdINbnfD2mxbn OYtH7mfe9wdgbYjhmPzmxMGSi1GBWDZtniOqD1/Y4p2iZG9ioD6BfeirHYInA4/9VL4Z nY5EOYAnTho6+zqW3kMSZaE/0ClHIxbIfSiBiudzoI5DmzWoizzUoc+0IbKZ+0Je5+0Q C1d26h8HfZTjNxNlnALRYXc8Gi0Vq5nk4vw2CiYaajqO4q0jIGx2SRQd+YcPN2ZSXQ5t rIq8PqQlhd2Bz9bx6whRoDOilQPzaewQM41906O/ZQZrxC+kJFWW1chNFiGaCDV86CJg 62RA== X-Received: by 10.66.182.227 with SMTP id eh3mr78539408pac.68.1412162233283; Wed, 01 Oct 2014 04:17:13 -0700 (PDT) Received: from [172.26.55.31] ([172.26.55.31]) by mx.google.com with ESMTPSA id hz4sm792539pbc.22.2014.10.01.04.17.12 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Wed, 01 Oct 2014 04:17:12 -0700 (PDT) Message-ID: <1412162238.16704.50.camel@edumazet-glaptop2.roam.corp.google.com> Subject: [PATCH iproute2] ss: add more tcp socket diagnostics From: Eric Dumazet To: Stephen Hemminger Cc: netdev Date: Wed, 01 Oct 2014 04:17:18 -0700 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet Display 4 additional tcp socket info fields : backoff : exponential backoff lastsnd : time in milli second since last send lastrcv : time in milli second since last receive lastack : time in milli second since last acknowledgement $ ss -ti dst :22 State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 0 172.16.5.1:58470 172.17.131.143:ssh cubic wscale:7,7 rto:228 rtt:30/20 ato:40 mss:1256 cwnd:6 ssthresh:4 send 2.0Mbps lastsnd:3480 lastrcv:3464 lastack:3464 rcv_rtt:81.5 rcv_space:87812 Signed-off-by: Eric Dumazet --- misc/ss.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/misc/ss.c b/misc/ss.c index c847954..2420b51 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -1554,6 +1554,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, info->tcpi_rcv_wscale); if (info->tcpi_rto && info->tcpi_rto != 3000000) printf(" rto:%g", (double)info->tcpi_rto/1000); + if (info->tcpi_backoff) + printf(" backoff:%u", info->tcpi_backoff); if (info->tcpi_rtt) printf(" rtt:%g/%g", (double)info->tcpi_rtt/1000, (double)info->tcpi_rttvar/1000); @@ -1583,6 +1585,15 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, / rtt)); } + if (info->tcpi_last_data_sent) + printf(" lastsnd:%u", info->tcpi_last_data_sent); + + if (info->tcpi_last_data_recv) + printf(" lastrcv:%u", info->tcpi_last_data_recv); + + if (info->tcpi_last_ack_recv) + printf(" lastack:%u", info->tcpi_last_ack_recv); + if (info->tcpi_pacing_rate && info->tcpi_pacing_rate != ~0ULL) { printf(" pacing_rate %sbps",