Index: /trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
===================================================================
--- /trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp	(revision 77001)
+++ /trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp	(revision 77002)
@@ -257,8 +257,12 @@
     kCmdOpt_ChSize,
     kCmdOpt_NoChSize,
-    kCmdOpt_Read,
-    kCmdOpt_NoRead,
-    kCmdOpt_Write,
-    kCmdOpt_NoWrite,
+    kCmdOpt_ReadPerf,
+    kCmdOpt_NoReadPerf,
+    kCmdOpt_ReadTests,
+    kCmdOpt_NoReadTests,
+    kCmdOpt_WritePerf,
+    kCmdOpt_NoWritePerf,
+    kCmdOpt_WriteTests,
+    kCmdOpt_NoWriteTests,
     kCmdOpt_Seek,
     kCmdOpt_NoSeek,
@@ -331,8 +335,12 @@
     { "--chsize",           kCmdOpt_ChSize,         RTGETOPT_REQ_NOTHING },
     { "--no-chsize",        kCmdOpt_NoChSize,       RTGETOPT_REQ_NOTHING },
-    { "--read",             kCmdOpt_Read,           RTGETOPT_REQ_NOTHING },
-    { "--no-read",          kCmdOpt_NoRead,         RTGETOPT_REQ_NOTHING },
-    { "--write",            kCmdOpt_Write,          RTGETOPT_REQ_NOTHING },
-    { "--no-write",         kCmdOpt_NoWrite,        RTGETOPT_REQ_NOTHING },
+    { "--read-tests",       kCmdOpt_ReadTests,      RTGETOPT_REQ_NOTHING },
+    { "--no-read-tests",    kCmdOpt_NoReadTests,    RTGETOPT_REQ_NOTHING },
+    { "--read-perf",        kCmdOpt_ReadPerf,       RTGETOPT_REQ_NOTHING },
+    { "--no-read-perf",     kCmdOpt_NoReadPerf,     RTGETOPT_REQ_NOTHING },
+    { "--write-tests",      kCmdOpt_WriteTests,     RTGETOPT_REQ_NOTHING },
+    { "--no-write-tests",   kCmdOpt_NoWriteTests,   RTGETOPT_REQ_NOTHING },
+    { "--write-perf",       kCmdOpt_WritePerf,      RTGETOPT_REQ_NOTHING },
+    { "--no-write-perf",    kCmdOpt_NoWritePerf,    RTGETOPT_REQ_NOTHING },
     { "--seek",             kCmdOpt_Seek,           RTGETOPT_REQ_NOTHING },
     { "--no-seek",          kCmdOpt_NoSeek,         RTGETOPT_REQ_NOTHING },
@@ -388,6 +396,8 @@
 static bool         g_fRm        = true;
 static bool         g_fChSize    = true;
-static bool         g_fRead      = true;
-static bool         g_fWrite     = true;
+static bool         g_fReadTests = true;
+static bool         g_fReadPerf  = true;
+static bool         g_fWriteTests= true;
+static bool         g_fWritePerf = true;
 static bool         g_fSeek      = true;
 static bool         g_fFSync     = true;
@@ -1692,4 +1702,8 @@
             ns -= g_nsPerNanoTSCall; \
         uint64_t cIterations = g_nsTestRun / ns; \
+        if (cIterations < 2) \
+            cIterations = 2; \
+        else if (cIterations & 1) \
+            cIterations++; \
         \
         /* Do the actual profiling: */ \
@@ -2244,6 +2258,7 @@
             if (cbMapping <= _2M)
             {
-                RTTestIFailed("%u: CreateFileMapping or MapViewOfFile failed: %u, %u", enmState, dwErr1, dwErr2);
-                return;
+                RTTestIFailed("%u/%s: CreateFileMapping or MapViewOfFile failed: %u, %u",
+                              enmState, s_apszStates[enmState], dwErr1, dwErr2);
+                break;
             }
         }
@@ -2257,7 +2272,13 @@
             if ((void *)pbMapping != MAP_FAILED)
                 break;
-            RTTESTI_CHECK_MSG_RETV(cbMapping > _2M, ("errno=%d", errno));
+            if (cbMapping <= _2M)
+            {
+                RTTestIFailed("%u/%s: mmap failed: %s (%u)", enmState, s_apszStates[enmState], strerror(errno), errno);
+                break;
+            }
         }
 # endif
+        if (cbMapping <= _2M)
+            continue;
 
         /*
@@ -2439,19 +2460,21 @@
         if (g_fSeek)
             fsPerfIoSeek(hFile1, cbFile);
-        if (g_fRead)
-        {
+
+        if (g_fReadTests)
             fsPerfRead(hFile1, hFileNoCache, cbFile);
+        if (g_fReadPerf)
             for (unsigned i = 0; i < g_cIoBlocks; i++)
                 fsPerfIoReadBlockSize(hFile1, cbFile, g_acbIoBlocks[i]);
-        }
+
         if (g_fMMap)
             fsPerfMMap(hFile1, hFileNoCache, cbFile);
-        if (g_fWrite)
-        {
-            /* This is destructive to the file content. */
+
+        /* This is destructive to the file content. */
+        if (g_fWriteTests)
             fsPerfWrite(hFile1, hFileNoCache, hFileWriteThru, cbFile);
+        if (g_fWritePerf)
             for (unsigned i = 0; i < g_cIoBlocks; i++)
                 fsPerfIoWriteBlockSize(hFile1, cbFile, g_acbIoBlocks[i]);
-        }
+
         if (g_fFSync)
             fsPerfFSync(hFile1, cbFile);
@@ -2618,6 +2641,8 @@
                 g_fRm        = true;
                 g_fChSize    = true;
-                g_fRead      = true;
-                g_fWrite     = true;
+                g_fReadTests = true;
+                g_fReadPerf  = true;
+                g_fWriteTests= true;
+                g_fWritePerf = true;
                 g_fSeek      = true;
                 g_fFSync     = true;
@@ -2640,6 +2665,8 @@
                 g_fRm        = false;
                 g_fChSize    = false;
-                g_fRead      = false;
-                g_fWrite     = false;
+                g_fReadTests = false;
+                g_fReadPerf  = false;
+                g_fWriteTests= false;
+                g_fWritePerf = false;
                 g_fSeek      = false;
                 g_fFSync     = false;
@@ -2663,6 +2690,8 @@
             CASE_OPT(Rm);
             CASE_OPT(ChSize);
-            CASE_OPT(Read);
-            CASE_OPT(Write);
+            CASE_OPT(ReadTests);
+            CASE_OPT(ReadPerf);
+            CASE_OPT(WriteTests);
+            CASE_OPT(WritePerf);
             CASE_OPT(Seek);
             CASE_OPT(FSync);
@@ -2818,5 +2847,5 @@
                 if (g_fChSize)
                     fsPerfChSize();
-                if (g_fRead || g_fWrite || g_fSeek || g_fFSync || g_fMMap)
+                if (g_fReadPerf || g_fReadTests || g_fWritePerf || g_fWriteTests || g_fSeek || g_fFSync || g_fMMap)
                     fsPerfIo();
             }
