mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -296,11 +296,19 @@ void kmm_extend(FAR void *mem, size_t size, int region);
|
||||
|
||||
struct mallinfo; /* Forward reference */
|
||||
int mm_mallinfo(FAR struct mm_heap_s *heap, FAR struct mallinfo *info);
|
||||
#ifdef CONFIG_DEBUG_MM
|
||||
struct mallinfo_task; /* Forward reference */
|
||||
int mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
||||
FAR struct mallinfo_task *info);
|
||||
#endif
|
||||
|
||||
/* Functions contained in kmm_mallinfo.c ************************************/
|
||||
|
||||
#ifdef CONFIG_MM_KERNEL_HEAP
|
||||
struct mallinfo kmm_mallinfo(void);
|
||||
# ifdef CONFIG_DEBUG_MM
|
||||
struct mallinfo_task kmm_mallinfo_task(pid_t pid);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Functions contained in mm_memdump.c **************************************/
|
||||
|
||||
Reference in New Issue
Block a user