diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index c15db716..c0e5d3f9 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -183,6 +183,8 @@ static inline void UpdateLockCount( LockMap& lockmap, size_t pos ) } +LoadProgress Worker::s_loadProgress; + Worker::Worker( const char* addr ) : m_addr( addr ) , m_connected( false ) @@ -242,6 +244,16 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) memcpy( &m_delay, hdr, sizeof( m_delay ) ); } + if( fileVer <= FileVersion( 0, 3, 1 ) ) + { + s_loadProgress.total.store( 13, std::memory_order_relaxed ); + } + else + { + s_loadProgress.total.store( 15, std::memory_order_relaxed ); + } + + s_loadProgress.progress.store( 0, std::memory_order_relaxed ); f.Read( m_resolution ); f.Read( m_timerMul ); f.Read( m_data.lastTime ); @@ -260,10 +272,12 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) m_captureName = std::string( tmp, tmp+sz ); } + s_loadProgress.progress.store( 1, std::memory_order_relaxed ); f.Read( sz ); m_data.frames.reserve_and_use( sz ); f.Read( m_data.frames.data(), sizeof( uint64_t ) * sz ); + s_loadProgress.progress.store( 2, std::memory_order_relaxed ); flat_hash_map> pointerMap; f.Read( sz ); @@ -278,6 +292,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) pointerMap.emplace( ptr, dst ); } + s_loadProgress.progress.store( 3, std::memory_order_relaxed ); f.Read( sz ); for( uint64_t i=0; isecond ); } + s_loadProgress.progress.store( 4, std::memory_order_relaxed ); f.Read( sz ); for( uint64_t i=0; isecond ); } + s_loadProgress.progress.store( 5, std::memory_order_relaxed ); f.Read( sz ); for( uint64_t i=0; i> msgMap; f.Read( sz ); if( eventMask & EventType::Messages ) @@ -459,6 +480,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) } } + s_loadProgress.progress.store( 10, std::memory_order_relaxed ); f.Read( sz ); m_data.threads.reserve( sz ); for( uint64_t i=0; i total = 0; + std::atomic progress = 0; +}; + class Worker { public: @@ -221,6 +227,8 @@ public: void Write( FileWrite& f ); + static const LoadProgress& GetLoadProgress() { return s_loadProgress; } + private: void Exec(); void ServerQuery( uint8_t type, uint64_t data ); @@ -362,6 +370,8 @@ private: DataBlock m_data; MbpsBlock m_mbpsData; + + static LoadProgress s_loadProgress; }; }