- Timestamp:
- Aug 12, 2019 9:36:47 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/storage/IoPerf.cpp
r80186 r80221 191 191 /** Chance in percent to get a write. */ 192 192 unsigned uWriteChance; 193 /** Flag whether to verify read data. */ 194 bool fVerifyReads; 193 195 /** Start timestamp. */ 194 196 uint64_t tsStart; … … 199 201 /** Index of the next free statistics record to use. */ 200 202 uint32_t idxReqStatNext; 201 /** Array of request statis c records for the whole test. */203 /** Array of request statistic records for the whole test. */ 202 204 PIOPERFREQSTAT paReqStats; 203 205 /** Test dependent data. */ … … 276 278 { "--block-size", 'b', RTGETOPT_REQ_UINT32 }, 277 279 { "--maximum-requests", 'm', RTGETOPT_REQ_UINT32 }, 280 { "--verify-reads", 'y', RTGETOPT_REQ_BOOL }, 278 281 279 282 { "--first-write", kCmdOpt_FirstWrite, RTGETOPT_REQ_NOTHING }, … … 320 323 /** Write chance for mixed read/write tests. */ 321 324 static unsigned g_uWriteChance = 50; 325 /** Flag whether to verify read data. */ 326 static bool g_fVerifyReads = true; 322 327 323 328 /** @name Configured tests, this must match the IOPERFTEST order. … … 741 746 pReq->pStats->tsComplete = RTTimeNanoTS(); 742 747 748 if ( pJob->fVerifyReads 749 && pReq->enmOp == RTIOQUEUEOP_READ) 750 { 751 const void *pvBuf = ioPerfJobTestGetWriteBufForOffset(pJob, pReq->offXfer); 752 if (memcmp(pReq->pvXferRead, pvBuf, pReq->cbXfer)) 753 { 754 if (g_uVerbosity > 1) 755 RTTestIFailed("IoPerf: Corrupted data detected by read at offset %#llu (sz: %zu)", pReq->offXfer, pReq->cbXfer); 756 else 757 RTTestIErrorInc(); 758 } 759 } 760 743 761 if (!ioPerfJobTestIsDone(pJob)) 744 762 { … … 951 969 * @param cReqsMax Maximum number of concurrent requests for this job. 952 970 * @param uWriteChance The write chance for mixed read/write tests. 971 * @param fVerifyReads Flag whether to verify read data. 953 972 */ 954 973 static int ioPerfJobInit(PIOPERFJOB pJob, PIOPERFMASTER pMaster, uint32_t idJob, … … 956 975 IOPERFTESTSETPREP enmPrepMethod, 957 976 uint64_t cbTestSet, size_t cbIoBlock, uint32_t cReqsMax, 958 unsigned uWriteChance )977 unsigned uWriteChance, bool fVerifyReads) 959 978 { 960 979 pJob->pMaster = pMaster; … … 968 987 pJob->cbIoReqReadBuf = cReqsMax * cbIoBlock; 969 988 pJob->uWriteChance = uWriteChance; 989 pJob->fVerifyReads = fVerifyReads; 970 990 pJob->cReqStats = (uint32_t)(pJob->cbTestSet / pJob->cbIoBlock + ((pJob->cbTestSet % pJob->cbIoBlock) ? 1 : 0)); 971 991 pJob->idxReqStatNext = 0; … … 1117 1137 g_szDir, IOPERFTESTSETPREP_SET_SZ, 1118 1138 g_cbTestSet, g_cbIoBlock, g_cReqsMax, 1119 g_uWriteChance );1139 g_uWriteChance, g_fVerifyReads); 1120 1140 if (RT_SUCCESS(rc)) 1121 1141 { … … 1162 1182 case 'd': pszHelp = "The directory to use for testing. default: CWD/fstestdir"; break; 1163 1183 case 'r': pszHelp = "Don't abspath test dir (good for deep dirs). default: disabled"; break; 1184 case 'y': pszHelp = "Flag whether to verify read data. default: enabled"; break; 1164 1185 case 'v': pszHelp = "More verbose execution."; break; 1165 1186 case 'q': pszHelp = "Quiet execution."; break; … … 1238 1259 break; 1239 1260 1261 case 'y': 1262 g_fVerifyReads = ValueUnion.f; 1263 break; 1264 1265 case kCmdOpt_FirstWrite: 1266 g_aenmTests[IOPERFTEST_FIRST_WRITE] = IOPERFTEST_FIRST_WRITE; 1267 break; 1268 case kCmdOpt_NoFirstWrite: 1269 g_aenmTests[IOPERFTEST_FIRST_WRITE] = IOPERFTEST_DISABLED; 1270 break; 1271 case kCmdOpt_SeqRead: 1272 g_aenmTests[IOPERFTEST_SEQ_READ] = IOPERFTEST_SEQ_READ; 1273 break; 1274 case kCmdOpt_NoSeqRead: 1275 g_aenmTests[IOPERFTEST_SEQ_READ] = IOPERFTEST_DISABLED; 1276 break; 1277 case kCmdOpt_SeqWrite: 1278 g_aenmTests[IOPERFTEST_SEQ_WRITE] = IOPERFTEST_SEQ_WRITE; 1279 break; 1280 case kCmdOpt_NoSeqWrite: 1281 g_aenmTests[IOPERFTEST_SEQ_WRITE] = IOPERFTEST_DISABLED; 1282 break; 1283 case kCmdOpt_RndRead: 1284 g_aenmTests[IOPERFTEST_RND_READ] = IOPERFTEST_RND_READ; 1285 break; 1286 case kCmdOpt_NoRndRead: 1287 g_aenmTests[IOPERFTEST_RND_READ] = IOPERFTEST_DISABLED; 1288 break; 1289 case kCmdOpt_RndWrite: 1290 g_aenmTests[IOPERFTEST_RND_WRITE] = IOPERFTEST_RND_WRITE; 1291 break; 1292 case kCmdOpt_NoRndWrite: 1293 g_aenmTests[IOPERFTEST_RND_WRITE] = IOPERFTEST_DISABLED; 1294 break; 1295 case kCmdOpt_RevRead: 1296 g_aenmTests[IOPERFTEST_REV_READ] = IOPERFTEST_REV_READ; 1297 break; 1298 case kCmdOpt_NoRevRead: 1299 g_aenmTests[IOPERFTEST_REV_READ] = IOPERFTEST_DISABLED; 1300 break; 1301 case kCmdOpt_RevWrite: 1302 g_aenmTests[IOPERFTEST_REV_WRITE] = IOPERFTEST_REV_WRITE; 1303 break; 1304 case kCmdOpt_NoRevWrite: 1305 g_aenmTests[IOPERFTEST_REV_WRITE] = IOPERFTEST_DISABLED; 1306 break; 1307 case kCmdOpt_SeqReadWrite: 1308 g_aenmTests[IOPERFTEST_SEQ_READWRITE] = IOPERFTEST_SEQ_READWRITE; 1309 break; 1310 case kCmdOpt_NoSeqReadWrite: 1311 g_aenmTests[IOPERFTEST_SEQ_READWRITE] = IOPERFTEST_DISABLED; 1312 break; 1313 case kCmdOpt_RndReadWrite: 1314 g_aenmTests[IOPERFTEST_RND_READWRITE] = IOPERFTEST_RND_READWRITE; 1315 break; 1316 case kCmdOpt_NoRndReadWrite: 1317 g_aenmTests[IOPERFTEST_RND_READWRITE] = IOPERFTEST_DISABLED; 1318 break; 1319 1240 1320 case 'q': 1241 1321 g_uVerbosity = 0;
Note:
See TracChangeset
for help on using the changeset viewer.