This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 1ab58aff5594fe017cde73d852b6cb79f48120d0
Author: Jiuzhu Dong <dongjiuz...@xiaomi.com>
AuthorDate: Tue Mar 22 10:37:49 2022 +0800

    mm/heap: add MM_BACKTRACE_DEFAULT to config backtrace record by default
    
    Signed-off-by: Jiuzhu Dong <dongjiuz...@xiaomi.com>
---
 mm/Kconfig                 | 5 +++++
 mm/mm_heap/mm_initialize.c | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/mm/Kconfig b/mm/Kconfig
index 8746a20..c4f506a 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -186,4 +186,9 @@ config MM_KASAN
                bugs in native code. After turn on this option, Please
                add -fsanitize=kernel-address to CFLAGS/CXXFLAGS too.
 
+config MM_BACKTRACE_DEFAULT
+       bool "Enable the backtrace record by default"
+       default n
+       depends on DEBUG_MM
+
 source "mm/iob/Kconfig"
diff --git a/mm/mm_heap/mm_initialize.c b/mm/mm_heap/mm_initialize.c
index 096ebff..e32c63c 100644
--- a/mm/mm_heap/mm_initialize.c
+++ b/mm/mm_heap/mm_initialize.c
@@ -213,6 +213,9 @@ FAR struct mm_heap_s *mm_initialize(FAR const char *name,
 #if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
   heap->mm_procfs.name = name;
   heap->mm_procfs.heap = heap;
+#if defined (CONFIG_DEBUG_MM) && defined(CONFIG_MM_BACKTRACE_DEFAULT)
+  heap->mm_procfs.backtrace = true;
+#endif
   procfs_register_meminfo(&heap->mm_procfs);
 #endif
 #endif

Reply via email to