summaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-05-20 10:28:57 -0400
committerDamjan Marion <dmarion@me.com>2019-05-24 08:25:57 +0000
commit5f2cfb21fdf6eb4a32346809c8cee2550d775b19 (patch)
treee54364d08bd2dc2f851df3f0aa9a0689e9569635 /src/vlib/main.c
parentaea0df3d54d90eac3b8085ab8023c502b96bdbf0 (diff)
Add callback multiplex support
Change-Id: Iddeb3a1b0e20706e72ec8f74dabc60b342f003ba Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r--src/vlib/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index 759c1d0ec0d..b6006e8bab0 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -687,9 +687,9 @@ vlib_node_runtime_perf_counter (vlib_main_t * vm, u64 * pmc0, u64 * pmc1,
{
*pmc0 = 0;
*pmc1 = 0;
- if (PREDICT_FALSE (vm->vlib_node_runtime_perf_counter_cb != 0))
- (*vm->vlib_node_runtime_perf_counter_cb) (vm, pmc0, pmc1, node,
- frame, before_or_after);
+ if (PREDICT_FALSE (vec_len (vm->vlib_node_runtime_perf_counter_cbs) != 0))
+ clib_call_callbacks (vm->vlib_node_runtime_perf_counter_cbs, vm, pmc0,
+ pmc1, node, frame, before_or_after);
}
always_inline void
@@ -1760,9 +1760,8 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main)
else
frame_queue_check_counter--;
}
- if (PREDICT_FALSE (vm->worker_thread_main_loop_callback != 0))
- ((void (*)(vlib_main_t *)) vm->worker_thread_main_loop_callback)
- (vm);
+ if (PREDICT_FALSE (vec_len (vm->worker_thread_main_loop_callbacks)))
+ clib_call_callbacks (vm->worker_thread_main_loop_callbacks, vm);
}
/* Process pre-input nodes. */