Include child calls in inline propagation.

This commit is contained in:
Bartosz Taudul 2022-10-09 21:12:47 +02:00
parent 720f339784
commit 60f0ed8c0e
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -5038,10 +5038,13 @@ void SourceView::GatherAdditionalIpStats( uint64_t baseAddr, AddrStatData& as, c
auto frame = worker.GetCallstackFrame( worker.PackPointer( ip ) ); auto frame = worker.GetCallstackFrame( worker.PackPointer( ip ) );
if( frame ) if( frame )
{ {
auto ffn = worker.GetString( frame->data[0].file ); const auto end = m_propagateInlines ? frame->size : 1;
for( uint8_t i=0; i<end; i++ )
{
auto ffn = worker.GetString( frame->data[i].file );
if( strcmp( ffn, filename ) == 0 ) if( strcmp( ffn, filename ) == 0 )
{ {
const auto line = frame->data[0].line; const auto line = frame->data[i].line;
if( line != 0 ) if( line != 0 )
{ {
auto sit = as.ipCountSrc.find( line ); auto sit = as.ipCountSrc.find( line );
@ -5063,6 +5066,7 @@ void SourceView::GatherAdditionalIpStats( uint64_t baseAddr, AddrStatData& as, c
} }
} }
} }
}
else else
{ {
for( uint64_t ip = baseAddr; ip < baseAddr + sym->size.Val(); ip++ ) for( uint64_t ip = baseAddr; ip < baseAddr + sym->size.Val(); ip++ )
@ -5087,10 +5091,13 @@ void SourceView::GatherAdditionalIpStats( uint64_t baseAddr, AddrStatData& as, c
auto frame = worker.GetCallstackFrame( worker.PackPointer( ip ) ); auto frame = worker.GetCallstackFrame( worker.PackPointer( ip ) );
if( frame ) if( frame )
{ {
auto ffn = worker.GetString( frame->data[0].file ); const auto end = m_propagateInlines ? frame->size : 1;
for( uint8_t i=0; i<end; i++ )
{
auto ffn = worker.GetString( frame->data[i].file );
if( strcmp( ffn, filename ) == 0 ) if( strcmp( ffn, filename ) == 0 )
{ {
const auto line = frame->data[0].line; const auto line = frame->data[i].line;
if( line != 0 ) if( line != 0 )
{ {
auto sit = as.ipCountSrc.find( line ); auto sit = as.ipCountSrc.find( line );
@ -5113,6 +5120,7 @@ void SourceView::GatherAdditionalIpStats( uint64_t baseAddr, AddrStatData& as, c
} }
} }
} }
}
void SourceView::GatherChildStats( uint64_t baseAddr, unordered_flat_map<uint64_t, uint32_t>& map, Worker& worker, bool limitView, const View& view ) void SourceView::GatherChildStats( uint64_t baseAddr, unordered_flat_map<uint64_t, uint32_t>& map, Worker& worker, bool limitView, const View& view )
{ {