Changeset 76796 in vbox for trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
- Timestamp:
- Jan 14, 2019 4:48:55 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
r76795 r76796 58 58 * Always does an even number of iterations. 59 59 */ 60 #define PROFILE_FN(a_fnCall, a_cNsTarget, a_szDesc 1, a_szDesc2) \60 #define PROFILE_FN(a_fnCall, a_cNsTarget, a_szDesc) \ 61 61 do { \ 62 62 /* Estimate how many iterations we need to fill up the given timeslot: */ \ … … 78 78 } \ 79 79 uint64_t const cNsElapsed = RTTimeNanoTS() - nsStart; \ 80 if (a_szDesc1 != NULL) \ 81 RTTestIValueF(cNsElapsed, RTTESTUNIT_NS, a_szDesc1, cIterations); \ 82 RTTestIValueF(cNsElapsed / cIterations, RTTESTUNIT_NS_PER_OCCURRENCE, a_szDesc2); \ 80 RTTestIValueF(cNsElapsed / cIterations, RTTESTUNIT_NS_PER_OCCURRENCE, a_szDesc); \ 83 81 } while (0) 84 82 … … 416 414 RTTESTI_CHECK_RC(RTFileClose(hFile1), VINF_SUCCESS); 417 415 418 PROFILE_FN(fsPerfOpenExistingOnceReadonly(g_szDir), g_nsTestRun, NULL,"RTFileOpen/Close/Readonly");419 PROFILE_FN(fsPerfOpenExistingOnceWriteonly(g_szDir), g_nsTestRun, NULL,"RTFileOpen/Close/Writeonly");416 PROFILE_FN(fsPerfOpenExistingOnceReadonly(g_szDir), g_nsTestRun, "RTFileOpen/Close/Readonly"); 417 PROFILE_FN(fsPerfOpenExistingOnceWriteonly(g_szDir), g_nsTestRun, "RTFileOpen/Close/Writeonly"); 420 418 421 419 /* … … 425 423 RTFILE_O_CREATE | RTFILE_O_DENY_NONE | RTFILE_O_WRITE), VINF_SUCCESS); 426 424 RTTESTI_CHECK_RC(RTFileClose(hFile1), VINF_SUCCESS); 427 PROFILE_FN(fsPerfOpenExistingOnceReadonly(g_szDeepDir), g_nsTestRun, NULL,"RTFileOpen/Close/deep/readonly");428 PROFILE_FN(fsPerfOpenExistingOnceWriteonly(g_szDeepDir), g_nsTestRun, NULL,"RTFileOpen/Close/deep/writeonly");425 PROFILE_FN(fsPerfOpenExistingOnceReadonly(g_szDeepDir), g_nsTestRun, "RTFileOpen/Close/deep/readonly"); 426 PROFILE_FN(fsPerfOpenExistingOnceWriteonly(g_szDeepDir), g_nsTestRun, "RTFileOpen/Close/deep/writeonly"); 429 427 430 428 /* Manytree: */ … … 441 439 RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_NONE | RTFILE_O_WRITE), VINF_SUCCESS); 442 440 RTFSOBJINFO ObjInfo = {0}; 443 PROFILE_FN(RTFileQueryInfo(hFile1, &ObjInfo, RTFSOBJATTRADD_NOTHING), g_nsTestRun, NULL,"RTFileQueryInfo/NOTHING");444 PROFILE_FN(RTFileQueryInfo(hFile1, &ObjInfo, RTFSOBJATTRADD_UNIX), g_nsTestRun, NULL,"RTFileQueryInfo/UNIX");441 PROFILE_FN(RTFileQueryInfo(hFile1, &ObjInfo, RTFSOBJATTRADD_NOTHING), g_nsTestRun, "RTFileQueryInfo/NOTHING"); 442 PROFILE_FN(RTFileQueryInfo(hFile1, &ObjInfo, RTFSOBJATTRADD_UNIX), g_nsTestRun, "RTFileQueryInfo/UNIX"); 445 443 446 444 RTTESTI_CHECK_RC(RTFileClose(hFile1), VINF_SUCCESS); … … 458 456 RTFMODE const fEvenMode = (ObjInfo.Attr.fMode & ~RTFS_UNIX_ALL_ACCESS_PERMS) | RTFS_DOS_READONLY | 0400; 459 457 RTFMODE const fOddMode = (ObjInfo.Attr.fMode & ~(RTFS_UNIX_ALL_ACCESS_PERMS | RTFS_DOS_READONLY)) | 0640; 460 PROFILE_FN(RTFileSetMode(hFile1, iIteration & 1 ? fOddMode : fEvenMode), g_nsTestRun, NULL,"RTFileSetMode");458 PROFILE_FN(RTFileSetMode(hFile1, iIteration & 1 ? fOddMode : fEvenMode), g_nsTestRun, "RTFileSetMode"); 461 459 462 460 RTFileSetMode(hFile1, ObjInfo.Attr.fMode); … … 494 492 495 493 /* Benchmark it: */ 496 PROFILE_FN(RTFileSetTimes(hFile1, NULL, iIteration & 1 ? &Time1 : &Time2, NULL, NULL), g_nsTestRun, NULL,"RTFileSetTimes");494 PROFILE_FN(RTFileSetTimes(hFile1, NULL, iIteration & 1 ? &Time1 : &Time2, NULL, NULL), g_nsTestRun, "RTFileSetTimes"); 497 495 498 496 RTTESTI_CHECK_RC(RTFileClose(hFile1), VINF_SUCCESS); … … 518 516 519 517 PROFILE_FN(RTPathQueryInfoEx(g_szDir, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK), g_nsTestRun, 520 NULL,"RTPathQueryInfoEx/NOTHING");518 "RTPathQueryInfoEx/NOTHING"); 521 519 PROFILE_FN(RTPathQueryInfoEx(g_szDir, &ObjInfo, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK), g_nsTestRun, 522 NULL,"RTPathQueryInfoEx/UNIX");520 "RTPathQueryInfoEx/UNIX"); 523 521 524 522 … … 529 527 530 528 PROFILE_FN(RTPathQueryInfoEx(g_szDeepDir, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK), g_nsTestRun, 531 NULL,"RTPathQueryInfoEx/deep/NOTHING");529 "RTPathQueryInfoEx/deep/NOTHING"); 532 530 PROFILE_FN(RTPathQueryInfoEx(g_szDeepDir, &ObjInfo, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK), g_nsTestRun, 533 NULL,"RTPathQueryInfoEx/deep/UNIX");531 "RTPathQueryInfoEx/deep/UNIX"); 534 532 535 533 /* Manytree: */ … … 562 560 RTFMODE const fEvenMode = (ObjInfo.Attr.fMode & ~RTFS_UNIX_ALL_ACCESS_PERMS) | RTFS_DOS_READONLY | 0400; 563 561 RTFMODE const fOddMode = (ObjInfo.Attr.fMode & ~(RTFS_UNIX_ALL_ACCESS_PERMS | RTFS_DOS_READONLY)) | 0640; 564 PROFILE_FN(RTPathSetMode(g_szDir, iIteration & 1 ? fOddMode : fEvenMode), g_nsTestRun, NULL,"RTPathSetMode");562 PROFILE_FN(RTPathSetMode(g_szDir, iIteration & 1 ? fOddMode : fEvenMode), g_nsTestRun, "RTPathSetMode"); 565 563 RTPathSetMode(g_szDir, ObjInfo.Attr.fMode); 566 564 … … 570 568 RTTESTI_CHECK_RC(RTFileClose(hFile1), VINF_SUCCESS); 571 569 572 PROFILE_FN(RTPathSetMode(g_szDeepDir, iIteration & 1 ? fOddMode : fEvenMode), g_nsTestRun, NULL,"RTPathSetMode/deep");570 PROFILE_FN(RTPathSetMode(g_szDeepDir, iIteration & 1 ? fOddMode : fEvenMode), g_nsTestRun, "RTPathSetMode/deep"); 573 571 RTPathSetMode(g_szDeepDir, ObjInfo.Attr.fMode); 574 572 … … 623 621 PROFILE_FN(RTPathSetTimesEx(g_szDir, iIteration & 1 ? &Time1 : &Time2, iIteration & 1 ? &Time2 : &Time1, 624 622 NULL, NULL, RTPATH_F_ON_LINK), 625 g_nsTestRun, NULL,"RTPathSetTimesEx");623 g_nsTestRun, "RTPathSetTimesEx"); 626 624 627 625 /* Deep: */ … … 632 630 PROFILE_FN(RTPathSetTimesEx(g_szDeepDir, iIteration & 1 ? &Time1 : &Time2, iIteration & 1 ? &Time2 : &Time1, 633 631 NULL, NULL, RTPATH_F_ON_LINK), 634 g_nsTestRun, NULL,"RTPathSetTimesEx/deep");632 g_nsTestRun, "RTPathSetTimesEx/deep"); 635 633 636 634 /* Manytree: */ … … 674 672 /* Shallow: */ 675 673 strcat(strcpy(szPath, g_szDir), "-other"); 676 PROFILE_FN(RTPathRename(iIteration & 1 ? szPath : g_szDir, iIteration & 1 ? g_szDir : szPath, 0), 677 g_nsTestRun, NULL, "RTPathRename"); 674 PROFILE_FN(RTPathRename(iIteration & 1 ? szPath : g_szDir, iIteration & 1 ? g_szDir : szPath, 0), g_nsTestRun, "RTPathRename"); 678 675 679 676 /* Deep: */ … … 684 681 strcat(strcpy(szPath, g_szDeepDir), "-other"); 685 682 PROFILE_FN(RTPathRename(iIteration & 1 ? szPath : g_szDeepDir, iIteration & 1 ? g_szDeepDir : szPath, 0), 686 g_nsTestRun, NULL,"RTPathRename/deep");683 g_nsTestRun, "RTPathRename/deep"); 687 684 688 685 /* Manytree: */ … … 817 814 * Profile. 818 815 */ 819 PROFILE_FN(fsPerfEnumEmpty(), g_nsTestRun, NULL, "RTDirOpen/Read/Close empty"); 820 PROFILE_FN(fsPerfEnumManyFiles(), g_nsTestRun, NULL, "RTDirOpen/Read/Close manyfiles"); 821 816 PROFILE_FN(fsPerfEnumEmpty(), g_nsTestRun, "RTDirOpen/Read/Close empty"); 817 PROFILE_FN(fsPerfEnumManyFiles(), g_nsTestRun, "RTDirOpen/Read/Close manyfiles"); 822 818 } 823 819
Note:
See TracChangeset
for help on using the changeset viewer.