1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 20:33:52 +00:00

No parents if only child samples.

This commit is contained in:
Bartosz Taudul 2021-04-18 21:59:28 +02:00
parent 141a4bc0fe
commit cba72859e9
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -2530,8 +2530,6 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
inlineList++; inlineList++;
} }
} }
const auto& stats = *worker.GetSymbolStats( symAddrParents );
assert( !stats.parents.empty() );
if( m_font ) ImGui::PopFont(); if( m_font ) ImGui::PopFont();
ImGui::BeginTooltip(); ImGui::BeginTooltip();
@ -2545,10 +2543,14 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
TextFocused( "Child time:", TimeToString( ipcnt.ext * worker.GetSamplingPeriod() ) ); TextFocused( "Child time:", TimeToString( ipcnt.ext * worker.GetSamplingPeriod() ) );
TextFocused( "Child samples:", RealToString( ipcnt.ext ) ); TextFocused( "Child samples:", RealToString( ipcnt.ext ) );
} }
const auto& stats = *worker.GetSymbolStats( symAddrParents );
if( !stats.parents.empty() )
{
ImGui::Separator(); ImGui::Separator();
TextFocused( "Entry call stacks:", RealToString( stats.parents.size() ) ); TextFocused( "Entry call stacks:", RealToString( stats.parents.size() ) );
ImGui::SameLine(); ImGui::SameLine();
TextDisabledUnformatted( "(middle click to view)" ); TextDisabledUnformatted( "(middle click to view)" );
}
ImGui::EndTooltip(); ImGui::EndTooltip();
if( m_font ) ImGui::PushFont( m_font ); if( m_font ) ImGui::PushFont( m_font );
@ -2605,7 +2607,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
m_asmSampleSelect.clear(); m_asmSampleSelect.clear();
m_asmGroupSelect = -1; m_asmGroupSelect = -1;
} }
else if( ImGui::IsMouseClicked( 2 ) ) else if( !stats.parents.empty() && ImGui::IsMouseClicked( 2 ) )
{ {
view.ShowSampleParents( symAddrParents ); view.ShowSampleParents( symAddrParents );
} }