mirror of
https://github.com/wolfpld/tracy
synced 2026-01-19 04:52:09 +00:00
Merge pull request #1229 from slomp/slomp/etw-error-check-patch
ETW initialization: more explicit error check
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user