Normalize frame names in wait stacks tree.

This commit is contained in:
Bartosz Taudul 2022-08-15 21:27:05 +02:00
parent 4d974da290
commit 9c4f257596
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -590,10 +590,16 @@ void View::DrawFrameTreeLevel( const unordered_flat_map<uint64_t, CallstackFrame
{ {
TextColoredUnformatted( 0xFF8888FF, frameName ); TextColoredUnformatted( 0xFF8888FF, frameName );
} }
else else if( m_shortenName == ShortenName::Never )
{ {
ImGui::TextUnformatted( frameName ); ImGui::TextUnformatted( frameName );
} }
else
{
const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, frameName );
expand = ImGui::TreeNodeEx( normalized, ImGuiTreeNodeFlags_DefaultOpen );
TooltipNormalizedName( frameName, normalized );
}
ImGui::Unindent( ImGui::GetTreeNodeToLabelSpacing() ); ImGui::Unindent( ImGui::GetTreeNodeToLabelSpacing() );
} }
else else
@ -603,11 +609,29 @@ void View::DrawFrameTreeLevel( const unordered_flat_map<uint64_t, CallstackFrame
else if( isKernel ) ImGui::PushStyleColor( ImGuiCol_Text, 0xFF8888FF ); else if( isKernel ) ImGui::PushStyleColor( ImGuiCol_Text, 0xFF8888FF );
if( tree.size() == 1 ) if( tree.size() == 1 )
{ {
expand = ImGui::TreeNodeEx( frameName, ImGuiTreeNodeFlags_DefaultOpen ); if( m_shortenName == ShortenName::Never )
{
expand = ImGui::TreeNodeEx( frameName, ImGuiTreeNodeFlags_DefaultOpen );
}
else
{
const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, frameName );
expand = ImGui::TreeNodeEx( normalized, ImGuiTreeNodeFlags_DefaultOpen );
TooltipNormalizedName( frameName, normalized );
}
} }
else else
{ {
expand = ImGui::TreeNode( frameName ); if( m_shortenName == ShortenName::Never )
{
expand = ImGui::TreeNode( frameName );
}
else
{
const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, frameName );
expand = ImGui::TreeNode( normalized );
TooltipNormalizedName( frameName, normalized );
}
} }
if( isKernel || frameName[0] == '[' ) ImGui::PopStyleColor(); if( isKernel || frameName[0] == '[' ) ImGui::PopStyleColor();
ImGui::PopID(); ImGui::PopID();