Add zone running time UI to flame graph window.

This commit is contained in:
Bartosz Taudul 2024-09-28 16:17:42 +02:00
parent 98a064efa9
commit 21721dd814
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 15 additions and 0 deletions

View File

@ -513,6 +513,7 @@ private:
int m_statMode = 0; int m_statMode = 0;
int m_flameMode = 0; int m_flameMode = 0;
bool m_flameSort = false; bool m_flameSort = false;
bool m_flameRunningTime = false;
int m_statSampleLocation = 2; int m_statSampleLocation = 2;
bool m_statHideUnknown = true; bool m_statHideUnknown = true;
bool m_showAllSymbols = false; bool m_showAllSymbols = false;

View File

@ -1,3 +1,4 @@
#include <assert.h>
#include <inttypes.h> #include <inttypes.h>
#include "TracyColor.hpp" #include "TracyColor.hpp"
@ -445,6 +446,19 @@ void View::DrawFlameGraph()
ImGui::Checkbox( ICON_FA_ARROW_UP_WIDE_SHORT " Sort by time", &m_flameSort ); ImGui::Checkbox( ICON_FA_ARROW_UP_WIDE_SHORT " Sort by time", &m_flameSort );
if( m_flameMode == 0 )
{
if( m_worker.HasContextSwitches() )
{
ImGui::SameLine();
ImGui::Checkbox( "Running time", &m_flameRunningTime );
}
else
{
assert( !m_flameRunningTime );
}
}
auto expand = ImGui::TreeNode( ICON_FA_SHUFFLE " Visible threads:" ); auto expand = ImGui::TreeNode( ICON_FA_SHUFFLE " Visible threads:" );
ImGui::SameLine(); ImGui::SameLine();
size_t visibleThreads = 0; size_t visibleThreads = 0;