summaryrefslogtreecommitdiffstats
path: root/src/plugins/tracedump/tracedump.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/tracedump/tracedump.c')
-rw-r--r--src/plugins/tracedump/tracedump.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/tracedump/tracedump.c b/src/plugins/tracedump/tracedump.c
index ab86ef987e2..7c83ba25dc9 100644
--- a/src/plugins/tracedump/tracedump.c
+++ b/src/plugins/tracedump/tracedump.c
@@ -224,10 +224,10 @@ vl_api_trace_dump_t_handler (vl_api_trace_dump_t * mp)
if (vec_len (client_trace_cache) == 0
&& (iterator_thread_id != ~0 || iterator_position != ~0))
{
- vlib_worker_thread_barrier_sync (&vlib_global_main);
+ vlib_worker_thread_barrier_sync (vlib_get_first_main ());
/* Make a slot for each worker thread */
- vec_validate (client_trace_cache, vec_len (vlib_mains) - 1);
+ vec_validate (client_trace_cache, vlib_get_n_threads () - 1);
i = 0;
/* *INDENT-OFF* */
@@ -250,7 +250,7 @@ vl_api_trace_dump_t_handler (vl_api_trace_dump_t * mp)
i++;
}));
/* *INDENT-ON* */
- vlib_worker_thread_barrier_release (&vlib_global_main);
+ vlib_worker_thread_barrier_release (vlib_get_first_main ());
}
/* Save the cache, one way or the other */
@@ -268,7 +268,8 @@ vl_api_trace_dump_t_handler (vl_api_trace_dump_t * mp)
vec_reset_length (s);
- s = format (s, "%U", format_vlib_trace, &vlib_global_main, th[0]);
+ s =
+ format (s, "%U", format_vlib_trace, vlib_get_first_main (), th[0]);
dmp = vl_msg_api_alloc (sizeof (*dmp) + vec_len (s));
dmp->_vl_msg_id =