diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index d46aca3f..446d8786 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -382,6 +382,9 @@ struct ContextSwitchData tracy_force_inline int64_t WakeupVal() const { return _wakeup.Val(); } tracy_force_inline void SetWakeup( int64_t wakeup ) { assert( wakeup < (int64_t)( 1ull << 47 ) ); _wakeup.SetVal( wakeup ); } + tracy_force_inline void SetStartCpu( int64_t start, uint8_t cpu ) { assert( start < (int64_t)( 1ull << 47 ) ); _start_cpu = ( uint64_t( start ) << 16 ) | cpu; } + tracy_force_inline void SetEndReasonState( int64_t end, int8_t reason, int8_t state ) { assert( end < (int64_t)( 1ull << 47 ) ); _end_reason_state = ( uint64_t( end ) << 16 ) | ( uint64_t( reason ) << 8 ) | uint8_t( state ); } + uint64_t _start_cpu; uint64_t _end_reason_state; Int48 _wakeup; diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 542fc2d2..1026c6aa 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -1497,13 +1497,10 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks ) refTime += deltaWakeup; ptr->SetWakeup( refTime ); refTime += deltaStart; - ptr->SetStart( refTime ); + ptr->SetStartCpu( refTime, cpu ); if( diff > 0 ) runningTime += diff; refTime += diff; - ptr->SetEnd( refTime ); - ptr->SetCpu( cpu ); - ptr->SetReason( reason ); - ptr->SetState( state ); + ptr->SetEndReasonState( refTime, reason, state ); ptr++; } data->runningTime = runningTime;