From c5dbd749e7b299313168d4823192ac207d4c8ff9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 20 Feb 2020 02:09:09 +0100 Subject: [PATCH] Combine ContextSwitchCpu writes. --- server/TracyEvent.hpp | 2 ++ server/TracyWorker.cpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 446d8786..e64f58ce 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -403,6 +403,8 @@ struct ContextSwitchCpu tracy_force_inline uint16_t Thread() const { return uint16_t( _start_thread ); } tracy_force_inline void SetThread( uint16_t thread ) { memcpy( &_start_thread, &thread, 2 ); } + tracy_force_inline void SetStartThread( int64_t start, uint16_t thread ) { assert( start < (int64_t)( 1ull << 47 ) ); _start_thread = ( uint64_t( start ) << 16 ) | thread; } + uint64_t _start_thread; Int48 _end; }; diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 1026c6aa..868386c7 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -1543,10 +1543,9 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks ) uint16_t thread; f.Read3( deltaStart, deltaEnd, thread ); refTime += deltaStart; - ptr->SetStart( refTime ); + ptr->SetStartThread( refTime, thread ); refTime += deltaEnd; ptr->SetEnd( refTime ); - ptr->SetThread( thread ); ptr++; } cnt += sz;