From mboxrd@z Thu Jan 1 00:00:00 1970 From: "De Lara Guarch, Pablo" Subject: Re: [PATCH] app/testpmd: refine xstats show Date: Wed, 18 Jan 2017 09:02:54 +0000 Message-ID: References: <1482311376-38091-1-git-send-email-jianfeng.tan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Wu, Jingjing" To: "Tan, Jianfeng" , "dev@dpdk.org" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id EF19A58CD for ; Wed, 18 Jan 2017 10:02:56 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Jianfeng, > -----Original Message----- > From: Tan, Jianfeng > Sent: Wednesday, January 18, 2017 6:46 AM > To: De Lara Guarch, Pablo; dev@dpdk.org > Cc: Wu, Jingjing > Subject: RE: [dpdk-dev] [PATCH] app/testpmd: refine xstats show >=20 > Hi Pablo, >=20 > > -----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 > > > > Hi Jianfeng, > > > > > -----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 valu= e > > > 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 > > > > I think this is a good idea, but I would give the user the option to do= this, > as > > sometimes it is useful to actually show statistics with value 0. >=20 > Make sense. >=20 > > Could you extend the show port xstats command to accept a new > parameter > > instead? >=20 > OK. >=20 > > It would be nice to have something loke show port xstats all hide-zeros= , > > maybe? >=20 > How about "nz" for non-zero? I would prefer the full name. If you want nonzero, that's ok for me, but th= ere is no need to make it shorter and not readable enough (I wouldn't know what nz= is). Thanks, Pablo >=20 > Thanks, > Jianfeng >=20 > > > > Thanks, > > Pablo