You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gu...@apache.org on 2021/11/27 13:11:15 UTC

[incubator-nuttx-apps] 05/06: testing/fstest: Print the delta of memory info

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

gustavonihei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit f8ebeb8fd89ea9c5f4f8e9a1fbc5ced772c49417
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Nov 9 01:47:58 2021 +0800

    testing/fstest: Print the delta of memory info
    
    to catch the memmory leak quickly
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 testing/fstest/fstest_main.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/testing/fstest/fstest_main.c b/testing/fstest/fstest_main.c
index e0b2b0e..7077d54 100644
--- a/testing/fstest/fstest_main.c
+++ b/testing/fstest/fstest_main.c
@@ -122,13 +122,18 @@ static struct mallinfo g_mmafter;
 static void fstest_showmemusage(struct mallinfo *mmbefore,
                                 struct mallinfo *mmafter)
 {
-  printf("VARIABLE  BEFORE   AFTER\n");
-  printf("======== ======== ========\n");
-  printf("arena    %8x %8x\n", mmbefore->arena,    mmafter->arena);
-  printf("ordblks  %8d %8d\n", mmbefore->ordblks,  mmafter->ordblks);
-  printf("mxordblk %8x %8x\n", mmbefore->mxordblk, mmafter->mxordblk);
-  printf("uordblks %8x %8x\n", mmbefore->uordblks, mmafter->uordblks);
-  printf("fordblks %8x %8x\n", mmbefore->fordblks, mmafter->fordblks);
+  printf("VARIABLE  BEFORE   AFTER    DELTA\n");
+  printf("======== ======== ======== ========\n");
+  printf("arena    %8x %8x %8x\n", mmbefore->arena   , mmafter->arena,
+                                   mmafter->arena    - mmbefore->arena);
+  printf("ordblks  %8d %8d %8d\n", mmbefore->ordblks , mmafter->ordblks,
+                                   mmafter->ordblks  - mmbefore->ordblks);
+  printf("mxordblk %8x %8x %8x\n", mmbefore->mxordblk, mmafter->mxordblk,
+                                   mmafter->mxordblk - mmbefore->mxordblk);
+  printf("uordblks %8x %8x %8x\n", mmbefore->uordblks, mmafter->uordblks,
+                                   mmafter->uordblks - mmbefore->uordblks);
+  printf("fordblks %8x %8x %8x\n", mmbefore->fordblks, mmafter->fordblks,
+                                   mmafter->fordblks - mmbefore->fordblks);
 }
 
 /****************************************************************************