summaryrefslogtreecommitdiffstats
path: root/src/vlib/cli.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-03-01 15:51:18 +0100
committerDamjan Marion <dmarion@me.com>2022-03-09 13:51:31 +0000
commit8973b07eecbbfe23a5267975f8052a5c6339c756 (patch)
treefe4d3507ff24c18743d3241cd9ab049ee2add062 /src/vlib/cli.c
parent317cace6185ae134d78a38e1a20249baf751035e (diff)
stats: refactor
Type: refactor Change-Id: Ifd533a095d979dc55bfbe5fac7e0b7510a4d900c Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/cli.c')
-rw-r--r--src/vlib/cli.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/vlib/cli.c b/src/vlib/cli.c
index a00ae6245f9..2187d2886fc 100644
--- a/src/vlib/cli.c
+++ b/src/vlib/cli.c
@@ -38,6 +38,7 @@
*/
#include <vlib/vlib.h>
+#include <vlib/stats/stats.h>
#include <vlib/unix/unix.h>
#include <vppinfra/callback.h>
#include <vppinfra/cpu.h>
@@ -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... */