From 74575250a51b1aecb20e6e29ee77204c8a91cdf9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 10 May 2019 20:32:47 +0200 Subject: [PATCH] Save message color data in trace dumps. --- server/TracyVersion.hpp | 2 +- server/TracyWorker.cpp | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/server/TracyVersion.hpp b/server/TracyVersion.hpp index 9a1a7172..b4e3eeec 100644 --- a/server/TracyVersion.hpp +++ b/server/TracyVersion.hpp @@ -7,7 +7,7 @@ namespace Version { enum { Major = 0 }; enum { Minor = 4 }; -enum { Patch = 7 }; +enum { Patch = 8 }; } } diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 663d25f7..6e009faf 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -719,7 +719,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) if( eventMask & EventType::Messages ) { m_data.messages.reserve_exact( sz, m_slab ); - if( fileVer >= FileVersion( 0, 4, 2 ) ) + if( fileVer >= FileVersion( 0, 4, 8 ) ) { int64_t refTime = 0; for( uint64_t i=0; i(); msgdata->time = ReadTimeOffset( f, refTime ); f.Read( msgdata->ref ); + f.Read( msgdata->color ); + m_data.messages[i] = msgdata; + msgMap.emplace( ptr, msgdata ); + } + } + else if( fileVer >= FileVersion( 0, 4, 2 ) ) + { + int64_t refTime = 0; + for( uint64_t i=0; i(); + msgdata->time = ReadTimeOffset( f, refTime ); + f.Read( msgdata->ref ); + msgdata->color = 0xFFFFFFFF; m_data.messages[i] = msgdata; msgMap.emplace( ptr, msgdata ); } @@ -742,6 +758,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) auto msgdata = m_slab.Alloc(); f.Read( msgdata, sizeof( MessageData::time ) + sizeof( MessageData::ref ) ); if( fileVer <= FileVersion( 0, 3, 0 ) ) f.Skip( 7 ); + msgdata->color = 0xFFFFFFFF; m_data.messages[i] = msgdata; msgMap.emplace( ptr, msgdata ); } @@ -754,10 +771,14 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) { f.Skip( sz * ( sizeof( uint64_t ) + 24 ) ); } - else + else if( fileVer <= FileVersion( 0, 4, 7 ) ) { f.Skip( sz * ( sizeof( uint64_t ) + sizeof( MessageData::time ) + sizeof( MessageData::ref ) ) ); } + else + { + f.Skip( sz * ( sizeof( uint64_t ) + sizeof( MessageData::time ) + sizeof( MessageData::ref ) + sizeof( MessageData::color ) ) ); + } } s_loadProgress.progress.store( LoadProgress::Zones, std::memory_order_relaxed ); @@ -4067,6 +4088,7 @@ void Worker::Write( FileWrite& f ) f.Write( &ptr, sizeof( ptr ) ); WriteTimeOffset( f, refTime, v->time ); f.Write( &v->ref, sizeof( v->ref ) ); + f.Write( &v->color, sizeof( v->color ) ); } }