procmeminfo:support memdump can show specific task for tlsf
Signed-off-by: anjiahao <anjiahao@xiaomi.com> Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
c386a1a2d9
commit
29404ef54e
@ -38,6 +38,7 @@
|
|||||||
#include <nuttx/fs/procfs.h>
|
#include <nuttx/fs/procfs.h>
|
||||||
#include <nuttx/mutex.h>
|
#include <nuttx/mutex.h>
|
||||||
#include <nuttx/mm/mm.h>
|
#include <nuttx/mm/mm.h>
|
||||||
|
#include <nuttx/sched.h>
|
||||||
#include <nuttx/mm/mempool.h>
|
#include <nuttx/mm/mempool.h>
|
||||||
|
|
||||||
#include "tlsf/tlsf.h"
|
#include "tlsf/tlsf.h"
|
||||||
@ -144,9 +145,15 @@ struct memdump_backtrace_s
|
|||||||
static void memdump_backtrace(FAR struct mm_heap_s *heap,
|
static void memdump_backtrace(FAR struct mm_heap_s *heap,
|
||||||
FAR struct memdump_backtrace_s *dump)
|
FAR struct memdump_backtrace_s *dump)
|
||||||
{
|
{
|
||||||
|
# if CONFIG_MM_BACKTRACE > 0
|
||||||
|
FAR struct tcb_s *tcb;
|
||||||
|
# endif
|
||||||
|
|
||||||
dump->pid = getpid();
|
dump->pid = getpid();
|
||||||
# if CONFIG_MM_BACKTRACE > 0
|
# if CONFIG_MM_BACKTRACE > 0
|
||||||
if (heap->mm_procfs.backtrace)
|
tcb = nxsched_get_tcb(dump->pid);
|
||||||
|
if (heap->mm_procfs.backtrace ||
|
||||||
|
(tcb && tcb->flags & TCB_FLAG_HEAPDUMP))
|
||||||
{
|
{
|
||||||
int ret = backtrace(dump->backtrace, CONFIG_MM_BACKTRACE);
|
int ret = backtrace(dump->backtrace, CONFIG_MM_BACKTRACE);
|
||||||
while (ret < CONFIG_MM_BACKTRACE)
|
while (ret < CONFIG_MM_BACKTRACE)
|
||||||
|
Loading…
Reference in New Issue
Block a user