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 D13DEFC26 for ; Wed, 21 Dec 2016 10:08:58 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 21 Dec 2016 01:08:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,382,1477983600"; d="scan'208";a="914725203" Received: from dpdk06.sh.intel.com ([10.239.129.195]) by orsmga003.jf.intel.com with ESMTP; 21 Dec 2016 01:08:56 -0800 From: Jianfeng Tan To: dev@dpdk.org Cc: jingjing.wu@intel.com, Jianfeng Tan Date: Wed, 21 Dec 2016 09:09:36 +0000 Message-Id: <1482311376-38091-1-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [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, 21 Dec 2016 09:08:59 -0000 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 = 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