X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Fcli.c;h=2187d2886fc342594b30b652caa7537800e492e9;hb=8486283cd5efb6b3c78428658eed685c5e8469d7;hp=cad105f17c686de6e15f38a90603042b27e22abd;hpb=92ccf9bcd2692b4b415f31044560c735d639a35c;p=vpp.git diff --git a/src/vlib/cli.c b/src/vlib/cli.c index cad105f17c6..2187d2886fc 100644 --- a/src/vlib/cli.c +++ b/src/vlib/cli.c @@ -38,6 +38,7 @@ */ #include +#include #include #include #include @@ -753,13 +754,6 @@ vl_msg_pop_heap (void *oldheap) { } -void *vlib_stats_push_heap (void *) __attribute__ ((weak)); -void * -vlib_stats_push_heap (void *notused) -{ - return 0; -} - static clib_error_t * show_memory_usage (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) @@ -820,14 +814,14 @@ show_memory_usage (vlib_main_t * vm, } if (stats_segment) { - void *oldheap = vlib_stats_push_heap (0); + void *oldheap = vlib_stats_set_heap (0); was_enabled = clib_mem_trace_enable_disable (0); u8 *s_in_svm = format (0, "%U\n", format_clib_mem_heap, 0, 1); if (oldheap) clib_mem_set_heap (oldheap); u8 *s = vec_dup (s_in_svm); - oldheap = vlib_stats_push_heap (0); + oldheap = vlib_stats_set_heap (0); vec_free (s_in_svm); if (oldheap) { @@ -1038,7 +1032,7 @@ enable_disable_memory_trace (vlib_main_t * vm, /* Stats segment */ if (stats_segment) { - oldheap = vlib_stats_push_heap (0); + oldheap = vlib_stats_set_heap (); current_traced_heap = clib_mem_get_heap (); clib_mem_trace (stats_segment); /* We don't want to call vlib_stats_pop_heap... */ @@ -1224,6 +1218,9 @@ add_sub_command (vlib_cli_main_t * cm, uword parent_index, uword child_index) vec_add (sub_name, c->path + l + 1, vec_len (c->path) - (l + 1)); } + /* "Can't happen," check mainly to shut up coverity */ + ALWAYS_ASSERT (sub_name != 0); + if (sub_name[0] == '%') { uword *q;