Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/win_clang_dbg_x64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/win_clang_rel_x64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<seconds_to_run>
Expand Down
4 changes: 2 additions & 2 deletions src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -481,7 +481,7 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith
continue;
}

if (envParams.IsMemoryDisabled) {
if (envParams.IsMemoryPlaybackDisabled) {
continue;
}

Expand Down
21 changes: 11 additions & 10 deletions src/tests/capture_replay_tests/GPGMMCaptureReplayTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/tests/capture_replay_tests/GPGMMCaptureReplayTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down