diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-08-15 21:04:57 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-08-15 21:04:57 +0300 |
commit | 389cf135c02b99c16a04eb5919ab06fc77289303 (patch) | |
tree | 36030e76d99d06236ce640281ec9be40dc6d606c /server/TracyView_Samples.cpp | |
parent | 6932eb4b79f1065160a7cb0be5a6779487db2ba1 (diff) |
Normalize frame names in sample parents call stack view.
Diffstat (limited to 'server/TracyView_Samples.cpp')
-rw-r--r-- | server/TracyView_Samples.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/server/TracyView_Samples.cpp b/server/TracyView_Samples.cpp index deb54862..058f4eaf 100644 --- a/server/TracyView_Samples.cpp +++ b/server/TracyView_Samples.cpp @@ -664,8 +664,10 @@ void View::DrawSampleParents() } assert( !stats.empty() ); + const auto symName = m_worker.GetString( symbol->name ); + const char* normalized = m_shortenName != ShortenName::Never ? ShortenZoneName( ShortenName::OnlyNormalize, symName ) : nullptr; ImGui::PushFont( m_bigFont ); - TextFocused( "Symbol:", m_worker.GetString( symbol->name ) ); + TextFocused( "Symbol:", normalized ? normalized : symName ); if( symbol->isInline ) { ImGui::SameLine(); @@ -677,6 +679,12 @@ void View::DrawSampleParents() TextDisabledUnformatted( "(without inlines)" ); } ImGui::PopFont(); + if( normalized && normalized != symName && strcmp( normalized, symName ) != 0 ) + { + ImGui::PushFont( m_smallFont ); + TextDisabledUnformatted( symName ); + ImGui::PopFont(); + } TextDisabledUnformatted( "Location:" ); ImGui::SameLine(); const auto callFile = m_worker.GetString( symbol->callFile ); @@ -816,10 +824,16 @@ void View::DrawSampleParents() { TextColoredUnformatted( 0xFF8888FF, txt ); } - else + else if( m_shortenName == ShortenName::Never ) { ImGui::TextUnformatted( txt ); } + else + { + const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, txt ); + ImGui::TextUnformatted( normalized ); + TooltipNormalizedName( txt, normalized ); + } ImGui::PopTextWrapPos(); } if( ImGui::IsItemClicked() ) |