From 9f13475b521972820dcec620cd7f290655e52d67 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 29 Jul 2018 15:33:48 +0200 Subject: [PATCH] Track trace version in worker. --- server/TracyWorker.cpp | 2 ++ server/TracyWorker.hpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 1cc333ce..b8ca4cab 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -199,6 +199,7 @@ Worker::Worker( const char* addr ) , m_pendingThreads( 0 ) , m_pendingSourceLocation( 0 ) , m_pendingCallstackFrames( 0 ) + , m_traceVersion( CurrentVersion ) { m_data.sourceLocationExpand.push_back( 0 ); m_data.threadExpand.push_back( 0 ); @@ -244,6 +245,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) static_assert( sizeof( m_delay ) == sizeof( hdr ), "Size mismatch" ); memcpy( &m_delay, hdr, sizeof( m_delay ) ); } + m_traceVersion = fileVer; if( fileVer <= FileVersion( 0, 3, 1 ) ) { diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index ec91fcf5..e7d89fa4 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -232,6 +232,7 @@ public: void Shutdown() { m_shutdown.store( true, std::memory_order_relaxed ); } void Write( FileWrite& f ); + int GetTraceVersion() const { return m_traceVersion; } static const LoadProgress& GetLoadProgress() { return s_loadProgress; } @@ -377,6 +378,8 @@ private: DataBlock m_data; MbpsBlock m_mbpsData; + int m_traceVersion; + static LoadProgress s_loadProgress; };