1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-01 05:03:53 +00:00

Hide "propagate inlines" checkbox if there are no inlined functions.

This commit is contained in:
Bartosz Taudul 2024-05-25 12:54:12 +02:00
parent 071d440955
commit 0333b9f591
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 5 additions and 5 deletions

View File

@ -1717,14 +1717,14 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
switch( m_displayMode ) switch( m_displayMode )
{ {
case DisplaySource: case DisplaySource:
RenderSymbolSourceView( as, worker, view ); RenderSymbolSourceView( as, worker, view, inlineList != nullptr );
break; break;
case DisplayAsm: case DisplayAsm:
jumpOut = RenderSymbolAsmView( as, worker, view ); jumpOut = RenderSymbolAsmView( as, worker, view );
break; break;
case DisplayMixed: case DisplayMixed:
ImGui::Columns( 2 ); ImGui::Columns( 2 );
RenderSymbolSourceView( as, worker, view ); RenderSymbolSourceView( as, worker, view, inlineList != nullptr );
ImGui::NextColumn(); ImGui::NextColumn();
jumpOut = RenderSymbolAsmView( as, worker, view ); jumpOut = RenderSymbolAsmView( as, worker, view );
ImGui::EndColumns(); ImGui::EndColumns();
@ -1845,10 +1845,10 @@ static uint32_t GetGoodnessColor( float inRatio )
return GoodnessColor[ratio]; 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(); 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(); const auto samplesReady = worker.AreSymbolSamplesReady();
if( !samplesReady ) if( !samplesReady )

View File

@ -183,7 +183,7 @@ private:
void RenderSimpleSourceView(); void RenderSimpleSourceView();
void RenderSymbolView( Worker& worker, View& view ); 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 ); 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 ); void RenderLine( const Tokenizer::Line& line, int lineNum, const AddrStat& ipcnt, const AddrStatData& as, Worker* worker, const View* view );