From 123de74fcacd780405689f4ca9a3a41d960fc2d3 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 18 Nov 2017 01:14:16 +0100 Subject: [PATCH] Thread thread zone count. --- server/TracyEvent.hpp | 1 + server/TracyView.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 5cf73dcd..0efe7632 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -128,6 +128,7 @@ struct MessageData struct ThreadData { uint64_t id; + uint64_t count; bool showFull; bool visible; Vector timeline; diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 5bfef50c..4a87ee1d 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -327,6 +327,7 @@ View::View( FileRead& f ) { auto td = m_slab.AllocInit(); f.Read( &td->id, sizeof( td->id ) ); + f.Read( &td->count, sizeof( td->count ) ); ReadTimeline( f, td->timeline ); uint64_t msz; f.Read( &msz, sizeof( msz ) ); @@ -1085,6 +1086,7 @@ ThreadData* View::NoticeThread( uint64_t thread ) m_threadMap.emplace( thread, (uint32_t)m_threads.size() ); auto td = m_slab.AllocInit(); td->id = thread; + td->count = 0; td->showFull = true; td->visible = true; m_threads.push_back( td ); @@ -1099,7 +1101,9 @@ ThreadData* View::NoticeThread( uint64_t thread ) void View::NewZone( ZoneEvent* zone, uint64_t thread ) { m_zonesCnt++; - Vector* timeline = &NoticeThread( thread )->timeline; + auto td = NoticeThread( thread ); + td->count++; + Vector* timeline = &td->timeline; InsertZone( zone, *timeline ); } @@ -3808,6 +3812,7 @@ void View::Write( FileWrite& f ) for( auto& thread : m_threads ) { f.Write( &thread->id, sizeof( thread->id ) ); + f.Write( &thread->count, sizeof( thread->count ) ); WriteTimeline( f, thread->timeline ); sz = thread->messages.size(); f.Write( &sz, sizeof( sz ) );