summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-10-06 17:46:06 +0200
committerDamjan Marion <damarion@cisco.com>2020-10-06 23:47:33 +0200
commitbfa75d6b922ee15d2f0d00999fd36b03a85eda8c (patch)
treeddd1341db08ae2020c37333d31c949d883ef6bc2 /src/vlib
parentab1a50cf7407e31097b550226c2b6954d6371bea (diff)
vppinfra: add heap header in front of dlmalloc space
This patch adds smal header in front of dlmalloc space, and it stores some additional information about the heap. Immediate benefit of this patch is that we know the underlying page size si we can display heap page statistics / real memory usage. Type: improvement Change-Id: Ibd6989cc2f2f64630ab08734c9552e15029c5f3f Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/cli.c11
-rw-r--r--src/vlib/threads.c2
2 files changed, 1 insertions, 12 deletions
diff --git a/src/vlib/cli.c b/src/vlib/cli.c
index c485f967bcd..a88bd3a62f6 100644
--- a/src/vlib/cli.c
+++ b/src/vlib/cli.c
@@ -827,13 +827,8 @@ show_memory_usage (vlib_main_t * vm,
/* *INDENT-OFF* */
foreach_vlib_main (
({
- void *heap = mm->per_cpu_mheaps[index];
-
vlib_cli_output (vm, "%sThread %d %s\n", index ? "\n":"", index,
vlib_worker_threads[index].name);
- vlib_cli_output (vm, " %U\n", format_page_map,
- pointer_to_uword (clib_mem_get_heap_base(heap)),
- clib_mem_get_heap_size (heap));
vlib_cli_output (vm, " %U\n", format_clib_mem_heap,
mm->per_cpu_mheaps[index],
verbose);
@@ -846,8 +841,6 @@ show_memory_usage (vlib_main_t * vm,
}
if (numa_heaps)
{
- void *heap;
-
for (i = 0; i < ARRAY_LEN (mm->per_numa_mheaps); i++)
{
if (mm->per_numa_mheaps[i] == 0)
@@ -858,12 +851,8 @@ show_memory_usage (vlib_main_t * vm,
continue;
}
was_enabled = clib_mem_trace_enable_disable (0);
- heap = mm->per_numa_mheaps[i];
vlib_cli_output (vm, "Numa %d:", i);
- vlib_cli_output (vm, " %U\n", format_page_map,
- pointer_to_uword (clib_mem_get_heap_base (heap)),
- clib_mem_get_heap_size (heap));
vlib_cli_output (vm, " %U\n", format_clib_mem_heap,
mm->per_numa_mheaps[index], verbose);
}
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index 64af8a0d617..749770f9597 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -685,7 +685,7 @@ start_workers (vlib_main_t * vm)
vlib_node_runtime_t *rt;
u32 n_vlib_mains = tm->n_vlib_mains;
u32 worker_thread_index;
- u8 *main_heap = clib_mem_get_per_cpu_heap ();
+ clib_mem_heap_t *main_heap = clib_mem_get_per_cpu_heap ();
vec_reset_length (vlib_worker_threads);