#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"
#endif
+#ifdef RTE_LIBRTE_LATENCY_STATS
+
+/*
+ * Set when latency stats is enabled in the commandline
+ */
+uint8_t latencystats_enabled;
+
+/*
+ * Lcore ID to serive latency statistics.
+ */
+lcoreid_t latencystats_lcore_id = -1;
+
+#endif
+
/*
* Ethernet device configuration.
*/
tics_datum = tics_current;
}
#endif
+#ifdef RTE_LIBRTE_LATENCY_STATS
+ if (latencystats_lcore_id == rte_lcore_id())
+ rte_latencystats_update();
+#endif
+
} while (! fc->stopped);
}
#ifdef RTE_LIBRTE_PDUMP
/* uninitialize packet capture framework */
rte_pdump_uninit();
+#endif
+#ifdef RTE_LIBRTE_LATENCY_STATS
+ rte_latencystats_uninit();
#endif
force_quit();
/* exit with the expected status */
/* Init metrics library */
rte_metrics_init(rte_socket_id());
+#ifdef RTE_LIBRTE_LATENCY_STATS
+ if (latencystats_enabled != 0) {
+ int ret = rte_latencystats_init(1, NULL);
+ if (ret)
+ printf("Warning: latencystats init()"
+ " returned error %d\n", ret);
+ printf("Latencystats running on lcore %d\n",
+ latencystats_lcore_id);
+ }
+#endif
+
/* Setup bitrate stats */
#ifdef RTE_LIBRTE_BITRATE
bitrate_data = rte_stats_bitrate_create();