1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Fix source-less sample count calculations.

This commit is contained in:
Bartosz Taudul 2020-04-09 02:04:22 +02:00
parent 3177865fc2
commit 0f42dc2e4c

View File

@ -473,23 +473,26 @@ void SourceView::RenderSymbolView( const Worker& worker )
{ {
for( auto& ip : *ipmap ) for( auto& ip : *ipmap )
{ {
auto frame = worker.GetCallstackFrame( ip.first ); if( m_file )
if( frame )
{ {
auto ffn = worker.GetString( frame->data[0].file ); auto frame = worker.GetCallstackFrame( ip.first );
if( strcmp( ffn, m_file ) == 0 ) if( frame )
{ {
const auto line = frame->data[0].line; auto ffn = worker.GetString( frame->data[0].file );
auto it = ipcountSrc.find( line ); if( strcmp( ffn, m_file ) == 0 )
if( it == ipcountSrc.end() )
{ {
ipcountSrc.emplace( line, ip.second ); const auto line = frame->data[0].line;
auto it = ipcountSrc.find( line );
if( it == ipcountSrc.end() )
{
ipcountSrc.emplace( line, ip.second );
}
else
{
it->second += ip.second;
}
iptotalSrc += ip.second;
} }
else
{
it->second += ip.second;
}
iptotalSrc += ip.second;
} }
} }