diff --git a/.github/workflows/win_clang_dbg_x64.yaml b/.github/workflows/win_clang_dbg_x64.yaml index 98082eec0..7574efbed 100644 --- a/.github/workflows/win_clang_dbg_x64.yaml +++ b/.github/workflows/win_clang_dbg_x64.yaml @@ -153,7 +153,7 @@ jobs: shell: cmd run: | cd test - out\Debug\gpgmm_capture_replay_tests.exe --log-level=DEBUG --gtest_filter=*Replay/* --capture-mask=0x3 --ignore-caps-mismatch --disable-memory + out\Debug\gpgmm_capture_replay_tests.exe --log-level=DEBUG --gtest_filter=*Replay/* --event-mask=0x3 --ignore-caps-mismatch --disable-memory-playback - name: Run gpgmm_capture_replay_tests to playback capture (with patch) shell: cmd diff --git a/.github/workflows/win_clang_rel_x64.yaml b/.github/workflows/win_clang_rel_x64.yaml index 0c8f69ce6..381b4deb1 100644 --- a/.github/workflows/win_clang_rel_x64.yaml +++ b/.github/workflows/win_clang_rel_x64.yaml @@ -153,7 +153,7 @@ jobs: shell: cmd run: | cd test - out\Release\gpgmm_capture_replay_tests.exe --gtest_filter=*Replay/* --capture-mask=0x3 --ignore-caps-mismatch --disable-memory + out\Release\gpgmm_capture_replay_tests.exe --gtest_filter=*Replay/* --event-mask=0x3 --ignore-caps-mismatch --disable-memory-playback - name: Run gpgmm_capture_replay_tests to playback capture (with patch) shell: cmd diff --git a/README.md b/README.md index 9dc348e16..1f43b01f6 100644 --- a/README.md +++ b/README.md @@ -325,6 +325,11 @@ cmake --build . > gpgmm_capture_replay_tests ``` +To re-generate the capture: +```sh +gpgmm_capture_replay_tests.exe --gtest_filter=*Replay/* --event-mask=0x3 --disable-memory-playback +``` + ### Run fuzzing tests: ```sh > gpgmm_*_fuzzer -max_total_time= diff --git a/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp b/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp index ec8db713d..97d6fd32c 100644 --- a/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp +++ b/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp @@ -187,7 +187,7 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith const Json::Value& args = event["args"]; ASSERT_FALSE(args.empty()); - if (envParams.IsAllocatorDisabled) { + if (envParams.IsAllocationPlaybackDisabled) { continue; } @@ -481,7 +481,7 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith continue; } - if (envParams.IsMemoryDisabled) { + if (envParams.IsMemoryPlaybackDisabled) { continue; } diff --git a/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.cpp b/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.cpp index ff8d85739..614310b32 100644 --- a/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.cpp +++ b/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.cpp @@ -77,9 +77,9 @@ GPGMMCaptureReplayTestEnvironment::GPGMMCaptureReplayTestEnvironment(int argc, c continue; } - constexpr const char kCaptureMask[] = "--capture-mask="; - arglen = sizeof(kCaptureMask) - 1; - if (strncmp(argv[i], kCaptureMask, arglen) == 0) { + constexpr const char kCaptureEventMask[] = "--event-mask="; + arglen = sizeof(kCaptureEventMask) - 1; + if (strncmp(argv[i], kCaptureEventMask, arglen) == 0) { const char* mask = argv[i] + arglen; mParams.CaptureEventMask = strtoul(mask, nullptr, 0); continue; @@ -95,13 +95,13 @@ GPGMMCaptureReplayTestEnvironment::GPGMMCaptureReplayTestEnvironment(int argc, c continue; } - if (strcmp("--disable-allocation", argv[i]) == 0) { - mParams.IsAllocatorDisabled = true; + if (strcmp("--disable-allocation-playback", argv[i]) == 0) { + mParams.IsAllocationPlaybackDisabled = true; continue; } - if (strcmp("--disable-memory", argv[i]) == 0) { - mParams.IsMemoryDisabled = true; + if (strcmp("--disable-memory-playback", argv[i]) == 0) { + mParams.IsMemoryPlaybackDisabled = true; continue; } @@ -136,12 +136,13 @@ GPGMMCaptureReplayTestEnvironment::GPGMMCaptureReplayTestEnvironment(int argc, c << "Playback options:" << " [--iterations=X]\n" << " --iterations: Number of times to run playback.\n" - << " --capture-mask: Event mask to record during capture.\n" + << " --event-mask: Event mask to record during capture.\n" << " --playback-file: Path to captured file to playback.\n" << " --same-caps: Captured device must be compatible with playback device.\n" << " --profile=[MAXPERF|LOWMEM|CAPTURED|DEFAULT]: Profile to apply.\n" - << " --disable-allocator: Disables allocator playback.\n" - << " --disable-memory: Disables playback of memory from capture.\n"; + << " --disable-allocation-playback: Disables playback of allocations from " + "capture.\n" + << " --disable-memory-playback: Disables playback of memory from capture.\n"; continue; } } diff --git a/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.h b/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.h index 4000160c8..5b50b694f 100644 --- a/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.h +++ b/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.h @@ -49,8 +49,8 @@ struct TestEnviromentParams { bool IsSuballocationDisabled = false; bool IsNeverAllocate = false; bool IsPrefetchAllowed = false; - bool IsAllocatorDisabled = false; // Disables creation of new allocations. - bool IsMemoryDisabled = false; // Disables creation of captured heaps. + bool IsAllocationPlaybackDisabled = false; // Disables creation of new allocations. + bool IsMemoryPlaybackDisabled = false; // Disables creation of captured heaps. AllocatorProfile AllocatorProfile = AllocatorProfile::ALLOCATOR_PROFILE_CAPTURED; // Playback uses captured settings.