From ec595ef02639005b34334097af76b41ceef3dca5 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Thu, 24 Jan 2019 10:34:24 -0500 Subject: perfmon plugin: 2-way parallel stat collection As a FUD reduction measure, this patch implements 2-way parallel counter collection. Synthetic stat component counter pairs run at the same time. Running two counters (of any kind) at the same time naturally reduces the aggregate time required by an approximate factor-of-2, depending on whether an even or odd number of stats have been requested. I don't completely buy the argument that computing synthetic stats such as instructions-per-clock will be inaccurate if component counter values are collected sequentially. Given uniform traffic pattern, it must make no difference. As the collection interval increases, the difference between serial and parallel component counter collection will approach zero, see also the Central Limit theorem. Change-Id: I36ebdcf125e8882cca8a1929ec58f17fba1ad8f1 Signed-off-by: Dave Barach --- src/vlib/node.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vlib/node.h') diff --git a/src/vlib/node.h b/src/vlib/node.h index f41eb60aa2c..8bb89f44bc7 100644 --- a/src/vlib/node.h +++ b/src/vlib/node.h @@ -258,7 +258,8 @@ typedef struct u64 calls, vectors, clocks, suspends; u64 max_clock; u64 max_clock_n; - u64 perf_counter_ticks; + u64 perf_counter0_ticks; + u64 perf_counter1_ticks; u64 perf_counter_vectors; } vlib_node_stats_t; @@ -507,7 +508,8 @@ typedef struct vlib_node_runtime_t u32 vectors_since_last_overflow; /**< Number of vector elements processed by this node. */ - u32 perf_counter_ticks_since_last_overflow; /**< Perf counter ticks */ + u32 perf_counter0_ticks_since_last_overflow; /**< Perf counter 0 ticks */ + u32 perf_counter1_ticks_since_last_overflow; /**< Perf counter 1 ticks */ u32 perf_counter_vectors_since_last_overflow; /**< Perf counter vectors */ u32 next_frame_index; /**< Start of next frames for this -- cgit 1.2.3-korg