From 033433b883c9b96c8aa406d160f5d67a3cec3ef2 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 25 Mar 2020 20:52:59 +0100 Subject: [PATCH] Save/load symbol code. --- server/TracyWorker.cpp | 39 +++++++++++++++++++++++++++++++++++++++ server/TracyWorker.hpp | 1 + 2 files changed, 40 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 76bf46a9..fc8af3b2 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -1671,6 +1671,36 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks ) } } + if( fileVer >= FileVersion( 0, 6, 7 ) ) + { + f.Read( sz ); + if( eventMask & EventType::SymbolCode ) + { + uint64_t ssz = 0; + m_data.symbolCode.reserve( sz ); + for( uint64_t i=0; i( std::chrono::high_resolution_clock::now() - loadStart ).count(); @@ -6623,6 +6653,15 @@ void Worker::Write( FileWrite& f ) f.Write( &v.first, sizeof( v.first ) ); f.Write( &v.second, sizeof( v.second ) ); } + + sz = m_data.symbolCode.size(); + f.Write( &sz, sizeof( sz ) ); + for( auto& v : m_data.symbolCode ) + { + f.Write( &v.first, sizeof( v.first ) ); + f.Write( &v.second.len, sizeof( v.second.len ) ); + f.Write( &v.second.data, v.second.len ); + } } void Worker::WriteTimeline( FileWrite& f, const Vector>& vec, int64_t& refTime ) diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 95aedbf7..e61e1f88 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -43,6 +43,7 @@ namespace EventType FrameImages = 1 << 4, ContextSwitches = 1 << 5, Samples = 1 << 6, + SymbolCode = 1 << 7, None = 0, All = std::numeric_limits::max()