more explicit error check

This commit is contained in:
Marcos Slomp
2025-12-16 13:38:42 -08:00
parent 7976e6ab0b
commit db745611c4

View File

@@ -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