diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2019-08-15 20:01:13 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2019-08-15 21:17:36 +0300 |
commit | f5775a2d6e62170f4e9c71af17db0bbb1b099aa4 (patch) | |
tree | aa308d6da4aefe9ce893aa54a814e90cb02337b8 /server/TracyView.cpp | |
parent | 042e6c9e111199f87b2cc071d800029dbc0c17e8 (diff) |
Display list of CPUs on which zone was running.
Diffstat (limited to 'server/TracyView.cpp')
-rw-r--r-- | server/TracyView.cpp | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 62ed4b7c..05b7a569 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4701,32 +4701,67 @@ void View::DrawZoneInfoWindow() TextFocused( "Running state time:", TimeToString( ztime ) ); ImGui::SameLine(); TextDisabledUnformatted( "(100%)" ); + ImGui::Separator(); TextFocused( "Running state regions:", "1" ); + TextFocused( "CPU:", RealToString( it->cpu, true ) ); } } else if( cnt > 1 ) { - if( incomplete ) - { - TextColoredUnformatted( ImVec4( 1, 0, 0, 1 ), "Incomplete context switch data!" ); - } + uint8_t cpus[256] = {}; auto bit = it; int64_t running = it->end - ev.start; + cpus[it->cpu] = 1; ++it; for( int64_t i=0; i<cnt-2; i++ ) { running += it->end - it->start; + cpus[it->cpu] = 1; ++it; } running += end - it->start; + cpus[it->cpu] = 1; TextFocused( "Running state time:", TimeToString( running ) ); if( ztime != 0 ) { ImGui::SameLine(); ImGui::TextDisabled( "(%.2f%%)", 100.f * running / ztime ); } + ImGui::Separator(); + if( incomplete ) + { + TextColoredUnformatted( ImVec4( 1, 0, 0, 1 ), "Incomplete context switch data!" ); + } TextFocused( "Running state regions:", RealToString( cnt, true ) ); + int numCpus = 0; + for( int i=0; i<256; i++ ) numCpus += cpus[i]; + if( numCpus == 1 ) + { + TextFocused( "CPU:", RealToString( it->cpu, true ) ); + } + else + { + ImGui::TextDisabled( "CPUs (%i):", numCpus ); + for( int i=0;; i++ ) + { + if( cpus[i] != 0 ) + { + ImGui::SameLine(); + numCpus--; + if( numCpus == 0 ) + { + ImGui::Text( "%i", i ); + break; + } + else + { + ImGui::Text( "%i,", i ); + } + } + } + } + --eit; if( ImGui::TreeNode( "Wait regions" ) ) { |