From 61657913187e4967ff6f5c8368dd91fa7b68edda Mon Sep 17 00:00:00 2001 From: buxiasen Date: Thu, 8 Aug 2024 22:01:15 +0800 Subject: [PATCH] mm: dump more information when failed dump detail Signed-off-by: buxiasen --- mm/mm_heap/mm_malloc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c index 7f9b455b69d64..c8cd761e2bdbe 100644 --- a/mm/mm_heap/mm_malloc.c +++ b/mm/mm_heap/mm_malloc.c @@ -381,6 +381,16 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size) mwarn("Dump leak memory(thread exit, but memory not free):\n"); dump.pid = PID_MM_LEAK; mm_memdump(heap, &dump); +# ifdef CONFIG_MM_HEAP_MEMPOOL + mwarn("Dump block used by mempool expand/trunk:\n"); + dump.pid = PID_MM_MEMPOOL; + mm_memdump(heap, &dump); +# endif +# if CONFIG_MM_BACKTRACE >= 0 + mwarn("Dump allocated orphan nodes. (neighbor of free nodes):\n"); + dump.pid = PID_MM_ORPHAN; + mm_memdump(heap, &dump); +# endif # endif #endif #ifdef CONFIG_MM_PANIC_ON_FAILURE