diff --git a/server/TracyView.hpp b/server/TracyView.hpp index f4c1e68b..666deddb 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -495,6 +495,7 @@ private: bool m_showUnknownFrames = true; bool m_statSeparateInlines = false; bool m_mergeInlines = false; + bool m_relativeInlines = false; bool m_statShowAddress = false; bool m_statShowKernel = true; bool m_groupChildrenLocations = false; diff --git a/server/TracyView_Samples.cpp b/server/TracyView_Samples.cpp index 016a7d95..6a27e07a 100644 --- a/server/TracyView_Samples.cpp +++ b/server/TracyView_Samples.cpp @@ -383,6 +383,7 @@ void View::DrawSamplesStatistics( Vector& data, int64_t timeRange, Accu ImGui::TableNextColumn(); TextDisabledUnformatted( imageName ); ImGui::TableNextColumn(); + const auto baseCnt = cnt; if( cnt > 0 ) { char buf[64]; @@ -420,6 +421,7 @@ void View::DrawSamplesStatistics( Vector& data, int64_t timeRange, Accu { assert( v.count > 0 ); assert( symlen != 0 ); + const auto revBaseCnt = 100.0 / baseCnt; auto inSym = m_worker.GetInlineSymbolList( v.symAddr, symlen ); assert( inSym != nullptr ); const auto symEnd = v.symAddr + symlen; @@ -642,12 +644,27 @@ void View::DrawSamplesStatistics( Vector& data, int64_t timeRange, Accu { const auto t = cnt * period; ImGui::TextUnformatted( TimeToString( t ) ); - PrintStringPercent( buf, 100. * t / timeRange ); + if( m_relativeInlines ) + { + const auto tBase = baseCnt * period; + PrintStringPercent( buf, 100. * t / tBase ); + } + else + { + PrintStringPercent( buf, 100. * t / timeRange ); + } } else { ImGui::TextUnformatted( RealToString( cnt ) ); - PrintStringPercent( buf, cnt * revSampleCount100 ); + if( m_relativeInlines ) + { + PrintStringPercent( buf, cnt * revBaseCnt ); + } + else + { + PrintStringPercent( buf, cnt * revSampleCount100 ); + } } ImGui::SameLine(); TextDisabledUnformatted( buf ); diff --git a/server/TracyView_Statistics.cpp b/server/TracyView_Statistics.cpp index 739f0f46..a4b924e6 100644 --- a/server/TracyView_Statistics.cpp +++ b/server/TracyView_Statistics.cpp @@ -304,6 +304,10 @@ void View::DrawStatistics() ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); + ImGui::Checkbox( "Relative", &m_relativeInlines ); + ImGui::SameLine(); + ImGui::Spacing(); + ImGui::SameLine(); ImGui::Checkbox( ICON_FA_AT " Address", &m_statShowAddress ); ImGui::SameLine(); ImGui::Spacing();