From 7bb849535c798866ea45c9252aacebb7b527982b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 12 Feb 2021 14:20:54 +0900 Subject: [PATCH] esp32_modtext.c: Report the usage with procfs_register_meminfo --- arch/xtensa/src/esp32/esp32_modtext.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/xtensa/src/esp32/esp32_modtext.c b/arch/xtensa/src/esp32/esp32_modtext.c index fc7d78daf6d..85586616126 100644 --- a/arch/xtensa/src/esp32/esp32_modtext.c +++ b/arch/xtensa/src/esp32/esp32_modtext.c @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -57,6 +58,15 @@ struct mm_heap_s g_module_text; void up_module_text_init() { mm_initialize(&g_module_text, &_smodtext, &_emodtext - &_smodtext); + +#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMINFO) + static struct procfs_meminfo_entry_s g_modtext_procfs; + + g_modtext_procfs.name = "modtext"; + g_modtext_procfs.mallinfo = (void *)mm_mallinfo; + g_modtext_procfs.user_data = &g_module_text; + procfs_register_meminfo(&g_modtext_procfs); +#endif } /****************************************************************************