mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Implement inline function aggregation.
This commit is contained in:
parent
f04cdb7782
commit
3af5c7b331
@ -424,6 +424,8 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
assert( inSym != nullptr );
|
||||
const auto symEnd = v.symAddr + symlen;
|
||||
Vector<SymList> inSymList;
|
||||
if( !m_mergeInlines )
|
||||
{
|
||||
while( *inSym < symEnd )
|
||||
{
|
||||
auto sit = inlineMap.find( *inSym );
|
||||
@ -437,6 +439,60 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
||||
}
|
||||
inSym++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unordered_flat_map<uint32_t, uint64_t> mergeMap;
|
||||
unordered_flat_map<uint64_t, SymList> outMap;
|
||||
while( *inSym < symEnd )
|
||||
{
|
||||
auto symAddr = *inSym;
|
||||
auto sit = inlineMap.find( symAddr );
|
||||
auto sym = symMap.find( symAddr );
|
||||
assert( sym != symMap.end() );
|
||||
auto mit = mergeMap.find( sym->second.name.Idx() );
|
||||
if( mit == mergeMap.end() )
|
||||
{
|
||||
mergeMap.emplace( sym->second.name.Idx(), symAddr );
|
||||
}
|
||||
else
|
||||
{
|
||||
symAddr = mit->second;
|
||||
}
|
||||
if( sit != inlineMap.end() )
|
||||
{
|
||||
auto oit = outMap.find( symAddr );
|
||||
if( oit == outMap.end() )
|
||||
{
|
||||
outMap.emplace( symAddr, SymList { symAddr, sit->second.incl, sit->second.excl, 1 } );
|
||||
}
|
||||
else
|
||||
{
|
||||
oit->second.incl += sit->second.incl;
|
||||
oit->second.excl += sit->second.excl;
|
||||
oit->second.count++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auto oit = outMap.find( symAddr );
|
||||
if( oit == outMap.end() )
|
||||
{
|
||||
outMap.emplace( symAddr, SymList { symAddr, 0, 0, 1 } );
|
||||
}
|
||||
else
|
||||
{
|
||||
oit->second.count++;
|
||||
}
|
||||
}
|
||||
inSym++;
|
||||
}
|
||||
inSymList.reserve( outMap.size() );
|
||||
for( auto& v : outMap )
|
||||
{
|
||||
inSymList.push_back( v.second );
|
||||
}
|
||||
}
|
||||
auto statIt = inlineMap.find( v.symAddr );
|
||||
if( statIt != inlineMap.end() )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user