Combine ContextSwitchData writes.

This commit is contained in:
Bartosz Taudul 2020-02-20 02:05:23 +01:00
parent d96fcc95c2
commit 54573fb970
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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;