nshlib: ps supports noheap parameter

Obtaining the heap usage size requires traversing all memory.
When the number of threads is large, it will become very slow.

ps -heap
PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK              HEAP  STACK   USED  FILLED COMMAND
  0     0   0 FIFO     Kthread   - Ready              0000000000000000  4338432 2162672 0005196   0.2%  Idle_Task

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai
2024-05-16 13:00:44 +08:00
committed by GUIDINGLI
parent a655e067ef
commit b90899b1d5
2 changed files with 88 additions and 68 deletions

View File

@@ -475,7 +475,7 @@ static const struct cmdmap_s g_cmdmap[] =
#ifndef CONFIG_NSH_DISABLE_PS
CMD_MAP("ps", cmd_ps, 1, CONFIG_NSH_MAXARGUMENTS,
"<pid1 pid2 ...>"),
"<-heap> <pid1 pid2 ...>"),
#endif
#ifdef CONFIG_NET_UDP