From 06ca4e2d168b3c891f97f292a0c61ae56e356c0c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 26 Jul 2020 00:31:54 +0200 Subject: [PATCH] Send single string for symbol information. --- client/TracyProfiler.cpp | 3 +-- common/TracyQueue.hpp | 1 - server/TracyWorker.cpp | 10 +++++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 21308321..a2064712 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -2873,11 +2873,10 @@ void Profiler::HandleSymbolQuery( uint64_t symbol ) #ifdef TRACY_HAS_CALLSTACK const auto sym = DecodeSymbolAddress( symbol ); - SendString( uint64_t( sym.file ), sym.file, QueueType::CustomStringData ); + SendSingleString( sym.file ); QueueItem item; MemWrite( &item.hdr.type, QueueType::SymbolInformation ); - MemWrite( &item.symbolInformation.file, uint64_t( sym.file ) ); MemWrite( &item.symbolInformation.line, sym.line ); MemWrite( &item.symbolInformation.symAddr, symbol ); diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 2e84e205..ec57bd96 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -393,7 +393,6 @@ struct QueueCallstackFrame struct QueueSymbolInformation { - uint64_t file; uint32_t line; uint64_t symAddr; }; diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 7f460c8e..af3614d9 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -5503,12 +5503,13 @@ void Worker::ProcessSymbolInformation( const QueueSymbolInformation& ev ) auto it = m_pendingSymbols.find( ev.symAddr ); assert( it != m_pendingSymbols.end() ); - auto fit = m_pendingCustomStrings.find( ev.file ); - assert( fit != m_pendingCustomStrings.end() ); + assert( m_pendingSingleString.ptr != nullptr ); + const auto idx = m_pendingSingleString.idx; + m_pendingSingleString.ptr = nullptr; SymbolData sd; sd.name = it->second.name; - sd.file = StringIdx( fit->second.idx ); + sd.file = StringIdx( idx ); sd.line = ev.line; sd.imageName = it->second.imageName; sd.callFile = it->second.file; @@ -5535,12 +5536,11 @@ void Worker::ProcessSymbolInformation( const QueueSymbolInformation& ev ) m_data.symbolLocInline.push_back( ev.symAddr ); } - StringRef ref( StringRef::Idx, fit->second.idx ); + StringRef ref( StringRef::Idx, idx ); auto cit = m_checkedFileStrings.find( ref ); if( cit == m_checkedFileStrings.end() ) CacheSource( ref ); m_pendingSymbols.erase( it ); - m_pendingCustomStrings.erase( fit ); } void Worker::ProcessCodeInformation( const QueueCodeInformation& ev )