1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-30 04:43:53 +00:00

Show number of inlined functions in a symbol.

This commit is contained in:
Bartosz Taudul 2024-05-25 12:51:17 +02:00
parent f0d3eb1dfe
commit 071d440955
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -1219,22 +1219,20 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::PopFont(); ImGui::PopFont();
ImGui::AlignTextToFramePadding();
{
const auto imageName = worker.GetString( sym->imageName );
char tmp[1024];
snprintf( tmp, 1024, "%s 0x%" PRIx64, imageName, m_baseAddr );
ImGui::SameLine( ImGui::GetWindowContentRegionMax().x - ImGui::CalcTextSize( tmp ).x - ImGui::GetStyle().FramePadding.x * 2 );
TextDisabledUnformatted( tmp );
}
if( ImGui::IsKeyDown( ImGuiKey_Z ) ) m_childCalls = !m_childCalls;
if( ImGui::IsKeyDown( ImGuiKey_X ) ) m_propagateInlines = !m_propagateInlines;
const bool limitView = view.m_statRange.active;
auto inlineList = worker.GetInlineSymbolList( m_baseAddr, m_codeLen ); auto inlineList = worker.GetInlineSymbolList( m_baseAddr, m_codeLen );
const auto symEnd = m_baseAddr + m_codeLen;
if( inlineList ) if( inlineList )
{ {
auto it = inlineList;
while( *it < symEnd ) ++it;
const auto inlineCount = it - inlineList;
if( inlineCount > 0 )
{
ImGui::SameLine();
ImGui::AlignTextToFramePadding();
ImGui::TextDisabled( "(%s inlined functions)", RealToString( inlineCount + 1 ) );
}
if( m_calcInlineStats ) if( m_calcInlineStats )
{ {
ImGui::SameLine(); ImGui::SameLine();
@ -1242,6 +1240,23 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
TextColoredUnformatted( ImVec4( 1.f, 1.f, 0.2f, 1.f ), ICON_FA_TRIANGLE_EXCLAMATION ); TextColoredUnformatted( ImVec4( 1.f, 1.f, 0.2f, 1.f ), ICON_FA_TRIANGLE_EXCLAMATION );
TooltipIfHovered( "Context is limited to an inline function" ); TooltipIfHovered( "Context is limited to an inline function" );
} }
}
{
const auto imageName = worker.GetString( sym->imageName );
char tmp[1024];
snprintf( tmp, 1024, "%s 0x%" PRIx64, imageName, m_baseAddr );
ImGui::SameLine( ImGui::GetWindowContentRegionMax().x - ImGui::CalcTextSize( tmp ).x - ImGui::GetStyle().FramePadding.x * 2 );
ImGui::AlignTextToFramePadding();
TextDisabledUnformatted( tmp );
}
if( ImGui::IsKeyDown( ImGuiKey_Z ) ) m_childCalls = !m_childCalls;
if( ImGui::IsKeyDown( ImGuiKey_X ) ) m_propagateInlines = !m_propagateInlines;
const bool limitView = view.m_statRange.active;
if( inlineList )
{
if( SmallCheckbox( ICON_FA_SITEMAP " Function:", &m_calcInlineStats ) ) if( SmallCheckbox( ICON_FA_SITEMAP " Function:", &m_calcInlineStats ) )
{ {
m_asmTarget.line = 0; m_asmTarget.line = 0;
@ -1254,7 +1269,6 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
if( shortenName != ShortenName::Never ) currSymName = ShortenZoneName( ShortenName::OnlyNormalize, currSymName ); if( shortenName != ShortenName::Never ) currSymName = ShortenZoneName( ShortenName::OnlyNormalize, currSymName );
if( ImGui::BeginCombo( "##functionList", currSymName, ImGuiComboFlags_HeightLarge ) ) if( ImGui::BeginCombo( "##functionList", currSymName, ImGuiComboFlags_HeightLarge ) )
{ {
const auto symEnd = m_baseAddr + m_codeLen;
unordered_flat_map<uint64_t, uint32_t> symStat; unordered_flat_map<uint64_t, uint32_t> symStat;
if( limitView ) if( limitView )
{ {