Move ring identifier extraction out of loop.

This commit is contained in:
Bartosz Taudul 2022-06-16 13:39:07 +02:00
parent 49844872e6
commit 145e3e213a
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -1148,6 +1148,9 @@ void SysTraceWorker( void* ptr )
assert( head > tail );
hadData = true;
const auto id = ring.GetId();
assert( id != EventContextSwitch );
const auto end = head - tail;
uint64_t pos = 0;
while( pos < end )
@ -1157,8 +1160,6 @@ void SysTraceWorker( void* ptr )
if( hdr.type == PERF_RECORD_SAMPLE )
{
auto offset = pos + sizeof( perf_event_header );
const auto id = ring.GetId();
assert( id != EventContextSwitch );
if( id == EventCallstack )
{
// Layout: