You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/08/02 05:40:23 UTC

(nuttx) 03/04: fix parsememdump.py statistics error bug

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 8acd8e52369c59a27db2dad413c7fa8ac2c6223c
Author: anjiahao <an...@xiaomi.com>
AuthorDate: Wed Feb 21 16:13:06 2024 +0800

    fix parsememdump.py statistics error bug
    
    Signed-off-by: anjiahao <an...@xiaomi.com>
---
 tools/parsememdump.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/parsememdump.py b/tools/parsememdump.py
index 79111bc8ec..c807b0253c 100755
--- a/tools/parsememdump.py
+++ b/tools/parsememdump.py
@@ -83,7 +83,7 @@ def compare_dump_line(dump_line_list, str):
 
     find = 0
     for tmp in dump_line_list:
-        if tmp.mem == t.mem:
+        if tmp.mem == t.mem and tmp.size == t.size and t.mem != []:
             find = 1
             tmp.cnt += 1
             break
@@ -126,9 +126,9 @@ if __name__ == "__main__":
     total_dir = {}
     for t in list:
         if t.pid in total_dir:
-            total_dir[t.pid] += t.size
+            total_dir[t.pid] += t.size * t.cnt
         else:
-            total_dir.setdefault(t.pid, t.size)
+            total_dir.setdefault(t.pid, t.size * t.cnt)
 
     log.output("total memory used for ervey pid\n")
     log.output("pid       total size\n")
@@ -143,6 +143,7 @@ if __name__ == "__main__":
         memstr = ""
         log.output("%-4d  %-6d %-3d   %s   " % (t.cnt, t.size, t.pid, t.addr))
         if t.mem == []:
+            log.output("\n")
             continue
         for mem in t.mem:
             log.output("%s " % mem)