summaryrefslogtreecommitdiffstats
path: root/src/plugins/perfmon/perfmon.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-12-02 17:08:02 +0100
committerDamjan Marion <dmarion@me.com>2021-12-02 17:49:49 +0000
commite31c48a66b966fa326a5ca813892201e7e3e054b (patch)
tree49c81986a9b0392c8dd5f0f35e3112a88fb5746e /src/plugins/perfmon/perfmon.c
parent3323e2018d6d736a25b15902bc85f559ea98adb5 (diff)
perfmon: compile dispatch wrapper once for each number of counters
A bit ugly, but generates faster and less noisy code which should be important for this particular use case. Type: improvement Change-Id: If2bba947dac33ffedb4236a5b3fb50fc783668e1 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/perfmon/perfmon.c')
-rw-r--r--src/plugins/perfmon/perfmon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/perfmon/perfmon.c b/src/plugins/perfmon/perfmon.c
index 09178929218..0f89708567c 100644
--- a/src/plugins/perfmon/perfmon.c
+++ b/src/plugins/perfmon/perfmon.c
@@ -285,8 +285,8 @@ perfmon_start (vlib_main_t *vm, perfmon_bundle_t *b)
}
for (int i = 0; i < vlib_get_n_threads (); i++)
- vlib_node_set_dispatch_wrapper (vlib_get_main_by_index (i),
- perfmon_dispatch_wrapper);
+ vlib_node_set_dispatch_wrapper (
+ vlib_get_main_by_index (i), perfmon_dispatch_wrappers[b->n_events]);
}
pm->sample_time = vlib_time_now (vm);
pm->is_running = 1;