diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 3dd9b97d..5485afec 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -11035,7 +11035,7 @@ void View::DrawCompare() void View::DrawStatistics() { - ImGui::SetNextWindowSize( ImVec2( 1350, 600 ), ImGuiCond_FirstUseEver ); + ImGui::SetNextWindowSize( ImVec2( 1400, 600 ), ImGuiCond_FirstUseEver ); ImGui::Begin( "Statistics", &m_showStatistics, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse ); #ifdef TRACY_NO_STATISTICS ImGui::TextWrapped( "Collection of statistical data is disabled in this build." ); @@ -11166,11 +11166,11 @@ void View::DrawStatistics() if( !widthSet ) { widthSet = true; - ImGui::SetColumnWidth( 0, w * 0.3f ); - ImGui::SetColumnWidth( 1, w * 0.4f ); + ImGui::SetColumnWidth( 0, w * 0.325f ); + ImGui::SetColumnWidth( 1, w * 0.425f ); ImGui::SetColumnWidth( 2, w * 0.1f ); - ImGui::SetColumnWidth( 3, w * 0.1f ); - ImGui::SetColumnWidth( 4, w * 0.1f ); + ImGui::SetColumnWidth( 3, w * 0.075f ); + ImGui::SetColumnWidth( 4, w * 0.075f ); } ImGui::TextUnformatted( "Name" ); ImGui::NextColumn(); @@ -11271,6 +11271,8 @@ void View::DrawStatistics() ImGui::SameLine(); ImGui::TextUnformatted( "Location:" ); ImGui::SameLine(); + ImGui::RadioButton( "Smart", &m_statSampleLocation, 2 ); + ImGui::SameLine(); ImGui::RadioButton( "Entry point", &m_statSampleLocation, 0 ); ImGui::SameLine(); ImGui::RadioButton( "Sample", &m_statSampleLocation, 1 ); @@ -11373,10 +11375,10 @@ void View::DrawStatistics() if( !widthSet ) { widthSet = true; - ImGui::SetColumnWidth( 0, w * 0.3f ); - ImGui::SetColumnWidth( 1, w * 0.375f ); - ImGui::SetColumnWidth( 2, w * 0.125f ); - ImGui::SetColumnWidth( 3, w * 0.125f ); + ImGui::SetColumnWidth( 0, w * 0.31f ); + ImGui::SetColumnWidth( 1, w * 0.4f ); + ImGui::SetColumnWidth( 2, w * 0.115f ); + ImGui::SetColumnWidth( 3, w * 0.1f ); ImGui::SetColumnWidth( 4, w * 0.075f ); } ImGui::TextUnformatted( "Name" ); @@ -11413,15 +11415,30 @@ void View::DrawStatistics() name = m_worker.GetString( sit->second.name ); imageName = m_worker.GetString( sit->second.imageName ); isInline = sit->second.isInline; - if( m_statSampleLocation == 0 ) + switch( m_statSampleLocation ) { + case 0: file = m_worker.GetString( sit->second.file ); line = sit->second.line; - } - else - { + break; + case 1: file = m_worker.GetString( sit->second.callFile ); line = sit->second.callLine; + break; + case 2: + if( sit->second.isInline ) + { + file = m_worker.GetString( sit->second.callFile ); + line = sit->second.callLine; + } + else + { + file = m_worker.GetString( sit->second.file ); + line = sit->second.line; + } + default: + assert( false ); + break; } if( m_statHideUnknown && file[0] == '[' ) continue; symlen = sit->second.size.Val(); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 25e13473..992ad5af 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -355,7 +355,7 @@ private: bool m_statSelf = true; bool m_statSampleTime = true; int m_statMode = 0; - int m_statSampleLocation = 0; + int m_statSampleLocation = 2; bool m_statHideUnknown = true; bool m_showAllSymbols = false; int m_showCallstackFrameAddress = 0;