From 34587e6b4cb9564e9ccdf66b646f40d48dadae52 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 25 Jul 2026 18:41:55 +0200 Subject: [PATCH] Only show entry stacks button in symbol view when data is available. The button was displayed unconditionally, allowing the sample entry stacks window to be opened for symbols without any sample data. Gate it on the availability of callstack sample statistics and a non-empty reached map, following what the call stack window does. Checking for statistics readiness also prevents asserting when the button is used while a trace is still being loaded in the background. --- profiler/src/profiler/TracySourceView.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/profiler/src/profiler/TracySourceView.cpp b/profiler/src/profiler/TracySourceView.cpp index f287a647..2d500699 100644 --- a/profiler/src/profiler/TracySourceView.cpp +++ b/profiler/src/profiler/TracySourceView.cpp @@ -763,9 +763,16 @@ void SourceView::RenderSymbolView( Worker& worker, View& view, WindowConstraints ImGui::TextDisabled( "(+%s inlined functions)", RealToString( inlineCount ) ); } } - ImGui::SameLine(); - ImGui::AlignTextToFramePadding(); - if( ImGui::SmallButton( ICON_FA_ARROW_DOWN_SHORT_WIDE " Entry stacks" ) ) view.ShowSampleParents( m_symAddr, !m_calcInlineStats ); + if( worker.AreCallstackSamplesReady() ) + { + const auto stats = worker.GetSymbolStats( m_symAddr ); + if( stats && !stats->wasReached.empty() ) + { + ImGui::SameLine(); + ImGui::AlignTextToFramePadding(); + if( ImGui::SmallButton( ICON_FA_ARROW_DOWN_SHORT_WIDE " Entry stacks" ) ) view.ShowSampleParents( m_symAddr, !m_calcInlineStats ); + } + } if( inlineList ) { if( m_calcInlineStats )