X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Fcli.c;h=3cc95076914f1ab2e7e460db9d1e47d897e8a1af;hb=586afd762bfa149f5ca167bd5fd5a0cd59ce94fe;hp=2d14111585706b10141f8fb7e07254fb39f559da;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vlib/cli.c b/src/vlib/cli.c index 2d141115857..3cc95076914 100644 --- a/src/vlib/cli.c +++ b/src/vlib/cli.c @@ -39,6 +39,7 @@ #include #include +#include /* Root of all show commands. */ /* *INDENT-OFF* */ @@ -708,7 +709,7 @@ test_heap_validate (vlib_main_t * vm, unformat_input_t * input, { /* *INDENT-OFF* */ foreach_vlib_main({ - heap = clib_per_cpu_mheaps[this_vlib_main->cpu_index]; + heap = clib_per_cpu_mheaps[this_vlib_main->thread_index]; mheap = mheap_header(heap); mheap->flags |= MHEAP_FLAG_VALIDATE; // Turn off small object cache because it delays detection of errors @@ -721,7 +722,7 @@ test_heap_validate (vlib_main_t * vm, unformat_input_t * input, { /* *INDENT-OFF* */ foreach_vlib_main({ - heap = clib_per_cpu_mheaps[this_vlib_main->cpu_index]; + heap = clib_per_cpu_mheaps[this_vlib_main->thread_index]; mheap = mheap_header(heap); mheap->flags &= ~MHEAP_FLAG_VALIDATE; mheap->flags |= MHEAP_FLAG_SMALL_OBJECT_CACHE; @@ -732,7 +733,7 @@ test_heap_validate (vlib_main_t * vm, unformat_input_t * input, { /* *INDENT-OFF* */ foreach_vlib_main({ - heap = clib_per_cpu_mheaps[this_vlib_main->cpu_index]; + heap = clib_per_cpu_mheaps[this_vlib_main->thread_index]; mheap = mheap_header(heap); mheap_validate(heap); }); @@ -757,6 +758,25 @@ VLIB_CLI_COMMAND (cmd_test_heap_validate,static) = { }; /* *INDENT-ON* */ +static clib_error_t * +restart_cmd_fn (vlib_main_t * vm, unformat_input_t * input, + vlib_cli_command_t * cmd) +{ + char *newenviron[] = { NULL }; + + execve (vm->name, (char **) vm->argv, newenviron); + + return 0; +} + +/* *INDENT-OFF* */ +VLIB_CLI_COMMAND (restart_cmd,static) = { + .path = "restart", + .short_help = "restart process", + .function = restart_cmd_fn, +}; +/* *INDENT-ON* */ + #ifdef TEST_CODE /* * A trivial test harness to verify the per-process output_function