Implement inline cost propagation down the stack.

This commit is contained in:
Bartosz Taudul 2022-10-09 20:57:29 +02:00
parent dbad69cd4f
commit 720f339784
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -4911,10 +4911,13 @@ void SourceView::GatherIpStats( uint64_t baseAddr, AddrStatData& as, const Worke
auto frame = worker.GetCallstackFrame( it->ip ); auto frame = worker.GetCallstackFrame( it->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 );
@ -4934,6 +4937,7 @@ void SourceView::GatherIpStats( uint64_t baseAddr, AddrStatData& as, const Worke
} }
} }
} }
}
auto addr = worker.GetCanonicalPointer( it->ip ); auto addr = worker.GetCanonicalPointer( it->ip );
auto sit = as.ipCountAsm.find( addr ); auto sit = as.ipCountAsm.find( addr );
@ -4969,10 +4973,13 @@ void SourceView::GatherIpStats( uint64_t baseAddr, AddrStatData& as, const Worke
auto frame = worker.GetCallstackFrame( ip.first ); auto frame = worker.GetCallstackFrame( ip.first );
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 it = as.ipCountSrc.find( line ); auto it = as.ipCountSrc.find( line );
@ -4995,6 +5002,7 @@ void SourceView::GatherIpStats( uint64_t baseAddr, AddrStatData& as, const Worke
} }
} }
} }
}
void SourceView::GatherAdditionalIpStats( uint64_t baseAddr, AddrStatData& as, const Worker& worker, bool limitView, const View& view ) void SourceView::GatherAdditionalIpStats( uint64_t baseAddr, AddrStatData& as, const Worker& worker, bool limitView, const View& view )
{ {