Store list of inline symbols.

This commit is contained in:
Bartosz Taudul 2020-04-08 12:44:12 +02:00
parent a7fffe7e13
commit 1da1d31e1c
2 changed files with 26 additions and 1 deletions

View File

@ -1698,12 +1698,21 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
Int24 size;
f.Read9( symAddr, name, file, line, imageName, callFile, callLine, isInline, size );
m_data.symbolMap.emplace( symAddr, SymbolData { name, file, line, imageName, callFile, callLine, isInline, size } );
if( !isInline ) m_data.symbolLoc.push_back( SymbolLocation { symAddr, size.Val() } );
if( isInline )
{
m_data.symbolLocInline.push_back( symAddr );
}
else
{
m_data.symbolLoc.push_back( SymbolLocation { symAddr, size.Val() } );
}
}
#ifdef NO_PARALLEL_SORT
pdqsort_branchless( m_data.symbolLoc.begin(), m_data.symbolLoc.end(), [] ( const auto& l, const auto& r ) { return l.addr < r.addr; } );
pdqsort_branchless( m_data.symbolLocInline.begin(), m_data.symbolLocInline.end() );
#else
std::sort( std::execution::par_unseq, m_data.symbolLoc.begin(), m_data.symbolLoc.end(), [] ( const auto& l, const auto& r ) { return l.addr < r.addr; } );
std::sort( std::execution::par_unseq, m_data.symbolLocInline.begin(), m_data.symbolLocInline.end() );
#endif
}
else if( fileVer >= FileVersion( 0, 6, 5 ) )
@ -2918,6 +2927,15 @@ void Worker::Exec()
std::sort( std::execution::par_unseq, m_data.symbolLoc.begin(), m_data.symbolLoc.end(), [] ( const auto& l, const auto& r ) { return l.addr < r.addr; } );
#endif
}
if( m_data.newInlineSymbolsWereAdded )
{
m_data.newInlineSymbolsWereAdded = false;
#ifdef NO_PARALLEL_SORT
pdqsort_branchless( m_data.symbolLocInline.begin(), m_data.symbolLocInline.end() );
#else
std::sort( std::execution::par_unseq, m_data.symbolLocInline.begin(), m_data.symbolLocInline.end() );
#endif
}
if( !m_serverQueryQueue.empty() && m_serverQuerySpaceLeft > 0 )
{
@ -5579,6 +5597,11 @@ void Worker::ProcessSymbolInformation( const QueueSymbolInformation& ev )
if( !m_data.newSymbolsWereAdded ) m_data.newSymbolsWereAdded = true;
m_data.symbolLoc.push_back( SymbolLocation { ev.symAddr, it->second.size } );
}
else
{
if( !m_data.newInlineSymbolsWereAdded ) m_data.newInlineSymbolsWereAdded = true;
m_data.symbolLocInline.push_back( ev.symAddr );
}
m_pendingSymbols.erase( it );
m_pendingCustomStrings.erase( fit );

View File

@ -234,7 +234,9 @@ private:
unordered_flat_map<uint64_t, SymbolData> symbolMap;
unordered_flat_map<uint64_t, SymbolStats> symbolStats;
Vector<SymbolLocation> symbolLoc;
Vector<uint64_t> symbolLocInline;
bool newSymbolsWereAdded = false;
bool newInlineSymbolsWereAdded = false;
#ifndef TRACY_NO_STATISTICS
unordered_flat_map<VarArray<CallstackFrameId>*, uint32_t, VarArrayHasher<CallstackFrameId>, VarArrayComparator<CallstackFrameId>> parentCallstackMap;