This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit ee9673f62e0e3fc562ed7383c4e642d4dac46837
Author: xuxingliang <xuxingli...@xiaomi.com>
AuthorDate: Thu Nov 21 20:49:21 2024 +0800

    gdb/memdump: add option to exclude nodes from specific PID
    
    This is useful to exclude memory nodes for mempool.
    
    E.g.
    
    (gdb) mm dump --nob --top 5 --sort size --nop --no-pid -1
      Pool          CNT          PID         Size  Overhead          Seqno      
      Address Backtrace
         H            1            0     16777264        44             13      
   0x41a79010
         H            2          160      1536048        44     1129827490      
   0x41d6aad0
         H            1        45374      1536176        44     1129829080      
   0x45ef1010
         H            3          141       408440        44         145817      
   0x43905bf0
         H            7          158       131120        44          32955      
   0x4308d090
    Total 14 blks, 23528696 bytes
    (gdb) mm dump --nob --top 5 --sort size --nop
      Pool          CNT          PID         Size  Overhead          Seqno      
      Address Backtrace
         H            1            0     16777264        44             13      
   0x41a79010
    *    H            6           -1      1048640        44         116954      
   0x436a0fd0
    *    H            5           -1      1048640        44         146821      
   0x43b24fd0
    *    H            3           -1      1048640        44          66161      
   0x4335bfd0
    *    H            3           -1      1048640        44         156337      
   0x43d3ffd0
    Total 18 blks, 16777264 bytes
    
    Signed-off-by: xuxingliang <xuxingli...@xiaomi.com>
---
 tools/gdb/nuttxgdb/memdump.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/gdb/nuttxgdb/memdump.py b/tools/gdb/nuttxgdb/memdump.py
index aac6f39994..342e7d2e82 100644
--- a/tools/gdb/nuttxgdb/memdump.py
+++ b/tools/gdb/nuttxgdb/memdump.py
@@ -286,6 +286,9 @@ class MMDump(gdb.Command):
             action="store_true",
             help="Do not reverse the sort result",
         )
+        parser.add_argument(
+            "--no-pid", type=int, default=None, help="Exclude nodes from this 
PID"
+        )
 
         # add option to sort the node by size or count
         parser.add_argument(
@@ -368,6 +371,7 @@ class MMDump(gdb.Command):
             "orphan": args.orphan,
             "no_heap": args.no_heap,
             "no_pool": args.no_pool,
+            "no_pid": args.no_pid,
         }
 
         nodes = self.collect_nodes(args.heap, log=args.log, filters=filters)

Reply via email to