mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Display number of threads each source location is present in.
This commit is contained in:
parent
8187519775
commit
56fa051bea
@ -558,7 +558,8 @@ void View::DrawStatistics()
|
||||
else
|
||||
{
|
||||
ImGui::BeginChild( "##statistics" );
|
||||
if( ImGui::BeginTable( "##statistics", 5, ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Sortable | ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY ) )
|
||||
if( ImGui::BeginTable( "##statistics", m_statMode == 0 ? 6 : 5,
|
||||
ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Sortable | ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY ) )
|
||||
{
|
||||
ImGui::TableSetupScrollFreeze( 0, 1 );
|
||||
ImGui::TableSetupColumn( "Name", ImGuiTableColumnFlags_NoHide );
|
||||
@ -566,6 +567,7 @@ void View::DrawStatistics()
|
||||
ImGui::TableSetupColumn( "Total time", ImGuiTableColumnFlags_DefaultSort | ImGuiTableColumnFlags_PreferSortDescending | ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize );
|
||||
ImGui::TableSetupColumn( "Counts", ImGuiTableColumnFlags_PreferSortDescending | ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize );
|
||||
ImGui::TableSetupColumn( "MTPC", ImGuiTableColumnFlags_PreferSortDescending | ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize );
|
||||
if( m_statMode == 0 ) ImGui::TableSetupColumn( "Threads", ImGuiTableColumnFlags_DefaultSort | ImGuiTableColumnFlags_PreferSortDescending | ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize );
|
||||
ImGui::TableHeadersRow();
|
||||
|
||||
const auto& sortspec = *ImGui::TableGetSortSpecs()->Specs;
|
||||
@ -611,6 +613,16 @@ void View::DrawStatistics()
|
||||
pdqsort_branchless( srcloc.begin(), srcloc.end(), []( const auto& lhs, const auto& rhs ) { return lhs.total / lhs.numZones > rhs.total / rhs.numZones; } );
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if( sortspec.SortDirection == ImGuiSortDirection_Ascending )
|
||||
{
|
||||
pdqsort_branchless( srcloc.begin(), srcloc.end(), []( const auto& lhs, const auto& rhs ) { return lhs.numThreads < rhs.numThreads; } );
|
||||
}
|
||||
else
|
||||
{
|
||||
pdqsort_branchless( srcloc.begin(), srcloc.end(), []( const auto& lhs, const auto& rhs ) { return lhs.numThreads > rhs.numThreads; } );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
@ -678,6 +690,11 @@ void View::DrawStatistics()
|
||||
ImGui::TextUnformatted( RealToString( v.numZones ) );
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextUnformatted( TimeToString( time / v.numZones ) );
|
||||
if( m_statMode == 0 )
|
||||
{
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextUnformatted( RealToString( v.numThreads ) );
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
ImGui::EndTable();
|
||||
|
Loading…
Reference in New Issue
Block a user