[dpdk-dev] [PATCH] app/testpmd: refine xstats show

Jianfeng Tan jianfeng.tan at intel.com
Wed Dec 21 10:09:36 CET 2016


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



More information about the dev mailing list