Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2019-08-14 23:10:54 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2019-08-14 23:10:54 +0300
commit690a6d12d750a02d486c0e5bdb7cbf1d118526cd (patch)
tree12b16230d19a513c098bfc6ce2461e00115b5091 /server/TracyView.cpp
parent7549c50babe29d5288e44292212b0834233a24de (diff)
Properly handle incomplete context switch data.
Diffstat (limited to 'server/TracyView.cpp')
-rw-r--r--server/TracyView.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/server/TracyView.cpp b/server/TracyView.cpp
index aacc2ff1..fdbef24f 100644
--- a/server/TracyView.cpp
+++ b/server/TracyView.cpp
@@ -4689,16 +4689,24 @@ void View::DrawZoneInfoWindow()
{
const auto end = m_worker.GetZoneEnd( ev );
auto eit = std::upper_bound( it, ctx->v.end(), end, [] ( const auto& l, const auto& r ) { return l < r.start; } );
+ bool incomplete = eit == ctx->v.end();
uint64_t cnt = std::distance( it, eit );
if( cnt == 1 )
{
- TextFocused( "Running state time:", TimeToString( ztime ) );
- ImGui::SameLine();
- TextDisabledUnformatted( "(100%)" );
- TextFocused( "Running state regions:", "1" );
+ if( !incomplete )
+ {
+ TextFocused( "Running state time:", TimeToString( ztime ) );
+ ImGui::SameLine();
+ TextDisabledUnformatted( "(100%)" );
+ TextFocused( "Running state regions:", "1" );
+ }
}
else
{
+ if( incomplete )
+ {
+ TextColoredUnformatted( ImVec4( 1, 0, 0, 1 ), "Incomplete context switch data!" );
+ }
auto bit = it;
int64_t running = it->end - ev.start;
++it;
@@ -11699,6 +11707,7 @@ bool View::GetZoneRunningTime( const ContextSwitch* ctx, const ZoneEvent& ev, in
if( it == ctx->v.end() ) return false;
const auto end = m_worker.GetZoneEnd( ev );
const auto eit = std::upper_bound( it, ctx->v.end(), end, [] ( const auto& l, const auto& r ) { return l < r.start; } );
+ if( eit == ctx->v.end() ) return false;
cnt = std::distance( it, eit );
if( cnt == 1 )
{