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 18:03:33 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2019-08-14 18:03:33 +0300
commit72918cda19275e5fad1c3c22b6dc85f38088d80c (patch)
tree44b8ae69f5717bae17c0d49beb3dd1ded6d81fb0 /server/TracyView.cpp
parentca9078845cb8f0577fdfd88fb1b482f9e7afe13d (diff)
Include recorded context switches in thread lifetime.
Diffstat (limited to 'server/TracyView.cpp')
-rw-r--r--server/TracyView.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/server/TracyView.cpp b/server/TracyView.cpp
index 98854203..245d90c1 100644
--- a/server/TracyView.cpp
+++ b/server/TracyView.cpp
@@ -2061,13 +2061,21 @@ void View::DrawZones()
#endif
}
+ const auto ctx = m_worker.GetContextSwitchData( v->id );
+
ImGui::Separator();
int64_t first = std::numeric_limits<int64_t>::max();
int64_t last = -1;
+ if( ctx && !ctx->v.empty() )
+ {
+ const auto& back = ctx->v.back();
+ first = ctx->v.begin()->start;
+ last = back.end >= 0 ? back.end : back.start;
+ }
if( !v->timeline.empty() )
{
- first = v->timeline.front()->start;
- last = m_worker.GetZoneEnd( *v->timeline.back() );
+ first = std::min( first, v->timeline.front()->start );
+ last = std::max( last, m_worker.GetZoneEnd( *v->timeline.back() ) );
}
if( !v->messages.empty() )
{
@@ -2093,14 +2101,14 @@ void View::DrawZones()
if( last >= 0 )
{
- const auto activity = last - first;
+ const auto lifetime = last - first;
const auto traceLen = m_worker.GetLastTime() - m_worker.GetTimeBegin();
TextFocused( "Appeared at", TimeToString( first - m_worker.GetTimeBegin() ) );
TextFocused( "Last event at", TimeToString( last - m_worker.GetTimeBegin() ) );
- TextFocused( "Activity time:", TimeToString( activity ) );
+ TextFocused( "Lifetime:", TimeToString( lifetime ) );
ImGui::SameLine();
- ImGui::TextDisabled( "(%.2f%%)", activity / double( traceLen ) * 100 );
+ ImGui::TextDisabled( "(%.2f%%)", lifetime / double( traceLen ) * 100 );
}
ImGui::Separator();