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/main.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/vlib/main.h') diff --git a/src/vlib/main.h b/src/vlib/main.h index 91661fdaaad..4c6d0f490dd 100644 --- a/src/vlib/main.h +++ b/src/vlib/main.h @@ -84,9 +84,8 @@ typedef struct vlib_main_t u32 node_counts_per_main_loop[2]; /* Main loop hw / sw performance counters */ - u64 (*vlib_node_runtime_perf_counter_cb) (struct vlib_main_t *); - int perf_counter_id; - int perf_counter_fd; + void (*vlib_node_runtime_perf_counter_cb) (struct vlib_main_t *, + u64 *, u64 *); /* Every so often we switch to the next counter. */ #define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE 7 -- cgit 1.2.3-korg