From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id F329E1094 for ; Tue, 17 Jan 2017 17:04:19 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 17 Jan 2017 08:04:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,245,1477983600"; d="scan'208";a="1113969655" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 17 Jan 2017 08:04:17 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX103.ger.corp.intel.com ([163.33.3.157]) with mapi id 14.03.0248.002; Tue, 17 Jan 2017 16:04:16 +0000 From: "De Lara Guarch, Pablo" To: "Tan, Jianfeng" , "dev@dpdk.org" CC: "Wu, Jingjing" , "Tan, Jianfeng" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: refine xstats show Thread-Index: AQHSW2n+LL/IqgCwCE6lxH11zvSrQ6E8+I+w Date: Tue, 17 Jan 2017 16:04:16 +0000 Message-ID: References: <1482311376-38091-1-git-send-email-jianfeng.tan@intel.com> In-Reply-To: <1482311376-38091-1-git-send-email-jianfeng.tan@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGU0Nzc1NjUtZTE5Yy00NDI0LTliNWMtZDU1MzFjZGFmZGM2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IldzMjlRRWdkZG1nVEZFaExVQVwvYWpHYWdyY2w3R3N3OWwzZzBBQ0l3M0M0PSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] 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: Tue, 17 Jan 2017 16:04:20 -0000 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 >=20 > 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. >=20 > This patch refines this situation by skipping showing those with value > of zero. >=20 > Signed-off-by: Jianfeng Tan > --- > app/test-pmd/config.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > 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) > } >=20 > /* 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 thi= s, as sometimes it is useful to actually show statistics with value 0. Could you extend the show port xstats command to accept a new parameter ins= tead? It would be nice to have something loke show port xstats all hide-zeros, ma= ybe? Thanks, Pablo