aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/mem_dlmalloc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/vppinfra/mem_dlmalloc.c b/src/vppinfra/mem_dlmalloc.c
index bc6561a738e..f8d4ca19fd8 100644
--- a/src/vppinfra/mem_dlmalloc.c
+++ b/src/vppinfra/mem_dlmalloc.c
@@ -474,14 +474,17 @@ clib_mem_get_heap_usage (clib_mem_heap_t * heap, clib_mem_usage_t * usage)
{
struct dlmallinfo mi = mspace_mallinfo (heap->mspace);
- /* TODO: Fill in some more values */
+ usage->bytes_total = mi.arena; /* non-mmapped space allocated from system */
+ usage->bytes_used = mi.uordblks; /* total allocated space */
+ usage->bytes_free = mi.fordblks; /* total free space */
+ usage->bytes_used_mmap = mi.hblkhd; /* space in mmapped regions */
+ usage->bytes_max = mi.usmblks; /* maximum total allocated space */
+ usage->bytes_free_reclaimed = mi.ordblks; /* number of free chunks */
+ usage->bytes_overhead = mi.keepcost; /* releasable (via malloc_trim) space */
+
+ /* Not supported */
+ usage->bytes_used_sbrk = 0;
usage->object_count = 0;
- usage->bytes_total = mi.arena;
- usage->bytes_overhead = 0;
- usage->bytes_max = 0;
- usage->bytes_used = mi.uordblks;
- usage->bytes_free = mi.fordblks;
- usage->bytes_free_reclaimed = 0;
}
/* Call serial number for debugger breakpoints. */