Skip to content

Commit 33905b2

Browse files
committed
Dim external frames in local call stacks.
1 parent d067556 commit 33905b2

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

profiler/src/profiler/TracySourceView.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,9 +2624,13 @@ uint64_t SourceView::RenderSymbolAsmView( const AddrStatData& as, Worker& worker
26242624
const auto normalized = view.GetShortenName() != ShortenName::Never ? ShortenZoneName( ShortenName::OnlyNormalize, symName ) : symName;
26252625
const auto fn = worker.GetString( lcs->data[i].file );
26262626
const auto srcline = lcs->data[i].line;
2627+
const auto external = worker.IsFrameExternal( lcs->data[i].file, lcs->imageName );
26272628
if( srcline != 0 )
26282629
{
2629-
if( ImGui::BeginMenu( normalized ) )
2630+
if( external ) ImGui::PushStyleColor( ImGuiCol_Text, ImGui::GetStyle().Colors[ImGuiCol_TextDisabled] );
2631+
const auto extend = ImGui::BeginMenu( normalized );
2632+
if( external ) ImGui::PopStyleColor();
2633+
if( extend )
26302634
{
26312635
if( SourceFileValid( fn, worker.GetCaptureTime(), view, worker ) )
26322636
{
@@ -2666,7 +2670,14 @@ uint64_t SourceView::RenderSymbolAsmView( const AddrStatData& as, Worker& worker
26662670
}
26672671
else
26682672
{
2669-
ImGui::TextDisabled( "%s", normalized );
2673+
if( external )
2674+
{
2675+
TextDisabledUnformatted( normalized );
2676+
}
2677+
else
2678+
{
2679+
ImGui::TextUnformatted( normalized );
2680+
}
26702681
}
26712682
ImGui::PopID();
26722683
}

profiler/src/profiler/TracyUtility.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,14 @@ void PrintLocalStack( const CallstackFrameData* frame, const Worker& worker, con
223223
ImGui::SameLine();
224224
const auto symName = worker.GetString( frame->data[i].name );
225225
const auto normalized = view.GetShortenName() != ShortenName::Never ? ShortenZoneName( ShortenName::OnlyNormalize, symName ) : symName;
226-
ImGui::Text( "%s", normalized );
226+
if( worker.IsFrameExternal( frame->data[i].file, frame->imageName ) )
227+
{
228+
TextDisabledUnformatted( normalized );
229+
}
230+
else
231+
{
232+
ImGui::TextUnformatted( normalized );
233+
}
227234
ImGui::SameLine();
228235
ImGui::PushFont( g_fonts.normal, FontSmall );
229236
ImGui::AlignTextToFramePadding();

0 commit comments

Comments
 (0)