mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 14:58:13 +08:00
Support memdump to realize incremental dump function
Add a new field to record the global on the basis of mm_backtrace. When using alloc, the field is incremented by 1, so that the memory usage can be dumped within the range Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
+18
-2
@@ -52,13 +52,29 @@ struct mallinfo
|
||||
* by free (not in use) chunks. */
|
||||
};
|
||||
|
||||
struct mm_memdump_s
|
||||
{
|
||||
pid_t pid; /* Process id */
|
||||
#if CONFIG_MM_BACKTRACE >= 0
|
||||
unsigned long seqmin; /* The minimum sequence */
|
||||
unsigned long seqmax; /* The maximum sequence */
|
||||
#endif
|
||||
};
|
||||
|
||||
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 */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_MM_BACKTRACE >= 0
|
||||
extern unsigned long g_mm_seqno;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
@@ -70,7 +86,7 @@ extern "C"
|
||||
|
||||
struct mallinfo mallinfo(void);
|
||||
size_t malloc_size(FAR void *ptr);
|
||||
struct mallinfo_task mallinfo_task(pid_t pid);
|
||||
struct mallinfo_task mallinfo_task(FAR const struct mm_memdump_s *dump);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user