mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Wait stacks mode selection.
This commit is contained in:
parent
4f6e9bbb65
commit
5f9a0ab61f
@ -16379,6 +16379,23 @@ void View::DrawWaitStacks()
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 2, 2 ) );
|
||||
if( ImGui::RadioButton( ICON_FA_TABLE " List", m_waitStackMode == 0 ) ) m_waitStackMode = 0;
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
if( ImGui::RadioButton( ICON_FA_TREE " Bottom-up tree", m_waitStackMode == 1 ) ) m_waitStackMode = 1;
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
if( ImGui::RadioButton( ICON_FA_TREE " Top-down tree", m_waitStackMode == 2 ) ) m_waitStackMode = 2;
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
ImGui::SeparatorEx( ImGuiSeparatorFlags_Vertical );
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
TextFocused( "Total wait stacks:", RealToString( m_worker.GetContextSwitchSampleCount() ) );
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
@ -16387,7 +16404,11 @@ void View::DrawWaitStacks()
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
if( SmallCheckbox( "Limit range", &m_waitStackRange.active ) )
|
||||
ImGui::SeparatorEx( ImGuiSeparatorFlags_Vertical );
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
if( ImGui::Checkbox( "Limit range", &m_waitStackRange.active ) )
|
||||
{
|
||||
if( m_waitStackRange.active && m_waitStackRange.min == 0 && m_waitStackRange.max == 0 )
|
||||
{
|
||||
@ -16400,8 +16421,20 @@ void View::DrawWaitStacks()
|
||||
ImGui::SameLine();
|
||||
TextColoredUnformatted( 0xFF00FFFF, ICON_FA_EXCLAMATION_TRIANGLE );
|
||||
ImGui::SameLine();
|
||||
SmallToggleButton( ICON_FA_RULER " Limits", m_showRanges );
|
||||
ToggleButton( ICON_FA_RULER " Limits", m_showRanges );
|
||||
}
|
||||
if( m_waitStackMode != 0 )
|
||||
{
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
ImGui::SeparatorEx( ImGuiSeparatorFlags_Vertical );
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox( "Group by function name", m_waitStackMode == 1 ? &m_groupWaitStackBottomUp : &m_groupWaitStackTopDown );
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
bool threadsChanged = false;
|
||||
auto expand = ImGui::TreeNode( ICON_FA_RANDOM " Visible threads:" );
|
||||
@ -16466,6 +16499,10 @@ void View::DrawWaitStacks()
|
||||
ImGui::TextUnformatted( "No wait stacks to display." );
|
||||
}
|
||||
else
|
||||
{
|
||||
switch( m_waitStackMode )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
TextDisabledUnformatted( "Wait stack:" );
|
||||
ImGui::SameLine();
|
||||
@ -16503,6 +16540,22 @@ void View::DrawWaitStacks()
|
||||
TextDisabledUnformatted( buf );
|
||||
ImGui::Separator();
|
||||
DrawCallstackTable( data[m_waitStack]->first, false );
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
auto tree = GetCallstackFrameTreeBottomUp( stacks, m_groupCallstackTreeByNameBottomUp );
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
auto tree = GetCallstackFrameTreeTopDown( stacks, m_groupCallstackTreeByNameTopDown );
|
||||
break;
|
||||
}
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ImGui::End();
|
||||
|
@ -446,6 +446,9 @@ private:
|
||||
bool m_messageTimeRelativeToZone = true;
|
||||
uint64_t m_zoneInfoMemPool = 0;
|
||||
int m_waitStack = 0;
|
||||
int m_waitStackMode = 0;
|
||||
bool m_groupWaitStackBottomUp = true;
|
||||
bool m_groupWaitStackTopDown = true;
|
||||
|
||||
ShortcutAction m_shortcut = ShortcutAction::None;
|
||||
Namespace m_namespace = Namespace::Short;
|
||||
|
Loading…
Reference in New Issue
Block a user