This is an automated email from the ASF dual-hosted git repository. davids5 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit c51e2a0cb379470748422ba0c081f4f589d2bbab Author: YAMAMOTO Takashi <[email protected]> AuthorDate: Fri Feb 12 14:16:20 2021 +0900 esp32_imm.c: Report the usage with procfs_register_meminfo --- arch/xtensa/src/esp32/esp32_imm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/xtensa/src/esp32/esp32_imm.c b/arch/xtensa/src/esp32/esp32_imm.c index 163f88e..03617a2 100644 --- a/arch/xtensa/src/esp32/esp32_imm.c +++ b/arch/xtensa/src/esp32/esp32_imm.c @@ -25,6 +25,7 @@ #include <nuttx/config.h> #include <nuttx/arch.h> +#include <nuttx/fs/procfs.h> #include <nuttx/mm/mm.h> #include <malloc.h> @@ -58,6 +59,15 @@ void xtensa_imm_initialize(void) start = (FAR void *)&_sheap; size = CONFIG_XTENSA_IMEM_REGION_SIZE; mm_initialize(&g_iheap, start, size); + +#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMINFO) + static struct procfs_meminfo_entry_s g_imm_procfs; + + g_imm_procfs.name = "esp32-imem"; + g_imm_procfs.mallinfo = (void *)mm_mallinfo; + g_imm_procfs.user_data = &g_iheap; + procfs_register_meminfo(&g_imm_procfs); +#endif } /****************************************************************************
