diff options
author | Damjan Marion <damarion@cisco.com> | 2021-03-26 13:45:37 +0100 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2021-03-26 16:33:42 +0100 |
commit | f553a2cbbb8cca84ebf033335ebd2cd26dc19d69 (patch) | |
tree | 3705c2c0121769dff96a122cef13886d5f0e5205 /src/vlib/main.c | |
parent | 6ffb7c61899eb782416cbd2f117042a583f189f7 (diff) |
vlib: introduce vlib_get_elog_main()
Type: improvement
Change-Id: I73383eb15186021cd6527d112da8443a0082f129
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r-- | src/vlib/main.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c index fc6fadb625e..62da7b9ff0a 100644 --- a/src/vlib/main.c +++ b/src/vlib/main.c @@ -694,7 +694,7 @@ static clib_error_t * vlib_cli_elog_clear (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { - elog_reset_buffer (&vm->elog_main); + elog_reset_buffer (&vlib_global_main.elog_main); return 0; } @@ -711,7 +711,7 @@ static clib_error_t * elog_save_buffer (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { - elog_main_t *em = &vm->elog_main; + elog_main_t *em = &vlib_global_main.elog_main; char *file, *chroot_file; clib_error_t *error = 0; @@ -765,7 +765,7 @@ static clib_error_t * elog_stop (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { - elog_main_t *em = &vm->elog_main; + elog_main_t *em = &vlib_global_main.elog_main; em->n_total_events_disable_limit = em->n_total_events; @@ -785,7 +785,7 @@ static clib_error_t * elog_restart (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { - elog_main_t *em = &vm->elog_main; + elog_main_t *em = &vlib_global_main.elog_main; em->n_total_events_disable_limit = ~0; @@ -805,11 +805,11 @@ static clib_error_t * elog_resize_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { - elog_main_t *em = &vm->elog_main; + elog_main_t *em = &vlib_global_main.elog_main; u32 tmp; /* Stop the parade */ - elog_reset_buffer (&vm->elog_main); + elog_reset_buffer (em); if (unformat (input, "%d", &tmp)) { @@ -836,7 +836,7 @@ VLIB_CLI_COMMAND (elog_resize_cli, static) = { static void elog_show_buffer_internal (vlib_main_t * vm, u32 n_events_to_show) { - elog_main_t *em = &vm->elog_main; + elog_main_t *em = &vlib_global_main.elog_main; elog_event_t *e, *es; f64 dt; @@ -902,7 +902,7 @@ vlib_elog_main_loop_event (vlib_main_t * vm, u64 time, u32 n_vectors, u32 is_return) { vlib_main_t *evm = &vlib_global_main; - elog_main_t *em = &evm->elog_main; + elog_main_t *em = vlib_get_elog_main (); int enabled = evm->elog_trace_graph_dispatch | evm->elog_trace_graph_circuit; @@ -1819,8 +1819,7 @@ vlib_add_del_post_mortem_callback (void *cb, int is_add) static void elog_post_mortem_dump (void) { - vlib_main_t *vm = &vlib_global_main; - elog_main_t *em = &vm->elog_main; + elog_main_t *em = vlib_get_elog_main (); u8 *filename; clib_error_t *error; @@ -1933,7 +1932,7 @@ vlib_main (vlib_main_t * volatile vm, unformat_input_t * input) if (vm->configured_elog_ring_size && vm->configured_elog_ring_size != vm->elog_main.event_ring_size) elog_resize (&vm->elog_main, vm->configured_elog_ring_size); - vl_api_set_elog_main (&vm->elog_main); + vl_api_set_elog_main (vlib_get_elog_main ()); (void) vl_api_set_elog_trace_api_messages (1); /* Default name. */ |