anchao commented on code in PR #18468:
URL: https://github.com/apache/nuttx/pull/18468#discussion_r2881476089
##########
mm/mm_heap/mm_memdump.c:
##########
@@ -223,6 +223,29 @@ static void memdump_handler(FAR struct mm_allocnode_s
*node, FAR void *arg)
}
}
+#if CONFIG_MM_BACKTRACE >= 0
+struct memdump_tcb_arg_s
+{
+ FAR struct mm_heap_s *heap;
+ unsigned long seqmin;
+ unsigned long seqmax;
+};
+
+static void memdump_tcb_handler(FAR struct tcb_s *tcb, FAR void *arg)
+{
+ struct mallinfo_task info;
+ struct malltask task;
+ FAR struct memdump_tcb_arg_s *tcb_arg = arg;
+
+ task.pid = tcb ? tcb->pid : PID_MM_LEAK;
+ task.seqmin = tcb_arg->seqmin;
+ task.seqmax = tcb_arg->seqmax;
+ info = mm_mallinfo_task(tcb_arg->heap, &task);
+ syslog(LOG_INFO, "pid:%5d, used:%10d, nused:%10d\n",
Review Comment:
```suggestion
syslog(LOG_INFO, "PID: %5d, Used: %10d, Nused: %10d\n",
```
##########
fs/procfs/fs_procfsmeminfo.c:
##########
@@ -616,6 +617,11 @@ static ssize_t memdump_write(FAR struct file *filep, FAR
const char *buffer,
break;
#if CONFIG_MM_BACKTRACE >= 0
+ case 'a':
Review Comment:
```suggestion
case 'a':
```
##########
include/malloc.h:
##########
@@ -35,6 +35,9 @@
/* Special PID to query the info about alloc, free and mempool */
+#if CONFIG_MM_BACKTRACE >= 0
Review Comment:
```suggestion
```
remove, definition does not require adding macro check
##########
mm/mm_heap/mm_memdump.c:
##########
@@ -223,6 +223,29 @@ static void memdump_handler(FAR struct mm_allocnode_s
*node, FAR void *arg)
}
}
+#if CONFIG_MM_BACKTRACE >= 0
+struct memdump_tcb_arg_s
Review Comment:
move to file begin and add **Private Types** chapter
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]