app/testpmd: disable latency stats by default
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 4 May 2017 16:28:48 +0000 (17:28 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 6 May 2017 08:00:41 +0000 (10:00 +0200)
Disable latency stats gathering by default,
so there is not performance degradation if user
is not interested in them.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
app/test-pmd/testpmd.c

index 5c4d201..b39cd63 100644 (file)
@@ -971,7 +971,8 @@ run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd)
                }
 #endif
 #ifdef RTE_LIBRTE_LATENCY_STATS
-               if (latencystats_lcore_id == rte_lcore_id())
+               if (latencystats_enabled != 0 &&
+                               latencystats_lcore_id == rte_lcore_id())
                        rte_latencystats_update();
 #endif
 
@@ -2238,10 +2239,13 @@ main(int argc, char** argv)
                rte_panic("Empty set of forwarding logical cores - check the "
                          "core mask supplied in the command parameters\n");
 
-       /* Bitrate stats disabled by default */
+       /* Bitrate/latency stats disabled by default */
 #ifdef RTE_LIBRTE_BITRATE
        bitrate_enabled = 0;
 #endif
+#ifdef RTE_LIBRTE_LATENCY_STATS
+       latencystats_enabled = 0;
+#endif
 
        argc -= diag;
        argv += diag;