Combine ContextSwitchCpu writes.

This commit is contained in:
Bartosz Taudul 2020-02-20 02:09:09 +01:00
parent 54573fb970
commit c5dbd749e7
2 changed files with 3 additions and 2 deletions

View File

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

View File

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