[dpdk-dev] [PATCH] app/testpmd: refine xstats show
    De Lara Guarch, Pablo 
    pablo.de.lara.guarch at intel.com
       
    Tue Jan 17 17:04:16 CET 2017
    
    
  
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.
Could you extend the show port xstats command to accept a new parameter instead?
It would be nice to have something loke show port xstats all hide-zeros, maybe?
Thanks,
Pablo
    
    
More information about the dev
mailing list