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:10 UTC

[incubator-nuttx-apps] branch master updated (7b192f2 -> c9f7360)

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

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


    from 7b192f2  system/trace/trace.c: Condition the creation of "i" and "count" varialbes with SYSCALL or IRQ instrumentation to avoid a warning.
     new 3b64ad3  testing/fstest: Fix the typo error
     new 1187351  testing/fstest: Compare the file name directly
     new 7c4ddae  testing/fstest: Don't reuse the deleted name
     new 121a6e5  testing/fstest: Remove g_media_full since it isn't really used
     new f8ebeb8  testing/fstest: Print the delta of memory info
     new c9f7360  testing/fstest: Zero g_nfailed too in fstest_delallfiles

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 testing/fstest/fstest_main.c | 52 ++++++++++++++++++--------------------------
 1 file changed, 21 insertions(+), 31 deletions(-)

[incubator-nuttx-apps] 01/06: testing/fstest: Fix the typo error

Posted by gu...@apache.org.
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 3b64ad34c38f5e6898ade446d5424cacb2f2bc8f
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Nov 8 14:58:19 2021 +0800

    testing/fstest: Fix the typo error
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 testing/fstest/fstest_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/testing/fstest/fstest_main.c b/testing/fstest/fstest_main.c
index 9506900..215be83 100644
--- a/testing/fstest/fstest_main.c
+++ b/testing/fstest/fstest_main.c
@@ -191,10 +191,10 @@ static inline char fstest_randchar(void)
 }
 
 /****************************************************************************
- * Name: fstest_checkexit
+ * Name: fstest_checkexist
  ****************************************************************************/
 
-static bool fstest_checkexit(FAR struct fstest_filedesc_s *file)
+static bool fstest_checkexist(FAR struct fstest_filedesc_s *file)
 {
   int i;
   bool ret = false;
@@ -254,7 +254,7 @@ static inline void fstest_randname(FAR struct fstest_filedesc_s *file)
       file->hash = crc32((const uint8_t *)file->name + dirlen,
                          alloclen - dirlen);
     }
-  while (fstest_checkexit(file));
+  while (fstest_checkexist(file));
 }
 
 /****************************************************************************
@@ -969,7 +969,7 @@ static void show_useage(void)
   printf("Usage : fstest [OPTION [ARG]] ...\n");
   printf("-h    show this help statement\n");
   printf("-n    num of test loop e.g. [%d]\n", CONFIG_TESTING_FSTEST_NLOOPS);
-  printf("-m    mount point tobe test e.g. [%s]\n",
+  printf("-m    mount point to be tested e.g. [%s]\n",
           CONFIG_TESTING_FSTEST_MOUNTPT);
 }
 

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

Posted by gu...@apache.org.
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);
 }
 
 /****************************************************************************

[incubator-nuttx-apps] 06/06: testing/fstest: Zero g_nfailed too in fstest_delallfiles

Posted by gu...@apache.org.
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 c9f736005ac3278faf67d6c9458101bff7882d46
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Nov 9 02:29:46 2021 +0800

    testing/fstest: Zero g_nfailed too in fstest_delallfiles
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 testing/fstest/fstest_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testing/fstest/fstest_main.c b/testing/fstest/fstest_main.c
index 7077d54..1c5a73d 100644
--- a/testing/fstest/fstest_main.c
+++ b/testing/fstest/fstest_main.c
@@ -655,7 +655,7 @@ static inline int fstest_rdfile(FAR struct fstest_filedesc_s *file)
 
   /* Try reading past the end of the file */
 
-  nbytesread = fstest_rdblock(fd, file, ntotalread, 1024) ;
+  nbytesread = fstest_rdblock(fd, file, ntotalread, 1024);
   if (nbytesread > 0)
     {
       printf("ERROR: Read past the end of file\n");
@@ -899,6 +899,7 @@ static int fstest_delallfiles(void)
     }
 
   g_nfiles = 0;
+  g_nfailed = 0;
   g_ndeleted = 0;
   return OK;
 }

[incubator-nuttx-apps] 02/06: testing/fstest: Compare the file name directly

Posted by gu...@apache.org.
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 1187351144783b649d6c2d12159ca02d8ac9531e
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Nov 9 01:47:07 2021 +0800

    testing/fstest: Compare the file name directly
    
    and remove crc of file name
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 testing/fstest/fstest_main.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/testing/fstest/fstest_main.c b/testing/fstest/fstest_main.c
index 215be83..c8d7cc6 100644
--- a/testing/fstest/fstest_main.c
+++ b/testing/fstest/fstest_main.c
@@ -91,7 +91,6 @@ struct fstest_filedesc_s
   bool failed;
   size_t len;
   uint32_t crc;
-  uint32_t hash;
 };
 
 /****************************************************************************
@@ -201,9 +200,8 @@ static bool fstest_checkexist(FAR struct fstest_filedesc_s *file)
 
   for (i = 0; i < CONFIG_TESTING_FSTEST_MAXOPEN; i++)
     {
-      if (!g_files[i].deleted &&
-          &g_files[i] != file &&
-          g_files[i].hash == file->hash)
+      if (!g_files[i].deleted && &g_files[i] != file &&
+          strcmp(g_files[i].name, file->name) == 0)
         {
           ret = true;
           break;
@@ -251,8 +249,6 @@ static inline void fstest_randname(FAR struct fstest_filedesc_s *file)
         }
 
       file->name[alloclen] = '\0';
-      file->hash = crc32((const uint8_t *)file->name + dirlen,
-                         alloclen - dirlen);
     }
   while (fstest_checkexist(file));
 }

[incubator-nuttx-apps] 04/06: testing/fstest: Remove g_media_full since it isn't really used

Posted by gu...@apache.org.
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 121a6e58ffa3605a79b2b37b5929eaeb98fc1f75
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Nov 9 02:17:09 2021 +0800

    testing/fstest: Remove g_media_full since it isn't really used
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 testing/fstest/fstest_main.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/testing/fstest/fstest_main.c b/testing/fstest/fstest_main.c
index 94ad7db..e0b2b0e 100644
--- a/testing/fstest/fstest_main.c
+++ b/testing/fstest/fstest_main.c
@@ -106,7 +106,6 @@ static char g_mountdir[CONFIG_TESTING_FSTEST_MAXNAME] =
 static int g_nfiles;
 static int g_ndeleted;
 static int g_nfailed;
-static bool g_media_full;
 
 static struct mallinfo g_mmbefore;
 static struct mallinfo g_mmprevious;
@@ -452,11 +451,7 @@ static inline int fstest_wrfile(FAR struct fstest_filedesc_s *file)
             {
               continue;
             }
-          else if (errcode == ENOSPC)
-            {
-              g_media_full = true;
-            }
-          else
+          else if (errcode != ENOSPC)
             {
               printf("ERROR: Failed to write file: %d\n", errcode);
               printf("  File name:    %s\n", file->name);
@@ -513,8 +508,6 @@ static int fstest_fillfs(void)
 
   /* Create a file for each unused file structure */
 
-  g_media_full = false;
-
   for (i = 0; i < CONFIG_TESTING_FSTEST_MAXOPEN; i++)
     {
       file = &g_files[i];
@@ -533,11 +526,6 @@ static int fstest_fillfs(void)
           printf("  Created file %s\n", file->name);
 #endif
           g_nfiles++;
-
-          if (g_media_full)
-            {
-              break;
-            }
         }
     }
 

[incubator-nuttx-apps] 03/06: testing/fstest: Don't reuse the deleted name

Posted by gu...@apache.org.
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 7c4ddaeedeb96793d4b3a8d0d0749f89e1aee7c7
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Nov 9 01:54:04 2021 +0800

    testing/fstest: Don't reuse the deleted name
    
    to simplify the root cause analysis
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 testing/fstest/fstest_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testing/fstest/fstest_main.c b/testing/fstest/fstest_main.c
index c8d7cc6..94ad7db 100644
--- a/testing/fstest/fstest_main.c
+++ b/testing/fstest/fstest_main.c
@@ -200,7 +200,7 @@ static bool fstest_checkexist(FAR struct fstest_filedesc_s *file)
 
   for (i = 0; i < CONFIG_TESTING_FSTEST_MAXOPEN; i++)
     {
-      if (!g_files[i].deleted && &g_files[i] != file &&
+      if (&g_files[i] != file && g_files[i].name &&
           strcmp(g_files[i].name, file->name) == 0)
         {
           ret = true;