From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [RFC iproute2-next 2/5] ss: make tcp_mem long Date: Wed, 2 May 2018 14:29:18 -0700 Message-ID: <20180502142918.574a2685@xeon-e3> References: <20180502202801.5255-1-stephen@networkplumber.org> <20180502202801.5255-3-stephen@networkplumber.org> <537df45c-f5d2-e06a-f66c-fe7cd322a255@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Eric Dumazet Return-path: Received: from mail-pf0-f196.google.com ([209.85.192.196]:46447 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbeEBV3V (ORCPT ); Wed, 2 May 2018 17:29:21 -0400 Received: by mail-pf0-f196.google.com with SMTP id p12so12856160pff.13 for ; Wed, 02 May 2018 14:29:21 -0700 (PDT) In-Reply-To: <537df45c-f5d2-e06a-f66c-fe7cd322a255@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 2 May 2018 14:08:53 -0700 Eric Dumazet wrote: > On 05/02/2018 01:27 PM, Stephen Hemminger wrote: > > The tcp_memory field in /proc/net/sockstat is formatted as > > a long value by kernel. Change ss to keep this as full value. > > > > Signed-off-by: Stephen Hemminger > > --- > > misc/ss.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/misc/ss.c b/misc/ss.c > > index 22c76e34f83b..c88a25581755 100644 > > --- a/misc/ss.c > > +++ b/misc/ss.c > > @@ -4589,7 +4589,7 @@ static int get_snmp_int(const char *proto, const char *key, int *result) > > > > struct ssummary { > > int socks; > > - int tcp_mem; > > + long tcp_mem; > > int tcp_total; > > int tcp_orphans; > > int tcp_tws; > > @@ -4629,7 +4629,7 @@ static void get_sockstat_line(char *line, struct ssummary *s) > > else if (strcmp(id, "FRAG6:") == 0) > > sscanf(rem, "%*s%d%*s%d", &s->frag6, &s->frag6_mem); > > else if (strcmp(id, "TCP:") == 0) > > - sscanf(rem, "%*s%d%*s%d%*s%d%*s%d%*s%d", > > + sscanf(rem, "%*s%d%*s%d%*s%d%*s%d%*s%ld", > > &s->tcp4_hashed, > > &s->tcp_orphans, &s->tcp_tws, &s->tcp_total, &s->tcp_mem); > > } > > > > Hi Stephen > > It seems nothing uses yet the value ? Yup. let's just drop it from the scan