From db745611c47aa94420908f857e56e299dc80ea8b Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Tue, 16 Dec 2025 13:38:42 -0800 Subject: [PATCH] more explicit error check --- public/client/TracySysTrace.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/client/TracySysTrace.cpp b/public/client/TracySysTrace.cpp index 760e3d3f..4fd65d35 100644 --- a/public/client/TracySysTrace.cpp +++ b/public/client/TracySysTrace.cpp @@ -209,14 +209,15 @@ bool SysTraceStart( int64_t& samplingPeriod ) return false; #ifndef TRACY_NO_CONTEXT_SWITCH - if ( etw::EnableStackWalk( session_kernel, etw::ThreadGuid, etw::CSwitch::Opcode ) ) + if ( etw::EnableStackWalk( session_kernel, etw::ThreadGuid, etw::CSwitch::Opcode ) != ERROR_SUCCESS ) return etw::StopSession( session_kernel ), false; #endif + #ifndef TRACY_NO_SAMPLING - if ( etw::EnableStackWalk( session_kernel, etw::PerfInfoGuid, etw::SampledProfile::Opcode ) ) + if ( etw::EnableStackWalk( session_kernel, etw::PerfInfoGuid, etw::SampledProfile::Opcode ) != ERROR_SUCCESS ) return etw::StopSession( session_kernel ), false; int microseconds = GetSamplingInterval() / 10; - if ( etw::SetCPUProfilingInterval( microseconds ) ) + if ( etw::SetCPUProfilingInterval( microseconds ) != ERROR_SUCCESS ) return etw::StopSession( session_kernel ), false; samplingPeriod = GetSamplingPeriod(); #endif