From 145e3e213a2c6eb63ccb9ec60190a029e0026845 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 16 Jun 2022 13:39:07 +0200 Subject: [PATCH] Move ring identifier extraction out of loop. --- client/TracySysTrace.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/TracySysTrace.cpp b/client/TracySysTrace.cpp index d69579fd..88fa950b 100644 --- a/client/TracySysTrace.cpp +++ b/client/TracySysTrace.cpp @@ -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: