1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Don't sort flame graph by default.

This commit is contained in:
Bartosz Taudul 2024-09-20 01:29:47 +02:00
parent 0b5b674e1f
commit fc303d9594
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 9 additions and 1 deletions

View File

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

View File

@ -291,6 +291,12 @@ void View::DrawFlameGraph()
ImGui::RadioButton( ICON_FA_EYE_DROPPER " Sampling", &m_flameMode, 1 );
}
ImGui::SameLine();
ImGui::SeparatorEx( ImGuiSeparatorFlags_Vertical );
ImGui::SameLine();
ImGui::Checkbox( ICON_FA_ARROW_UP_WIDE_SHORT " Sort by time", &m_flameSort );
auto expand = ImGui::TreeNode( ICON_FA_SHUFFLE " Visible threads:" );
ImGui::SameLine();
size_t visibleThreads = 0;
@ -364,7 +370,8 @@ void View::DrawFlameGraph()
if( FlameGraphThread( thread->id ) ) BuildFlameGraph( m_worker, data, thread->samples );
}
}
SortFlameGraph( data );
if( m_flameSort ) SortFlameGraph( data );
int64_t zsz = 0;
for( auto& v : data ) zsz += v.time;