1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Add "TRACY_NO_SYS_TRACE" env var to allow force disabling system trace even if the underlying system supports it

This commit is contained in:
Tiago Rodrigues 2023-11-10 17:02:47 -05:00
parent 790d28911d
commit 95cb3e1f5a

View File

@ -1439,7 +1439,16 @@ Profiler::Profiler()
void Profiler::SpawnWorkerThreads()
{
#ifdef TRACY_HAS_SYSTEM_TRACING
if( SysTraceStart( m_samplingPeriod ) )
// use TRACY_NO_SYS_TRACE=1 to force disabling sys tracing
// (even if available in the underlying system)
// as it can have significant impact on the size of the traces
const char* noSysTrace = GetEnvVar( "TRACY_NO_SYS_TRACE" );
const bool disableSystrace = (noSysTrace && noSysTrace[0] == '1');
if(disableSystrace)
{
printf("TRACY: systrace was disabled by 'TRACY_NO_SYS_TRACE=1'\n");
}
else if( SysTraceStart( m_samplingPeriod ) )
{
s_sysTraceThread = (Thread*)tracy_malloc( sizeof( Thread ) );
new(s_sysTraceThread) Thread( SysTraceWorker, nullptr );