1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Timestamp conversion might be temporarily unavailable.

This commit is contained in:
Bartosz Taudul 2021-05-23 20:32:09 +02:00
parent 233a0bb6d6
commit cfb6d0d2ae
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 47 additions and 45 deletions

View File

@ -90,7 +90,7 @@ public:
int64_t ConvertTimeToTsc( int64_t timestamp ) const int64_t ConvertTimeToTsc( int64_t timestamp ) const
{ {
assert( m_metadata->cap_user_time_zero ); if( !m_metadata->cap_user_time_zero ) return 0;
const auto time = timestamp - m_metadata->time_zero; const auto time = timestamp - m_metadata->time_zero;
const auto quot = time / m_metadata->time_mult; const auto quot = time / m_metadata->time_mult;
const auto rem = time % m_metadata->time_mult; const auto rem = time % m_metadata->time_mult;

View File

@ -959,6 +959,11 @@ static void SetupSampling( int64_t& samplingPeriod )
if( cnt > 0 ) if( cnt > 0 )
{ {
#if defined TRACY_HW_TIMER && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
t0 = s_ring[i].ConvertTimeToTsc( t0 );
if( t0 != 0 )
#endif
{
auto trace = (uint64_t*)tracy_malloc( ( 1 + cnt ) * sizeof( uint64_t ) ); auto trace = (uint64_t*)tracy_malloc( ( 1 + cnt ) * sizeof( uint64_t ) );
s_ring[i].Read( trace+1, offset, sizeof( uint64_t ) * cnt ); s_ring[i].Read( trace+1, offset, sizeof( uint64_t ) * cnt );
@ -1000,10 +1005,6 @@ static void SetupSampling( int64_t& samplingPeriod )
} }
memcpy( trace, &cnt, sizeof( uint64_t ) ); memcpy( trace, &cnt, sizeof( uint64_t ) );
#if defined TRACY_HW_TIMER && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
t0 = s_ring[i].ConvertTimeToTsc( t0 );
#endif
TracyLfqPrepare( QueueType::CallstackSample ); TracyLfqPrepare( QueueType::CallstackSample );
MemWrite( &item->callstackSampleFat.time, t0 ); MemWrite( &item->callstackSampleFat.time, t0 );
MemWrite( &item->callstackSampleFat.thread, (uint64_t)tid ); MemWrite( &item->callstackSampleFat.thread, (uint64_t)tid );
@ -1012,6 +1013,7 @@ static void SetupSampling( int64_t& samplingPeriod )
} }
} }
} }
}
else else
{ {
// Layout: // Layout: