Use monotonic raw clock for hardware sampling.

This commit is contained in:
Bartosz Taudul 2021-06-19 13:40:31 +02:00
parent 2c4b2ce6f0
commit 7e1622083e
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -831,6 +831,11 @@ static void SetupSampling( int64_t& samplingPeriod )
pe.exclude_hv = 1;
pe.freq = 1;
pe.inherit = 1;
#if !defined TRACY_HW_TIMER || !( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
pe.use_clockid = 1;
pe.clockid = CLOCK_MONOTONIC_RAW;
#endif
if( !noRetirement )
{
TracyDebug( "Setup sampling cycles + retirement\n" );