Accumulate the number of processed objects and the number of times each node is visited regardless of the compile time value of RTE_LIBRTE_GRAPH_STATS.
Accumulating these numbers do not bring much overhead when rte_rdtsc() isn't called. Signed-off-by: Robin Jarry <[email protected]> --- lib/graph/rte_graph_worker_common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h index 4ab53a533e4c..c87a6796a96e 100644 --- a/lib/graph/rte_graph_worker_common.h +++ b/lib/graph/rte_graph_worker_common.h @@ -209,11 +209,11 @@ __rte_node_process(struct rte_graph *graph, struct rte_node *node) start = rte_rdtsc(); rc = node->process(graph, node, objs, node->idx); node->total_cycles += rte_rdtsc() - start; - node->total_calls++; - node->total_objs += rc; } else { - node->process(graph, node, objs, node->idx); + rc = node->process(graph, node, objs, node->idx); } + node->total_calls++; + node->total_objs += rc; node->idx = 0; } -- 2.52.0

