mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
mm: Rename mm_memdump_s to malltask
align with the naming of mallinfo_task Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
c76f9f9349
commit
ddbe9eb6ab
@@ -397,8 +397,8 @@ struct mallinfo mm_mallinfo(struct mm_heap_s *heap)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct mallinfo_task mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
struct mallinfo_task mm_mallinfo_task(struct mm_heap_s *heap,
|
||||||
FAR const struct mm_memdump_s *dump)
|
const struct malltask *task)
|
||||||
{
|
{
|
||||||
struct mallinfo_task info =
|
struct mallinfo_task info =
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -444,8 +444,9 @@ static ssize_t memdump_read(FAR struct file *filep, FAR char *buffer,
|
|||||||
#if CONFIG_MM_BACKTRACE >= 0
|
#if CONFIG_MM_BACKTRACE >= 0
|
||||||
buffer += copysize;
|
buffer += copysize;
|
||||||
buflen -= copysize;
|
buflen -= copysize;
|
||||||
linesize = procfs_snprintf(procfile->line, MEMINFO_LINELEN,
|
linesize = procfs_snprintf(procfile->line, MEMINFO_LINELEN,
|
||||||
"The current sequence number %lu\n", g_mm_seqno);
|
"The current sequence number %lu\n",
|
||||||
|
g_mm_seqno);
|
||||||
|
|
||||||
totalsize += procfs_memcpy(procfile->line, linesize, buffer, buflen,
|
totalsize += procfs_memcpy(procfile->line, linesize, buffer, buflen,
|
||||||
&offset);
|
&offset);
|
||||||
|
|||||||
@@ -886,20 +886,20 @@ static ssize_t proc_heap(FAR struct proc_file_s *procfile,
|
|||||||
size_t copysize;
|
size_t copysize;
|
||||||
size_t totalsize = 0;
|
size_t totalsize = 0;
|
||||||
struct mallinfo_task info;
|
struct mallinfo_task info;
|
||||||
struct mm_memdump_s dump;
|
struct malltask task;
|
||||||
|
|
||||||
dump.pid = tcb->pid;
|
task.pid = tcb->pid;
|
||||||
dump.seqmin = 0;
|
task.seqmin = 0;
|
||||||
dump.seqmax = ULONG_MAX;
|
task.seqmax = ULONG_MAX;
|
||||||
#ifdef CONFIG_MM_KERNEL_HEAP
|
#ifdef CONFIG_MM_KERNEL_HEAP
|
||||||
if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_KERNEL)
|
if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_KERNEL)
|
||||||
{
|
{
|
||||||
info = kmm_mallinfo_task(&dump);
|
info = kmm_mallinfo_task(&task);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
info = mallinfo_task(&dump);
|
info = mallinfo_task(&task);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show the heap alloc size */
|
/* Show the heap alloc size */
|
||||||
|
|||||||
+2
-10
@@ -52,7 +52,7 @@ struct mallinfo
|
|||||||
* by free (not in use) chunks. */
|
* by free (not in use) chunks. */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mm_memdump_s
|
struct malltask
|
||||||
{
|
{
|
||||||
pid_t pid; /* Process id */
|
pid_t pid; /* Process id */
|
||||||
#if CONFIG_MM_BACKTRACE >= 0
|
#if CONFIG_MM_BACKTRACE >= 0
|
||||||
@@ -67,14 +67,6 @@ struct mallinfo_task
|
|||||||
int uordblks; /* This is the total size of memory occupied 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
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -86,7 +78,7 @@ extern "C"
|
|||||||
|
|
||||||
struct mallinfo mallinfo(void);
|
struct mallinfo mallinfo(void);
|
||||||
size_t malloc_size(FAR void *ptr);
|
size_t malloc_size(FAR void *ptr);
|
||||||
struct mallinfo_task mallinfo_task(FAR const struct mm_memdump_s *dump);
|
struct mallinfo_task mallinfo_task(FAR const struct malltask *task);
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,11 +25,11 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <malloc.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <nuttx/list.h>
|
#include <nuttx/list.h>
|
||||||
#include <nuttx/queue.h>
|
#include <nuttx/queue.h>
|
||||||
|
#include <nuttx/mm/mm.h>
|
||||||
#include <nuttx/fs/procfs.h>
|
#include <nuttx/fs/procfs.h>
|
||||||
#include <nuttx/spinlock.h>
|
#include <nuttx/spinlock.h>
|
||||||
#include <nuttx/semaphore.h>
|
#include <nuttx/semaphore.h>
|
||||||
@@ -260,7 +260,7 @@ int mempool_deinit(FAR struct mempool_s *pool);
|
|||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* pool - Address of the memory pool to be used.
|
* pool - Address of the memory pool to be used.
|
||||||
* dump - The information of what need dump.
|
* task - The information of what need retrieve.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Statistics of memory information based on dump.
|
* Statistics of memory information based on dump.
|
||||||
@@ -268,7 +268,7 @@ int mempool_deinit(FAR struct mempool_s *pool);
|
|||||||
|
|
||||||
struct mallinfo_task
|
struct mallinfo_task
|
||||||
mempool_info_task(FAR struct mempool_s *pool,
|
mempool_info_task(FAR struct mempool_s *pool,
|
||||||
FAR const struct mm_memdump_s *dump);
|
FAR const struct malltask *task);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: mempool_procfs_register
|
* Name: mempool_procfs_register
|
||||||
@@ -510,7 +510,7 @@ mempool_multiple_mallinfo(FAR struct mempool_multiple_s *mpool);
|
|||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* mpool - The handle of multiple memory pool to be used.
|
* mpool - The handle of multiple memory pool to be used.
|
||||||
* dump - The information of what need dump.
|
* task - The information of what need retrieve.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Statistics of memory information based on dump.
|
* Statistics of memory information based on dump.
|
||||||
@@ -518,7 +518,7 @@ mempool_multiple_mallinfo(FAR struct mempool_multiple_s *mpool);
|
|||||||
|
|
||||||
struct mallinfo_task
|
struct mallinfo_task
|
||||||
mempool_multiple_info_task(FAR struct mempool_multiple_s *mpool,
|
mempool_multiple_info_task(FAR struct mempool_multiple_s *mpool,
|
||||||
FAR const struct mm_memdump_s *dump);
|
FAR const struct malltask *task);
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|||||||
@@ -99,6 +99,8 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define mm_memdump_s malltask
|
||||||
|
|
||||||
#define MM_BACKTRACE_INVALID_PID ((pid_t)-4)
|
#define MM_BACKTRACE_INVALID_PID ((pid_t)-4)
|
||||||
#define MM_BACKTRACE_MEMPOOL_PID ((pid_t)-3)
|
#define MM_BACKTRACE_MEMPOOL_PID ((pid_t)-3)
|
||||||
#define MM_BACKTRACE_FREE_PID ((pid_t)-2)
|
#define MM_BACKTRACE_FREE_PID ((pid_t)-2)
|
||||||
@@ -123,6 +125,10 @@ extern "C"
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_MM_BACKTRACE >= 0
|
||||||
|
extern unsigned long g_mm_seqno;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* User heap structure:
|
/* User heap structure:
|
||||||
*
|
*
|
||||||
* - Flat build: In the FLAT build, the user heap structure is a globally
|
* - Flat build: In the FLAT build, the user heap structure is a globally
|
||||||
@@ -316,14 +322,14 @@ void kmm_extend(FAR void *mem, size_t size, int region);
|
|||||||
|
|
||||||
struct mallinfo mm_mallinfo(FAR struct mm_heap_s *heap);
|
struct mallinfo mm_mallinfo(FAR struct mm_heap_s *heap);
|
||||||
struct mallinfo_task mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
struct mallinfo_task mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
||||||
FAR const struct mm_memdump_s *dump);
|
FAR const struct malltask *task);
|
||||||
|
|
||||||
/* Functions contained in kmm_mallinfo.c ************************************/
|
/* Functions contained in kmm_mallinfo.c ************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_MM_KERNEL_HEAP
|
#ifdef CONFIG_MM_KERNEL_HEAP
|
||||||
struct mallinfo kmm_mallinfo(void);
|
struct mallinfo kmm_mallinfo(void);
|
||||||
# if CONFIG_MM_BACKTRACE >= 0
|
# if CONFIG_MM_BACKTRACE >= 0
|
||||||
struct mallinfo_task kmm_mallinfo_task(FAR const struct mm_memdump_s *dump);
|
struct mallinfo_task kmm_mallinfo_task(FAR const struct malltask *task);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ struct mallinfo kmm_mallinfo(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct mallinfo_task kmm_mallinfo_task(FAR const struct mm_memdump_s *dump)
|
struct mallinfo_task kmm_mallinfo_task(FAR const struct malltask *task)
|
||||||
{
|
{
|
||||||
return mm_mallinfo_task(g_kmmheap, dump);
|
return mm_mallinfo_task(g_kmmheap, task);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_MM_KERNEL_HEAP */
|
#endif /* CONFIG_MM_KERNEL_HEAP */
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ int mempool_info(FAR struct mempool_s *pool, FAR struct mempoolinfo_s *info)
|
|||||||
|
|
||||||
struct mallinfo_task
|
struct mallinfo_task
|
||||||
mempool_info_task(FAR struct mempool_s *pool,
|
mempool_info_task(FAR struct mempool_s *pool,
|
||||||
FAR const struct mm_memdump_s *dump)
|
FAR const struct malltask *task)
|
||||||
{
|
{
|
||||||
irqstate_t flags = spin_lock_irqsave(&pool->lock);
|
irqstate_t flags = spin_lock_irqsave(&pool->lock);
|
||||||
struct mallinfo_task info =
|
struct mallinfo_task info =
|
||||||
@@ -401,7 +401,7 @@ mempool_info_task(FAR struct mempool_s *pool,
|
|||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (dump->pid == MM_BACKTRACE_FREE_PID)
|
if (task->pid == MM_BACKTRACE_FREE_PID)
|
||||||
{
|
{
|
||||||
size_t count = mempool_queue_lenth(&pool->queue) +
|
size_t count = mempool_queue_lenth(&pool->queue) +
|
||||||
mempool_queue_lenth(&pool->iqueue);
|
mempool_queue_lenth(&pool->iqueue);
|
||||||
@@ -410,7 +410,7 @@ mempool_info_task(FAR struct mempool_s *pool,
|
|||||||
info.uordblks += count * pool->blocksize;
|
info.uordblks += count * pool->blocksize;
|
||||||
}
|
}
|
||||||
#if CONFIG_MM_BACKTRACE < 0
|
#if CONFIG_MM_BACKTRACE < 0
|
||||||
else if (dump->pid == MM_BACKTRACE_ALLOC_PID)
|
else if (task->pid == MM_BACKTRACE_ALLOC_PID)
|
||||||
{
|
{
|
||||||
size_t count = pool->nalloc;
|
size_t count = pool->nalloc;
|
||||||
|
|
||||||
@@ -425,11 +425,11 @@ mempool_info_task(FAR struct mempool_s *pool,
|
|||||||
list_for_every_entry(&pool->alist, buf, struct mempool_backtrace_s,
|
list_for_every_entry(&pool->alist, buf, struct mempool_backtrace_s,
|
||||||
node)
|
node)
|
||||||
{
|
{
|
||||||
if (dump->pid == buf->pid || dump->pid == MM_BACKTRACE_ALLOC_PID ||
|
if (task->pid == buf->pid || task->pid == MM_BACKTRACE_ALLOC_PID ||
|
||||||
(dump->pid == MM_BACKTRACE_INVALID_PID &&
|
(task->pid == MM_BACKTRACE_INVALID_PID &&
|
||||||
nxsched_get_tcb(buf->pid) == NULL))
|
nxsched_get_tcb(buf->pid) == NULL))
|
||||||
{
|
{
|
||||||
if (buf->seqno >= dump->seqmin && buf->seqno <= dump->seqmax)
|
if (buf->seqno >= task->seqmin && buf->seqno <= task->seqmax)
|
||||||
{
|
{
|
||||||
info.aordblks++;
|
info.aordblks++;
|
||||||
info.uordblks += pool->blocksize;
|
info.uordblks += pool->blocksize;
|
||||||
|
|||||||
@@ -768,7 +768,7 @@ mempool_multiple_mallinfo(FAR struct mempool_multiple_s *mpool)
|
|||||||
|
|
||||||
struct mallinfo_task
|
struct mallinfo_task
|
||||||
mempool_multiple_info_task(FAR struct mempool_multiple_s *mpool,
|
mempool_multiple_info_task(FAR struct mempool_multiple_s *mpool,
|
||||||
FAR const struct mm_memdump_s *dump)
|
FAR const struct malltask *task)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct mallinfo_task info;
|
struct mallinfo_task info;
|
||||||
@@ -779,7 +779,7 @@ mempool_multiple_info_task(FAR struct mempool_multiple_s *mpool,
|
|||||||
|
|
||||||
for (i = 0; i < mpool->npools; i++)
|
for (i = 0; i < mpool->npools; i++)
|
||||||
{
|
{
|
||||||
info = mempool_info_task(mpool->pools + i, dump);
|
info = mempool_info_task(mpool->pools + i, task);
|
||||||
ret.aordblks += info.aordblks;
|
ret.aordblks += info.aordblks;
|
||||||
ret.uordblks += info.uordblks;
|
ret.uordblks += info.uordblks;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-12
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
struct mm_mallinfo_handler_s
|
struct mm_mallinfo_handler_s
|
||||||
{
|
{
|
||||||
FAR const struct mm_memdump_s *dump;
|
FAR const struct malltask *task;
|
||||||
FAR struct mallinfo_task *info;
|
FAR struct mallinfo_task *info;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -96,19 +96,19 @@ static void mallinfo_task_handler(FAR struct mm_allocnode_s *node,
|
|||||||
{
|
{
|
||||||
DEBUGASSERT(nodesize >= SIZEOF_MM_ALLOCNODE);
|
DEBUGASSERT(nodesize >= SIZEOF_MM_ALLOCNODE);
|
||||||
#if CONFIG_MM_BACKTRACE < 0
|
#if CONFIG_MM_BACKTRACE < 0
|
||||||
if (handle->dump->pid == MM_BACKTRACE_ALLOC_PID)
|
if (handle->task->pid == MM_BACKTRACE_ALLOC_PID)
|
||||||
{
|
{
|
||||||
handle->info->aordblks++;
|
handle->info->aordblks++;
|
||||||
handle->info->uordblks += nodesize;
|
handle->info->uordblks += nodesize;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (handle->dump->pid == MM_BACKTRACE_ALLOC_PID ||
|
if (handle->task->pid == MM_BACKTRACE_ALLOC_PID ||
|
||||||
handle->dump->pid == node->pid ||
|
handle->task->pid == node->pid ||
|
||||||
(handle->dump->pid == MM_BACKTRACE_INVALID_PID &&
|
(handle->task->pid == MM_BACKTRACE_INVALID_PID &&
|
||||||
nxsched_get_tcb(node->pid) == NULL))
|
nxsched_get_tcb(node->pid) == NULL))
|
||||||
{
|
{
|
||||||
if (node->seqno >= handle->dump->seqmin &&
|
if (node->seqno >= handle->task->seqmin &&
|
||||||
node->seqno <= handle->dump->seqmax)
|
node->seqno <= handle->task->seqmax)
|
||||||
{
|
{
|
||||||
handle->info->aordblks++;
|
handle->info->aordblks++;
|
||||||
handle->info->uordblks += nodesize;
|
handle->info->uordblks += nodesize;
|
||||||
@@ -116,7 +116,7 @@ static void mallinfo_task_handler(FAR struct mm_allocnode_s *node,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (handle->dump->pid == MM_BACKTRACE_FREE_PID)
|
else if (handle->task->pid == MM_BACKTRACE_FREE_PID)
|
||||||
{
|
{
|
||||||
handle->info->aordblks++;
|
handle->info->aordblks++;
|
||||||
handle->info->uordblks += nodesize;
|
handle->info->uordblks += nodesize;
|
||||||
@@ -170,7 +170,7 @@ struct mallinfo mm_mallinfo(FAR struct mm_heap_s *heap)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct mallinfo_task mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
struct mallinfo_task mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
||||||
FAR const struct mm_memdump_s *dump)
|
FAR const struct malltask *task)
|
||||||
{
|
{
|
||||||
struct mm_mallinfo_handler_s handle;
|
struct mm_mallinfo_handler_s handle;
|
||||||
struct mallinfo_task info =
|
struct mallinfo_task info =
|
||||||
@@ -179,11 +179,10 @@ struct mallinfo_task mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if CONFIG_MM_HEAP_MEMPOOL_THRESHOLD != 0
|
#if CONFIG_MM_HEAP_MEMPOOL_THRESHOLD != 0
|
||||||
|
info = mempool_multiple_info_task(heap->mm_mpool, task);
|
||||||
info = mempool_multiple_info_task(heap->mm_mpool, dump);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
handle.dump = dump;
|
handle.task = task;
|
||||||
handle.info = &info;
|
handle.info = &info;
|
||||||
mm_foreach(heap, mallinfo_task_handler, &handle);
|
mm_foreach(heap, mallinfo_task_handler, &handle);
|
||||||
|
|
||||||
|
|||||||
@@ -78,14 +78,14 @@ static void free_delaylist(FAR struct mm_heap_s *heap)
|
|||||||
void mm_dump_handler(FAR struct tcb_s *tcb, FAR void *arg)
|
void mm_dump_handler(FAR struct tcb_s *tcb, FAR void *arg)
|
||||||
{
|
{
|
||||||
struct mallinfo_task info;
|
struct mallinfo_task info;
|
||||||
struct mm_memdump_s dump;
|
struct malltask task;
|
||||||
|
|
||||||
dump.pid = tcb ? tcb->pid : MM_BACKTRACE_INVALID_PID;
|
task.pid = tcb ? tcb->pid : MM_BACKTRACE_INVALID_PID;
|
||||||
dump.seqmin = 0;
|
task.seqmin = 0;
|
||||||
dump.seqmax = ULONG_MAX;
|
task.seqmax = ULONG_MAX;
|
||||||
info = mm_mallinfo_task(arg, &dump);
|
info = mm_mallinfo_task(arg, &task);
|
||||||
mwarn("pid:%5d, used:%10d, nused:%10d\n",
|
mwarn("pid:%5d, used:%10d, nused:%10d\n",
|
||||||
dump.pid, info.uordblks, info.aordblks);
|
task.pid, info.uordblks, info.aordblks);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -122,7 +122,7 @@ struct memdump_backtrace_s
|
|||||||
|
|
||||||
struct mm_mallinfo_handler_s
|
struct mm_mallinfo_handler_s
|
||||||
{
|
{
|
||||||
FAR const struct mm_memdump_s *dump;
|
FAR const struct malltask *task;
|
||||||
FAR struct mallinfo_task *info;
|
FAR struct mallinfo_task *info;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -292,19 +292,19 @@ static void mallinfo_task_handler(FAR void *ptr, size_t size, int used,
|
|||||||
if (used)
|
if (used)
|
||||||
{
|
{
|
||||||
#if CONFIG_MM_BACKTRACE < 0
|
#if CONFIG_MM_BACKTRACE < 0
|
||||||
if (handler->dump->pid = MM_BACKTRACE_ALLOC_PID)
|
if (handler->task->pid = MM_BACKTRACE_ALLOC_PID)
|
||||||
{
|
{
|
||||||
handler->info->aordblks++;
|
handler->info->aordblks++;
|
||||||
handler->info->uordblks += size;
|
handler->info->uordblks += size;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (handler->dump->pid == MM_BACKTRACE_ALLOC_PID ||
|
if (handler->task->pid == MM_BACKTRACE_ALLOC_PID ||
|
||||||
handler->dump->pid == buf->pid ||
|
handler->task->pid == buf->pid ||
|
||||||
(handler->dump->pid == MM_BACKTRACE_INVALID_PID &&
|
(handler->task->pid == MM_BACKTRACE_INVALID_PID &&
|
||||||
nxsched_get_tcb(buf->pid) == NULL))
|
nxsched_get_tcb(buf->pid) == NULL))
|
||||||
{
|
{
|
||||||
if (buf->seqno >= handler->dump->seqmin &&
|
if (buf->seqno >= handler->task->seqmin &&
|
||||||
buf->seqno <= handler->dump->seqmax)
|
buf->seqno <= handler->task->seqmax)
|
||||||
{
|
{
|
||||||
handler->info->aordblks++;
|
handler->info->aordblks++;
|
||||||
handler->info->uordblks += size;
|
handler->info->uordblks += size;
|
||||||
@@ -312,7 +312,7 @@ static void mallinfo_task_handler(FAR void *ptr, size_t size, int used,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (handler->dump->pid == MM_BACKTRACE_FREE_PID)
|
else if (handler->task->pid == MM_BACKTRACE_FREE_PID)
|
||||||
{
|
{
|
||||||
handler->info->aordblks++;
|
handler->info->aordblks++;
|
||||||
handler->info->uordblks += size;
|
handler->info->uordblks += size;
|
||||||
@@ -905,7 +905,7 @@ struct mallinfo mm_mallinfo(FAR struct mm_heap_s *heap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct mallinfo_task mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
struct mallinfo_task mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
||||||
FAR const struct mm_memdump_s *dump)
|
FAR const struct malltask *task)
|
||||||
{
|
{
|
||||||
struct mm_mallinfo_handler_s handle;
|
struct mm_mallinfo_handler_s handle;
|
||||||
struct mallinfo_task info =
|
struct mallinfo_task info =
|
||||||
@@ -920,10 +920,10 @@ struct mallinfo_task mm_mallinfo_task(FAR struct mm_heap_s *heap,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_MM_HEAP_MEMPOOL_THRESHOLD != 0
|
#if CONFIG_MM_HEAP_MEMPOOL_THRESHOLD != 0
|
||||||
info = mempool_multiple_info_task(heap->mm_mpool, dump);
|
info = mempool_multiple_info_task(heap->mm_mpool, task);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
handle.dump = dump;
|
handle.task = task;
|
||||||
handle.info = &info;
|
handle.info = &info;
|
||||||
#if CONFIG_MM_REGIONS > 1
|
#if CONFIG_MM_REGIONS > 1
|
||||||
for (region = 0; region < heap->mm_nregions; region++)
|
for (region = 0; region < heap->mm_nregions; region++)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ struct mallinfo mallinfo(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct mallinfo_task mallinfo_task(FAR const struct mm_memdump_s *dump)
|
struct mallinfo_task mallinfo_task(FAR const struct malltask *task)
|
||||||
{
|
{
|
||||||
return mm_mallinfo_task(USR_HEAP, dump);
|
return mm_mallinfo_task(USR_HEAP, task);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user