From 51d5ef5b4e29a4eb09b58193b595664c0906ef2f Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 8 Apr 2020 17:12:15 +0200 Subject: [PATCH] Allow merging inlined function stats into base symbol. --- server/TracyView.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index be6121ee..b369d184 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -11382,6 +11382,34 @@ void View::DrawStatistics() } } + if( !m_statSeparateInlines ) + { + static unordered_flat_map baseMap; + assert( baseMap.empty() ); + for( auto& v : data ) + { + auto sym = m_worker.GetSymbolData( v.symAddr ); + const auto symAddr = ( sym && sym->isInline ) ? m_worker.GetSymbolForAddress( v.symAddr ) : v.symAddr; + auto it = baseMap.find( symAddr ); + if( it == baseMap.end() ) + { + baseMap.emplace( symAddr, SymList { symAddr, v.incl, v.excl } ); + } + else + { + assert( symAddr == it->second.symAddr ); + it->second.incl += v.incl; + it->second.excl += v.excl; + } + } + data.clear(); + for( auto& v : baseMap ) + { + data.push_back_no_space_check( v.second ); + } + baseMap.clear(); + } + if( data.empty() ) { ImGui::TextUnformatted( "No entries to be displayed." );