mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Don't depend on callstack frames to match hw samples to source.
This commit is contained in:
parent
2f3ee594f0
commit
bc4016e97c
@ -4055,29 +4055,26 @@ void SourceView::GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, un
|
|||||||
|
|
||||||
if( filename )
|
if( filename )
|
||||||
{
|
{
|
||||||
auto frame = worker.GetCallstackFrame( worker.PackPointer( addr ) );
|
uint32_t line;
|
||||||
if( frame )
|
const auto fref = worker.GetLocationForAddress( addr, line );
|
||||||
|
if( line != 0 )
|
||||||
{
|
{
|
||||||
auto ffn = worker.GetString( frame->data[0].file );
|
auto ffn = worker.GetString( fref );
|
||||||
if( strcmp( ffn, filename ) == 0 )
|
if( strcmp( ffn, filename ) == 0 )
|
||||||
{
|
{
|
||||||
const auto line = frame->data[0].line;
|
auto it = ipcountSrc.find( line );
|
||||||
if( line != 0 )
|
if( it == ipcountSrc.end() )
|
||||||
{
|
{
|
||||||
auto it = ipcountSrc.find( line );
|
ipcountSrc.emplace( line, AddrStat{ stat, 0 } );
|
||||||
if( it == ipcountSrc.end() )
|
if( ipmaxSrc.local < stat ) ipmaxSrc.local = stat;
|
||||||
{
|
|
||||||
ipcountSrc.emplace( line, AddrStat{ stat, 0 } );
|
|
||||||
if( ipmaxSrc.local < stat ) ipmaxSrc.local = stat;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const auto sum = it->second.local + stat;
|
|
||||||
it->second.local = sum;
|
|
||||||
if( ipmaxSrc.local < sum ) ipmaxSrc.local = sum;
|
|
||||||
}
|
|
||||||
iptotalSrc.local += stat;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const auto sum = it->second.local + stat;
|
||||||
|
it->second.local = sum;
|
||||||
|
if( ipmaxSrc.local < sum ) ipmaxSrc.local = sum;
|
||||||
|
}
|
||||||
|
iptotalSrc.local += stat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user