procfs: add heap info for every task

cat /proc/2/heap
AllocSize:  512
AllocBlks:  10

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong
2022-02-26 14:32:42 +08:00
committed by Xiang Xiao
parent 2dcc4a359d
commit 7ae3c572dc
6 changed files with 181 additions and 0 deletions
+12
View File
@@ -52,6 +52,15 @@ struct mallinfo
* by free (not in use) chunks. */
};
#ifdef CONFIG_DEBUG_MM
struct mallinfo_task
{
pid_t pid; /* The pid of task */
int aordblks; /* This is the number of allocated (in use) chunks for task */
int uordblks; /* This is the total size of memory occupied for task */
};
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
@@ -63,6 +72,9 @@ extern "C"
struct mallinfo mallinfo(void);
size_t malloc_size(FAR void *ptr);
#ifdef CONFIG_DEBUG_MM
struct mallinfo_task mallinfo_task(pid_t pid);
#endif
#if defined(__cplusplus)
}