mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Merge pull request #545 from topolarity/fix-no-sampling
linux: respect `TRACY_NO_SAMPLING` for sys-tracing
This commit is contained in:
commit
856027a27d
@ -770,6 +770,13 @@ bool SysTraceStart( int64_t& samplingPeriod )
|
||||
TracyDebug( "sched_wakeup id: %i\n", wakeupId );
|
||||
TracyDebug( "drm_vblank_event id: %i\n", vsyncId );
|
||||
|
||||
#ifdef TRACY_NO_SAMPLING
|
||||
const bool noSoftwareSampling = true;
|
||||
#else
|
||||
const char* noSoftwareSamplingEnv = GetEnvVar( "TRACY_NO_SAMPLING" );
|
||||
const bool noSoftwareSampling = noSoftwareSamplingEnv && noSoftwareSamplingEnv[0] == '1';
|
||||
#endif
|
||||
|
||||
#ifdef TRACY_NO_SAMPLE_RETIREMENT
|
||||
const bool noRetirement = true;
|
||||
#else
|
||||
@ -839,6 +846,8 @@ bool SysTraceStart( int64_t& samplingPeriod )
|
||||
pe.clockid = CLOCK_MONOTONIC_RAW;
|
||||
#endif
|
||||
|
||||
if( !noSoftwareSampling )
|
||||
{
|
||||
TracyDebug( "Setup software sampling\n" );
|
||||
ProbePreciseIp( pe, currentPid );
|
||||
for( int i=0; i<s_numCpus; i++ )
|
||||
@ -863,6 +872,7 @@ bool SysTraceStart( int64_t& samplingPeriod )
|
||||
TracyDebug( " Core %i ok\n", i );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CPU cycles + instructions retired
|
||||
pe = {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user