mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Add flame graph window.
This commit is contained in:
parent
11777e8136
commit
692fcc225f
@ -55,6 +55,7 @@ set(SERVER_FILES
|
|||||||
TracyView_ContextSwitch.cpp
|
TracyView_ContextSwitch.cpp
|
||||||
TracyView_CpuData.cpp
|
TracyView_CpuData.cpp
|
||||||
TracyView_FindZone.cpp
|
TracyView_FindZone.cpp
|
||||||
|
TracyView_FlameGraph.cpp
|
||||||
TracyView_FrameOverview.cpp
|
TracyView_FrameOverview.cpp
|
||||||
TracyView_FrameTimeline.cpp
|
TracyView_FrameTimeline.cpp
|
||||||
TracyView_FrameTree.cpp
|
TracyView_FrameTree.cpp
|
||||||
|
|||||||
@ -880,6 +880,8 @@ bool View::DrawImpl()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ToggleButton( ICON_FA_ARROW_UP_WIDE_SHORT " Statistics", m_showStatistics );
|
ToggleButton( ICON_FA_ARROW_UP_WIDE_SHORT " Statistics", m_showStatistics );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
ToggleButton( ICON_FA_FIRE_FLAME_CURVED " Flame", m_showFlameGraph );
|
||||||
|
ImGui::SameLine();
|
||||||
ToggleButton( ICON_FA_MEMORY " Memory", m_memInfo.show );
|
ToggleButton( ICON_FA_MEMORY " Memory", m_memInfo.show );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ToggleButton( ICON_FA_SCALE_BALANCED " Compare", m_compare.show );
|
ToggleButton( ICON_FA_SCALE_BALANCED " Compare", m_compare.show );
|
||||||
@ -1123,6 +1125,7 @@ bool View::DrawImpl()
|
|||||||
if( m_sampleParents.symAddr != 0 ) DrawSampleParents();
|
if( m_sampleParents.symAddr != 0 ) DrawSampleParents();
|
||||||
if( m_showRanges ) DrawRanges();
|
if( m_showRanges ) DrawRanges();
|
||||||
if( m_showWaitStacks ) DrawWaitStacks();
|
if( m_showWaitStacks ) DrawWaitStacks();
|
||||||
|
if( m_showFlameGraph ) DrawFlameGraph();
|
||||||
|
|
||||||
if( m_setRangePopup.active )
|
if( m_setRangePopup.active )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -271,6 +271,7 @@ private:
|
|||||||
void DrawRangeEntry( Range& range, const char* label, uint32_t color, const char* popupLabel, int id );
|
void DrawRangeEntry( Range& range, const char* label, uint32_t color, const char* popupLabel, int id );
|
||||||
void DrawSourceTooltip( const char* filename, uint32_t line, int before = 3, int after = 3, bool separateTooltip = true );
|
void DrawSourceTooltip( const char* filename, uint32_t line, int before = 3, int after = 3, bool separateTooltip = true );
|
||||||
void DrawWaitStacks();
|
void DrawWaitStacks();
|
||||||
|
void DrawFlameGraph();
|
||||||
|
|
||||||
void ListMemData( std::vector<const MemEvent*>& vec, const std::function<void(const MemEvent*)>& DrawAddress, int64_t startTime = -1, uint64_t pool = 0 );
|
void ListMemData( std::vector<const MemEvent*>& vec, const std::function<void(const MemEvent*)>& DrawAddress, int64_t startTime = -1, uint64_t pool = 0 );
|
||||||
|
|
||||||
@ -488,6 +489,7 @@ private:
|
|||||||
bool m_showCpuDataWindow = false;
|
bool m_showCpuDataWindow = false;
|
||||||
bool m_showAnnotationList = false;
|
bool m_showAnnotationList = false;
|
||||||
bool m_showWaitStacks = false;
|
bool m_showWaitStacks = false;
|
||||||
|
bool m_showFlameGraph = false;
|
||||||
|
|
||||||
AccumulationMode m_statAccumulationMode = AccumulationMode::SelfOnly;
|
AccumulationMode m_statAccumulationMode = AccumulationMode::SelfOnly;
|
||||||
bool m_statSampleTime = true;
|
bool m_statSampleTime = true;
|
||||||
|
|||||||
14
profiler/src/profiler/TracyView_FlameGraph.cpp
Normal file
14
profiler/src/profiler/TracyView_FlameGraph.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "TracyView.hpp"
|
||||||
|
|
||||||
|
namespace tracy
|
||||||
|
{
|
||||||
|
|
||||||
|
void View::DrawFlameGraph()
|
||||||
|
{
|
||||||
|
const auto scale = GetScale();
|
||||||
|
ImGui::SetNextWindowSize( ImVec2( 1400 * scale, 800 * scale ), ImGuiCond_FirstUseEver );
|
||||||
|
ImGui::Begin( "Flame graph", &m_showFlameGraph, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse );
|
||||||
|
ImGui::End();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user