mm: Rename MM_BACKTRACE_XXX_PID to PID_MM_XXX

and move the definition to malloc.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2023-05-28 20:09:42 +08:00
committed by Petro Karashchenko
parent ddbe9eb6ab
commit f01deff80f
9 changed files with 36 additions and 35 deletions
+7 -8
View File
@@ -401,7 +401,7 @@ mempool_info_task(FAR struct mempool_s *pool,
0, 0
};
if (task->pid == MM_BACKTRACE_FREE_PID)
if (task->pid == PID_MM_FREE)
{
size_t count = mempool_queue_lenth(&pool->queue) +
mempool_queue_lenth(&pool->iqueue);
@@ -410,7 +410,7 @@ mempool_info_task(FAR struct mempool_s *pool,
info.uordblks += count * pool->blocksize;
}
#if CONFIG_MM_BACKTRACE < 0
else if (task->pid == MM_BACKTRACE_ALLOC_PID)
else if (task->pid == PID_MM_ALLOC)
{
size_t count = pool->nalloc;
@@ -425,8 +425,8 @@ mempool_info_task(FAR struct mempool_s *pool,
list_for_every_entry(&pool->alist, buf, struct mempool_backtrace_s,
node)
{
if (task->pid == buf->pid || task->pid == MM_BACKTRACE_ALLOC_PID ||
(task->pid == MM_BACKTRACE_INVALID_PID &&
if (task->pid == buf->pid || task->pid == PID_MM_ALLOC ||
(task->pid == PID_MM_INVALID &&
nxsched_get_tcb(buf->pid) == NULL))
{
if (buf->seqno >= task->seqmin && buf->seqno <= task->seqmax)
@@ -465,7 +465,7 @@ mempool_info_task(FAR struct mempool_s *pool,
void mempool_memdump(FAR struct mempool_s *pool,
FAR const struct mm_memdump_s *dump)
{
if (dump->pid == MM_BACKTRACE_FREE_PID)
if (dump->pid == PID_MM_FREE)
{
FAR sq_entry_t *entry;
@@ -491,9 +491,8 @@ void mempool_memdump(FAR struct mempool_s *pool,
list_for_every_entry(&pool->alist, buf, struct mempool_backtrace_s,
node)
{
if ((buf->pid == dump->pid ||
dump->pid == MM_BACKTRACE_ALLOC_PID) &&
buf->seqno >= dump->seqmin && buf->seqno <= dump->seqmax)
if ((buf->pid == dump->pid || dump->pid == PID_MM_ALLOC) &&
buf->seqno >= dump->seqmin && buf->seqno <= dump->seqmax)
{
# if CONFIG_MM_BACKTRACE > 0
int i;