From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C277537B0 for ; Wed, 18 Jan 2017 07:46:07 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 17 Jan 2017 22:46:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,248,1477983600"; d="scan'208";a="1114305725" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 17 Jan 2017 22:46:06 -0800 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 17 Jan 2017 22:46:06 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 17 Jan 2017 22:46:06 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Wed, 18 Jan 2017 14:46:04 +0800 From: "Tan, Jianfeng" To: "De Lara Guarch, Pablo" , "dev@dpdk.org" CC: "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: refine xstats show Thread-Index: AQHSW2nowFH9/9VMJU63AWb7IR0N66E8ecQAgAF6ZJA= Date: Wed, 18 Jan 2017 06:46:03 +0000 Message-ID: References: <1482311376-38091-1-git-send-email-jianfeng.tan@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: refine xstats show X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 06:46:08 -0000 Hi Pablo, > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Wednesday, January 18, 2017 12:04 AM > To: Tan, Jianfeng; dev@dpdk.org > Cc: Wu, Jingjing; Tan, Jianfeng > Subject: RE: [dpdk-dev] [PATCH] app/testpmd: refine xstats show >=20 > Hi Jianfeng, >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jianfeng Tan > > Sent: Wednesday, December 21, 2016 9:10 AM > > To: dev@dpdk.org > > Cc: Wu, Jingjing; Tan, Jianfeng > > Subject: [dpdk-dev] [PATCH] app/testpmd: refine xstats show > > > > When using "show port xstats all" command to show xstats, the output > > is usually too long to obtain what you really want, expecially when > > multi-queue is enabled. > > > > This patch refines this situation by skipping showing those with value > > of zero. > > > > Signed-off-by: Jianfeng Tan > > --- > > app/test-pmd/config.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > > index 36c47ab..1adef29 100644 > > --- a/app/test-pmd/config.c > > +++ b/app/test-pmd/config.c > > @@ -304,10 +304,13 @@ nic_xstats_display(portid_t port_id) > > } > > > > /* Display xstats */ > > - for (idx_xstat =3D 0; idx_xstat < cnt_xstats; idx_xstat++) > > + for (idx_xstat =3D 0; idx_xstat < cnt_xstats; idx_xstat++) { > > + if ((xstats[idx_xstat].value) =3D=3D 0) > > + continue; > > printf("%s: %"PRIu64"\n", > > xstats_names[idx_xstat].name, > > xstats[idx_xstat].value); > > + } > > free(xstats_names); > > free(xstats); > > } > > -- > > 2.7.4 >=20 > I think this is a good idea, but I would give the user the option to do t= his, as > sometimes it is useful to actually show statistics with value 0. Make sense. > Could you extend the show port xstats command to accept a new parameter > instead? OK. > It would be nice to have something loke show port xstats all hide-zeros, > maybe? How about "nz" for non-zero? Thanks, Jianfeng >=20 > Thanks, > Pablo