1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Merge pull request #665 from tiago-rodrigues/trodrigues/offline_symbol_resolve

Add support for offline callstack symbol resolving
This commit is contained in:
Bartosz Taudul
2023-11-27 16:53:22 +01:00
committed by GitHub
12 changed files with 737 additions and 74 deletions
+18 -3
View File
@@ -553,11 +553,12 @@ Worker::Worker( const char* name, const char* program, const std::vector<ImportE
}
}
Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks, bool allowStringModification)
: m_hasData( true )
, m_stream( nullptr )
, m_buffer( nullptr )
, m_inconsistentSamples( false )
, m_allowStringModification(allowStringModification)
{
auto loadStart = std::chrono::high_resolution_clock::now();
@@ -707,7 +708,12 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
f.Read( sz );
m_data.stringMap.reserve( sz );
m_data.stringData.reserve_exact( sz, m_slab );
if( !m_allowStringModification )
{
m_data.stringData.reserve_exact( sz, m_slab );
}
for( uint64_t i=0; i<sz; i++ )
{
uint64_t ptr, ssz;
@@ -716,7 +722,16 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
f.Read( dst, ssz );
dst[ssz] = '\0';
m_data.stringMap.emplace( charutil::StringKey { dst, size_t( ssz ) }, i );
m_data.stringData[i] = ( dst );
if( m_allowStringModification )
{
m_data.stringData.push_back( dst );
}
else
{
m_data.stringData[i] = ( dst );
}
pointerMap.emplace( ptr, dst );
}