From 0333b9f591e4cf887e25d8159996918bf880c5a8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 25 May 2024 12:54:12 +0200 Subject: [PATCH] Hide "propagate inlines" checkbox if there are no inlined functions. --- profiler/src/profiler/TracySourceView.cpp | 8 ++++---- profiler/src/profiler/TracySourceView.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/profiler/src/profiler/TracySourceView.cpp b/profiler/src/profiler/TracySourceView.cpp index 2248407f..fc135e36 100644 --- a/profiler/src/profiler/TracySourceView.cpp +++ b/profiler/src/profiler/TracySourceView.cpp @@ -1717,14 +1717,14 @@ void SourceView::RenderSymbolView( Worker& worker, View& view ) switch( m_displayMode ) { case DisplaySource: - RenderSymbolSourceView( as, worker, view ); + RenderSymbolSourceView( as, worker, view, inlineList != nullptr ); break; case DisplayAsm: jumpOut = RenderSymbolAsmView( as, worker, view ); break; case DisplayMixed: ImGui::Columns( 2 ); - RenderSymbolSourceView( as, worker, view ); + RenderSymbolSourceView( as, worker, view, inlineList != nullptr ); ImGui::NextColumn(); jumpOut = RenderSymbolAsmView( as, worker, view ); ImGui::EndColumns(); @@ -1845,10 +1845,10 @@ static uint32_t GetGoodnessColor( float inRatio ) return GoodnessColor[ratio]; } -void SourceView::RenderSymbolSourceView( const AddrStatData& as, Worker& worker, const View& view ) +void SourceView::RenderSymbolSourceView( const AddrStatData& as, Worker& worker, const View& view, bool hasInlines ) { const auto scale = GetScale(); - if( !m_calcInlineStats && ( as.ipTotalAsm.local + as.ipTotalAsm.ext ) > 0 || ( view.m_statRange.active && worker.GetSamplesForSymbol( m_baseAddr ) ) ) + if( hasInlines && !m_calcInlineStats && ( as.ipTotalAsm.local + as.ipTotalAsm.ext ) > 0 || ( view.m_statRange.active && worker.GetSamplesForSymbol( m_baseAddr ) ) ) { const auto samplesReady = worker.AreSymbolSamplesReady(); if( !samplesReady ) diff --git a/profiler/src/profiler/TracySourceView.hpp b/profiler/src/profiler/TracySourceView.hpp index 66d2d3fe..d317b8ac 100644 --- a/profiler/src/profiler/TracySourceView.hpp +++ b/profiler/src/profiler/TracySourceView.hpp @@ -183,7 +183,7 @@ private: void RenderSimpleSourceView(); void RenderSymbolView( Worker& worker, View& view ); - void RenderSymbolSourceView( const AddrStatData& as, Worker& worker, const View& view ); + void RenderSymbolSourceView( const AddrStatData& as, Worker& worker, const View& view, bool hasInlines ); uint64_t RenderSymbolAsmView( const AddrStatData& as, Worker& worker, View& view ); void RenderLine( const Tokenizer::Line& line, int lineNum, const AddrStat& ipcnt, const AddrStatData& as, Worker* worker, const View* view );