diff --git a/build_overrides/gpgmm_features.gni b/build_overrides/gpgmm_features.gni index b9a2795ae..98d834cd6 100644 --- a/build_overrides/gpgmm_features.gni +++ b/build_overrides/gpgmm_features.gni @@ -50,10 +50,6 @@ declare_args() { # Sets -dGPGMM_SHARED_LIBRARY gpgmm_shared_library = false - # Enables recording until program termination. - # Sets -dGPGMM_ENABLE_RECORDING_UNTIL_TERMINATION - gpgmm_enable_recording_until_termination = false - # Enables checking of allocator leaks. # Sets -dGPGMM_ENABLE_PRECISE_ALLOCATOR_DEBUG gpgmm_enable_allocator_checks = is_debug diff --git a/src/gpgmm/BUILD.gn b/src/gpgmm/BUILD.gn index 26f5ca8f3..a05fd062d 100644 --- a/src/gpgmm/BUILD.gn +++ b/src/gpgmm/BUILD.gn @@ -100,10 +100,6 @@ source_set("gpgmm_sources") { defines += [ "GPGMM_DISABLE_TRACING" ] } - if (gpgmm_enable_recording_until_termination) { - defines += [ "GPGMM_ENABLE_RECORDING_UNTIL_TERMINATION" ] - } - if (gpgmm_enable_allocator_checks) { defines += [ "GPGMM_ENABLE_ALLOCATOR_CHECKS" ] } diff --git a/src/gpgmm/TraceEvent.cpp b/src/gpgmm/TraceEvent.cpp index 49562e22c..60a832431 100644 --- a/src/gpgmm/TraceEvent.cpp +++ b/src/gpgmm/TraceEvent.cpp @@ -21,15 +21,15 @@ namespace gpgmm { - static EventTraceWriter* gEventTrace; + static std::unique_ptr gEventTrace; static std::mutex mMutex; static EventTraceWriter* GetInstance() { std::lock_guard lock(mMutex); if (gEventTrace == nullptr) { - gEventTrace = new EventTraceWriter(); + gEventTrace = std::make_unique(); } - return gEventTrace; + return gEventTrace.get(); } void StartupEventTrace(const std::string& traceFile, @@ -39,9 +39,6 @@ namespace gpgmm { TRACE_EVENT_METADATA1(TraceEventCategory::Metadata, "thread_name", "name", "GPGMM_MainThread"); -#if !defined(GPGMM_ENABLE_RECORDING_UNTIL_TERMINATION) - GetInstance()->FlushQueuedEventsToDisk(); -#endif GetInstance()->SetConfiguration(traceFile, skipDurationEvents, skipObjectEvents, skipInstantEvents); } diff --git a/src/tests/end2end/D3D12ResourceAllocatorTests.cpp b/src/tests/end2end/D3D12ResourceAllocatorTests.cpp index 6267754ff..9634ccb19 100644 --- a/src/tests/end2end/D3D12ResourceAllocatorTests.cpp +++ b/src/tests/end2end/D3D12ResourceAllocatorTests.cpp @@ -143,70 +143,6 @@ TEST_F(D3D12ResourceAllocatorTests, CreateAllocator) { } } -TEST_F(D3D12ResourceAllocatorTests, CreateAllocatorRecord) { - ALLOCATOR_DESC desc = CreateBasicAllocatorDesc(); - desc.RecordOptions.Flags = - static_cast(ALLOCATOR_RECORD_FLAG_ALL_EVENTS); - - // Creating a new allocator that uses default record options should always succeed. - { - ComPtr allocator; - ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(desc, &allocator)); - EXPECT_NE(allocator, nullptr); - } - - // Creating a new allocator that specifies a trace name should always succeed. - { - ALLOCATOR_DESC newDesc = desc; - newDesc.RecordOptions.TraceFile = "test.json"; - - ComPtr allocator; - ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator)); - EXPECT_NE(allocator, nullptr); - } - - // Creating a new allocator using various recording levels should always succeed. - { - ALLOCATOR_DESC newDesc = desc; - newDesc.RecordOptions.MinMessageLevel = - static_cast(ALLOCATOR_MESSAGE_SEVERITY_MESSAGE); - - ComPtr allocator; - ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator)); - EXPECT_NE(allocator, nullptr); - } - - { - ALLOCATOR_DESC newDesc = desc; - newDesc.RecordOptions.MinMessageLevel = - static_cast(ALLOCATOR_MESSAGE_SEVERITY_INFO); - - ComPtr allocator; - ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator)); - EXPECT_NE(allocator, nullptr); - } - - { - ALLOCATOR_DESC newDesc = desc; - newDesc.RecordOptions.MinMessageLevel = - static_cast(ALLOCATOR_MESSAGE_SEVERITY_WARNING); - - ComPtr allocator; - ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator)); - EXPECT_NE(allocator, nullptr); - } - - { - ALLOCATOR_DESC newDesc = desc; - newDesc.RecordOptions.MinMessageLevel = - static_cast(ALLOCATOR_MESSAGE_SEVERITY_ERROR); - - ComPtr allocator; - ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator)); - EXPECT_NE(allocator, nullptr); - } -} - // Exceeding the max resource heap size should always fail. TEST_F(D3D12ResourceAllocatorTests, CreateBufferOversized) { constexpr uint64_t kOversizedBuffer = 32ll * 1024ll * 1024ll * 1024ll; // 32GB