[dpdk-dev] [PATCH] app/testpmd: refine xstats show
Tan, Jianfeng
jianfeng.tan at intel.com
Wed Jan 18 07:46:03 CET 2017
Hi Pablo,
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Wednesday, January 18, 2017 12:04 AM
> To: Tan, Jianfeng; dev at 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 at dpdk.org] On Behalf Of Jianfeng Tan
> > Sent: Wednesday, December 21, 2016 9:10 AM
> > To: dev at 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 <jianfeng.tan at intel.com>
> > ---
> > 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 = 0; idx_xstat < cnt_xstats; idx_xstat++)
> > + for (idx_xstat = 0; idx_xstat < cnt_xstats; idx_xstat++) {
> > + if ((xstats[idx_xstat].value) == 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.
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
>
> Thanks,
> Pablo
More information about the dev
mailing list