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

Don't perform background tasks during trace upgrade.

This commit is contained in:
Bartosz Taudul 2019-09-29 20:52:25 +02:00
parent 947eb56f3d
commit 2470936050
3 changed files with 44 additions and 37 deletions

View File

@ -264,7 +264,7 @@ Worker::Worker( const char* addr, int port )
m_thread = std::thread( [this] { SetThreadName( "Tracy Worker" ); Exec(); } );
}
Worker::Worker( FileRead& f, EventType::Type eventMask )
Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
: m_hasData( true )
, m_stream( nullptr )
, m_buffer( nullptr )
@ -1634,6 +1634,12 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
s_loadProgress.total.store( 0, std::memory_order_relaxed );
m_loadTime = std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now() - loadStart ).count();
if( !bgTasks )
{
m_backgroundDone.store( true, std::memory_order_relaxed );
}
else
{
m_backgroundDone.store( false, std::memory_order_relaxed );
#ifndef TRACY_NO_STATISTICS
m_threadBackground = std::thread( [this, reconstructMemAllocPlot] {
@ -1680,6 +1686,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
m_threadBackground = std::thread( [this] { ReconstructMemAllocPlot(); m_backgroundDone.store( true, std::memory_order_relaxed ); } );
}
#endif
}
}
Worker::~Worker()

View File

@ -271,7 +271,7 @@ public:
};
Worker( const char* addr, int port );
Worker( FileRead& f, EventType::Type eventMask = EventType::All );
Worker( FileRead& f, EventType::Type eventMask = EventType::All, bool bgTasks = true );
~Worker();
const std::string& GetAddr() const { return m_addr; }

View File

@ -55,7 +55,7 @@ int main( int argc, char** argv )
{
int inVer;
{
tracy::Worker worker( *f );
tracy::Worker worker( *f, tracy::EventType::All, false );
#ifndef TRACY_NO_STATISTICS
while( !worker.AreSourceLocationZonesReady() ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );