Changeset 77002 in vbox for trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
- Timestamp:
- Jan 26, 2019 2:09:25 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
r76999 r77002 257 257 kCmdOpt_ChSize, 258 258 kCmdOpt_NoChSize, 259 kCmdOpt_Read, 260 kCmdOpt_NoRead, 261 kCmdOpt_Write, 262 kCmdOpt_NoWrite, 259 kCmdOpt_ReadPerf, 260 kCmdOpt_NoReadPerf, 261 kCmdOpt_ReadTests, 262 kCmdOpt_NoReadTests, 263 kCmdOpt_WritePerf, 264 kCmdOpt_NoWritePerf, 265 kCmdOpt_WriteTests, 266 kCmdOpt_NoWriteTests, 263 267 kCmdOpt_Seek, 264 268 kCmdOpt_NoSeek, … … 331 335 { "--chsize", kCmdOpt_ChSize, RTGETOPT_REQ_NOTHING }, 332 336 { "--no-chsize", kCmdOpt_NoChSize, RTGETOPT_REQ_NOTHING }, 333 { "--read", kCmdOpt_Read, RTGETOPT_REQ_NOTHING }, 334 { "--no-read", kCmdOpt_NoRead, RTGETOPT_REQ_NOTHING }, 335 { "--write", kCmdOpt_Write, RTGETOPT_REQ_NOTHING }, 336 { "--no-write", kCmdOpt_NoWrite, RTGETOPT_REQ_NOTHING }, 337 { "--read-tests", kCmdOpt_ReadTests, RTGETOPT_REQ_NOTHING }, 338 { "--no-read-tests", kCmdOpt_NoReadTests, RTGETOPT_REQ_NOTHING }, 339 { "--read-perf", kCmdOpt_ReadPerf, RTGETOPT_REQ_NOTHING }, 340 { "--no-read-perf", kCmdOpt_NoReadPerf, RTGETOPT_REQ_NOTHING }, 341 { "--write-tests", kCmdOpt_WriteTests, RTGETOPT_REQ_NOTHING }, 342 { "--no-write-tests", kCmdOpt_NoWriteTests, RTGETOPT_REQ_NOTHING }, 343 { "--write-perf", kCmdOpt_WritePerf, RTGETOPT_REQ_NOTHING }, 344 { "--no-write-perf", kCmdOpt_NoWritePerf, RTGETOPT_REQ_NOTHING }, 337 345 { "--seek", kCmdOpt_Seek, RTGETOPT_REQ_NOTHING }, 338 346 { "--no-seek", kCmdOpt_NoSeek, RTGETOPT_REQ_NOTHING }, … … 388 396 static bool g_fRm = true; 389 397 static bool g_fChSize = true; 390 static bool g_fRead = true; 391 static bool g_fWrite = true; 398 static bool g_fReadTests = true; 399 static bool g_fReadPerf = true; 400 static bool g_fWriteTests= true; 401 static bool g_fWritePerf = true; 392 402 static bool g_fSeek = true; 393 403 static bool g_fFSync = true; … … 1692 1702 ns -= g_nsPerNanoTSCall; \ 1693 1703 uint64_t cIterations = g_nsTestRun / ns; \ 1704 if (cIterations < 2) \ 1705 cIterations = 2; \ 1706 else if (cIterations & 1) \ 1707 cIterations++; \ 1694 1708 \ 1695 1709 /* Do the actual profiling: */ \ … … 2244 2258 if (cbMapping <= _2M) 2245 2259 { 2246 RTTestIFailed("%u: CreateFileMapping or MapViewOfFile failed: %u, %u", enmState, dwErr1, dwErr2); 2247 return; 2260 RTTestIFailed("%u/%s: CreateFileMapping or MapViewOfFile failed: %u, %u", 2261 enmState, s_apszStates[enmState], dwErr1, dwErr2); 2262 break; 2248 2263 } 2249 2264 } … … 2257 2272 if ((void *)pbMapping != MAP_FAILED) 2258 2273 break; 2259 RTTESTI_CHECK_MSG_RETV(cbMapping > _2M, ("errno=%d", errno)); 2274 if (cbMapping <= _2M) 2275 { 2276 RTTestIFailed("%u/%s: mmap failed: %s (%u)", enmState, s_apszStates[enmState], strerror(errno), errno); 2277 break; 2278 } 2260 2279 } 2261 2280 # endif 2281 if (cbMapping <= _2M) 2282 continue; 2262 2283 2263 2284 /* … … 2439 2460 if (g_fSeek) 2440 2461 fsPerfIoSeek(hFile1, cbFile); 2441 if (g_fRead) 2442 {2462 2463 if (g_fReadTests) 2443 2464 fsPerfRead(hFile1, hFileNoCache, cbFile); 2465 if (g_fReadPerf) 2444 2466 for (unsigned i = 0; i < g_cIoBlocks; i++) 2445 2467 fsPerfIoReadBlockSize(hFile1, cbFile, g_acbIoBlocks[i]); 2446 } 2468 2447 2469 if (g_fMMap) 2448 2470 fsPerfMMap(hFile1, hFileNoCache, cbFile); 2449 if (g_fWrite) 2450 {2451 /* This is destructive to the file content. */2471 2472 /* This is destructive to the file content. */ 2473 if (g_fWriteTests) 2452 2474 fsPerfWrite(hFile1, hFileNoCache, hFileWriteThru, cbFile); 2475 if (g_fWritePerf) 2453 2476 for (unsigned i = 0; i < g_cIoBlocks; i++) 2454 2477 fsPerfIoWriteBlockSize(hFile1, cbFile, g_acbIoBlocks[i]); 2455 } 2478 2456 2479 if (g_fFSync) 2457 2480 fsPerfFSync(hFile1, cbFile); … … 2618 2641 g_fRm = true; 2619 2642 g_fChSize = true; 2620 g_fRead = true; 2621 g_fWrite = true; 2643 g_fReadTests = true; 2644 g_fReadPerf = true; 2645 g_fWriteTests= true; 2646 g_fWritePerf = true; 2622 2647 g_fSeek = true; 2623 2648 g_fFSync = true; … … 2640 2665 g_fRm = false; 2641 2666 g_fChSize = false; 2642 g_fRead = false; 2643 g_fWrite = false; 2667 g_fReadTests = false; 2668 g_fReadPerf = false; 2669 g_fWriteTests= false; 2670 g_fWritePerf = false; 2644 2671 g_fSeek = false; 2645 2672 g_fFSync = false; … … 2663 2690 CASE_OPT(Rm); 2664 2691 CASE_OPT(ChSize); 2665 CASE_OPT(Read); 2666 CASE_OPT(Write); 2692 CASE_OPT(ReadTests); 2693 CASE_OPT(ReadPerf); 2694 CASE_OPT(WriteTests); 2695 CASE_OPT(WritePerf); 2667 2696 CASE_OPT(Seek); 2668 2697 CASE_OPT(FSync); … … 2818 2847 if (g_fChSize) 2819 2848 fsPerfChSize(); 2820 if (g_fRead || g_fWrite|| g_fSeek || g_fFSync || g_fMMap)2849 if (g_fReadPerf || g_fReadTests || g_fWritePerf || g_fWriteTests || g_fSeek || g_fFSync || g_fMMap) 2821 2850 fsPerfIo(); 2822 2851 }
Note:
See TracChangeset
for help on using the changeset viewer.