[dpdk-dev] [PATCH v7 6/6] app/test-pmd: add latency statistics calculation

Remy Horton remy.horton at intel.com
Mon Jan 16 17:19:33 CET 2017


From: Reshma Pattan <reshma.pattan at intel.com>

Modify testpmd code to initialize/uninitialize latency statistics
calulation.

Signed-off-by: Reshma Pattan <reshma.pattan at intel.com>
Signed-off-by: Remy Horton <remy.horton at intel.com>
---
 app/test-pmd/testpmd.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index a0b7430..2874ce4 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -83,6 +83,10 @@
 #ifdef RTE_LIBRTE_BITRATE
 #include <rte_bitrate.h>
 #endif
+#include <rte_metrics.h>
+#ifdef RTE_LIBRTE_LATENCY_STATS
+#include <rte_latencystats.h>
+#endif
 
 #include "testpmd.h"
 
@@ -2108,6 +2112,9 @@ signal_handler(int signum)
 		/* uninitialize packet capture framework */
 		rte_pdump_uninit();
 #endif
+#ifdef RTE_LIBRTE_LATENCY_STATS
+		rte_latencystats_uninit();
+#endif
 		force_quit();
 		/* exit with the expected status */
 		signal(signum, SIG_DFL);
@@ -2165,6 +2172,9 @@ main(int argc, char** argv)
 	/* set all ports to promiscuous mode by default */
 	FOREACH_PORT(port_id, ports)
 		rte_eth_promiscuous_enable(port_id);
+#ifdef RTE_LIBRTE_LATENCY_STATS
+	rte_latencystats_init(1, NULL);
+#endif
 
 	/* Setup bitrate stats */
 #ifdef RTE_LIBRTE_BITRATE
-- 
2.5.5



More information about the dev mailing list