aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/linux/mem.c
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/vppinfra/linux/mem.c
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/vppinfra/linux/mem.c')
-rw-r--r--src/vppinfra/linux/mem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vppinfra/linux/mem.c b/src/vppinfra/linux/mem.c
index 06e18cd400d..22268eadb8e 100644
--- a/src/vppinfra/linux/mem.c
+++ b/src/vppinfra/linux/mem.c
@@ -542,6 +542,8 @@ clib_mem_get_page_stats (void *start, clib_mem_page_sz_t log2_page_size,
ptr[i] = start + (i << log2_page_size);
clib_memset (stats, 0, sizeof (clib_mem_page_stats_t));
+ stats->total = n_pages;
+ stats->log2_page_sz = log2_page_size;
if (move_pages (0, n_pages, ptr, 0, status, 0) != 0)
{