mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-29 08:54:34 +00:00
Basic flame graph window layout.
This commit is contained in:
parent
5b75954c5b
commit
e4ec798762
@ -494,6 +494,7 @@ private:
|
|||||||
AccumulationMode m_statAccumulationMode = AccumulationMode::SelfOnly;
|
AccumulationMode m_statAccumulationMode = AccumulationMode::SelfOnly;
|
||||||
bool m_statSampleTime = true;
|
bool m_statSampleTime = true;
|
||||||
int m_statMode = 0;
|
int m_statMode = 0;
|
||||||
|
int m_flameMode = 0;
|
||||||
int m_statSampleLocation = 2;
|
int m_statSampleLocation = 2;
|
||||||
bool m_statHideUnknown = true;
|
bool m_statHideUnknown = true;
|
||||||
bool m_showAllSymbols = false;
|
bool m_showAllSymbols = false;
|
||||||
|
@ -92,6 +92,31 @@ void View::DrawFlameGraph()
|
|||||||
const auto scale = GetScale();
|
const auto scale = GetScale();
|
||||||
ImGui::SetNextWindowSize( ImVec2( 1400 * scale, 800 * scale ), ImGuiCond_FirstUseEver );
|
ImGui::SetNextWindowSize( ImVec2( 1400 * scale, 800 * scale ), ImGuiCond_FirstUseEver );
|
||||||
ImGui::Begin( "Flame graph", &m_showFlameGraph, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse );
|
ImGui::Begin( "Flame graph", &m_showFlameGraph, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse );
|
||||||
|
if( ImGui::GetCurrentWindowRead()->SkipItems ) { ImGui::End(); return; }
|
||||||
|
|
||||||
|
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 2, 2 ) );
|
||||||
|
ImGui::RadioButton( ICON_FA_SYRINGE " Instrumentation", &m_flameMode, 0 );
|
||||||
|
|
||||||
|
if( m_worker.AreCallstackSamplesReady() && m_worker.GetCallstackSampleCount() > 0 )
|
||||||
|
{
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::RadioButton( ICON_FA_EYE_DROPPER " Sampling", &m_flameMode, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Separator();
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
|
||||||
|
Vector<FlameGraphItem> data;
|
||||||
|
|
||||||
|
for( auto& thread : m_worker.GetThreadData() ) BuildFlameGraph( m_worker, data, thread->timeline );
|
||||||
|
SortFlameGraph( data );
|
||||||
|
|
||||||
|
int64_t zsz = 0;
|
||||||
|
for( auto& v : data ) zsz += v.time;
|
||||||
|
|
||||||
|
ImGui::BeginChild( "##flameGraph" );
|
||||||
|
ImGui::EndChild();
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user