diff --git a/profiler/src/profiler/TracyView.hpp b/profiler/src/profiler/TracyView.hpp index 9a2f95c9..02ab5d8f 100644 --- a/profiler/src/profiler/TracyView.hpp +++ b/profiler/src/profiler/TracyView.hpp @@ -521,6 +521,7 @@ private: bool m_statSeparateInlines = false; bool m_mergeInlines = false; bool m_relativeInlines = false; + bool m_topInline = false; bool m_statShowAddress = false; bool m_statShowKernel = true; bool m_groupChildrenLocations = false; diff --git a/profiler/src/profiler/TracyView_Samples.cpp b/profiler/src/profiler/TracyView_Samples.cpp index d82be086..9b7da79f 100644 --- a/profiler/src/profiler/TracyView_Samples.cpp +++ b/profiler/src/profiler/TracyView_Samples.cpp @@ -272,7 +272,7 @@ void View::DrawSamplesStatistics( Vector& data, int64_t timeRange, Accu } Vector inSymList; - if( !m_statSeparateInlines && !hasNoSamples && v.count > 0 && v.symAddr != 0 && expand ) + if( !m_statSeparateInlines && !hasNoSamples && v.count > 0 && v.symAddr != 0 && ( expand || m_topInline ) ) { assert( v.count > 0 ); assert( symlen != 0 ); @@ -364,6 +364,7 @@ void View::DrawSamplesStatistics( Vector& data, int64_t timeRange, Accu } } + const auto origName = name; if( hasNoSamples ) { if( isKernel ) @@ -383,6 +384,15 @@ void View::DrawSamplesStatistics( Vector& data, int64_t timeRange, Accu } else { + if( !inSymList.empty() && m_topInline ) + { + const auto topName = m_worker.GetString( symMap.find( inSymList[0].symAddr )->second.name ); + if( topName != name ) + { + parentName = name; + name = topName; + } + } ImGui::PushID( idx++ ); bool clicked; if( isKernel ) @@ -552,7 +562,22 @@ void View::DrawSamplesStatistics( Vector& data, int64_t timeRange, Accu break; } - const auto sn = iv.symAddr == v.symAddr ? "[ - self - ]" : name; + const char* sn; + if( iv.symAddr == v.symAddr ) + { + if( parentName ) + { + sn = parentName; + } + else + { + sn = "[ - self - ]"; + } + } + else + { + sn = name; + } if( m_mergeInlines || iv.excl == 0 ) { if( m_vd.shortenName == ShortenName::Never ) diff --git a/profiler/src/profiler/TracyView_Statistics.cpp b/profiler/src/profiler/TracyView_Statistics.cpp index 92f4fccd..55ca58aa 100644 --- a/profiler/src/profiler/TracyView_Statistics.cpp +++ b/profiler/src/profiler/TracyView_Statistics.cpp @@ -563,6 +563,10 @@ void View::DrawStatistics() ImGui::Spacing(); ImGui::SameLine(); ImGui::Checkbox( ICON_FA_LINK " Base relative", &m_relativeInlines ); + ImGui::SameLine(); + ImGui::Spacing(); + ImGui::SameLine(); + ImGui::Checkbox( ICON_FA_FIRE " Top inline", &m_topInline ); if( m_statSeparateInlines ) ImGui::EndDisabled(); }