Changeset 77928 in vbox for trunk/src/VBox/ValidationKit/utils/fs
- Timestamp:
- Mar 28, 2019 12:05:23 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129641
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
r77927 r77928 290 290 kCmdOpt_ReadTests, 291 291 kCmdOpt_NoReadTests, 292 #ifdef FSPERF_TEST_SENDFILE 292 293 kCmdOpt_SendFile, 293 294 kCmdOpt_NoSendFile, 295 #endif 294 296 #ifdef RT_OS_LINUX 295 297 kCmdOpt_Splice, … … 378 380 { "--read-perf", kCmdOpt_ReadPerf, RTGETOPT_REQ_NOTHING }, 379 381 { "--no-read-perf", kCmdOpt_NoReadPerf, RTGETOPT_REQ_NOTHING }, 382 #ifdef FSPERF_TEST_SENDFILE 380 383 { "--sendfile", kCmdOpt_SendFile, RTGETOPT_REQ_NOTHING }, 381 384 { "--no-sendfile", kCmdOpt_NoSendFile, RTGETOPT_REQ_NOTHING }, 385 #endif 382 386 #ifdef RT_OS_LINUX 383 387 { "--splice", kCmdOpt_Splice, RTGETOPT_REQ_NOTHING }, … … 446 450 static bool g_fReadTests = true; 447 451 static bool g_fReadPerf = true; 452 #ifdef FSPERF_TEST_SENDFILE 448 453 static bool g_fSendFile = true; 454 #endif 449 455 #ifdef RT_OS_LINUX 450 456 static bool g_fSplice = true; … … 2174 2180 #ifdef RT_OS_LINUX 2175 2181 2182 #ifndef __NR_splice 2183 # if defined(RT_ARCH_AMD64) 2184 # define __NR_splice 275 2185 # elif defined(RT_ARCH_X86) 2186 # define __NR_splice 313 2187 # else 2188 # error "fix me" 2189 # endif 2190 #endif 2191 2192 /** FsPerf is built against ancient glibc, so make the splice syscall ourselves. */ 2193 DECLINLINE(ssize_t) syscall_splice(int fdIn, loff_t *poffIn, int fdOut, loff_t *poffOut, size_t cbChunk, unsigned fFlags) 2194 { 2195 return syscall(__NR_splice, fdIn, poffIn, fdOut, poffOut, cbChunk, fFlags); 2196 } 2197 2198 2176 2199 /** 2177 2200 * Send file thread arguments. … … 2263 2286 { 2264 2287 loff_t offFileIn = offFile; 2265 ssize_t cbActual = s plice((int)RTFileToNative(hFile1), &offFileIn, (int)RTPipeToNative(hPipeW), NULL,2266 cbLeft, 0 /*fFlags*/);2288 ssize_t cbActual = syscall_splice((int)RTFileToNative(hFile1), &offFileIn, (int)RTPipeToNative(hPipeW), NULL, 2289 cbLeft, 0 /*fFlags*/); 2267 2290 int const iErr = errno; 2268 2291 if (RT_UNLIKELY(cbActual < 0)) … … 2472 2495 { 2473 2496 loff_t offFileOut = offFile; 2474 ssize_t cbActual = s plice((int)RTPipeToNative(hPipeR), NULL, (int)RTFileToNative(hFile1), &offFileOut,2475 cbLeft, 0 /*fFlags*/);2497 ssize_t cbActual = syscall_splice((int)RTPipeToNative(hPipeR), NULL, (int)RTFileToNative(hFile1), &offFileOut, 2498 cbLeft, 0 /*fFlags*/); 2476 2499 int const iErr = errno; 2477 2500 if (RT_UNLIKELY(cbActual < 0)) … … 4394 4417 g_fReadTests = true; 4395 4418 g_fReadPerf = true; 4419 #ifdef FSPERF_TEST_SENDFILE 4396 4420 g_fSendFile = true; 4421 #endif 4397 4422 #ifdef RT_OS_LINUX 4398 4423 g_fSplice = true; … … 4424 4449 g_fReadTests = false; 4425 4450 g_fReadPerf = false; 4451 #ifdef FSPERF_TEST_SENDFILE 4426 4452 g_fSendFile = false; 4453 #endif 4427 4454 #ifdef RT_OS_LINUX 4428 4455 g_fSplice = false; … … 4455 4482 CASE_OPT(ReadTests); 4456 4483 CASE_OPT(ReadPerf); 4484 #ifdef FSPERF_TEST_SENDFILE 4457 4485 CASE_OPT(SendFile); 4486 #endif 4458 4487 #ifdef RT_OS_LINUX 4459 4488 CASE_OPT(Splice); … … 4617 4646 if (g_fChSize) 4618 4647 fsPerfChSize(); 4619 if ( g_fReadPerf || g_fReadTests || g_fSendFile || g_fWritePerf || g_fWriteTests 4648 if ( g_fReadPerf || g_fReadTests || g_fWritePerf || g_fWriteTests 4649 #ifdef FSPERF_TEST_SENDFILE 4650 || g_fSendFile 4651 #endif 4620 4652 #ifdef RT_OS_LINUX 4621 4653 || g_fSplice
Note:
See TracChangeset
for help on using the changeset viewer.