diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-06-16 14:39:07 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-06-16 14:39:07 +0300 |
commit | 145e3e213a2c6eb63ccb9ec60190a029e0026845 (patch) | |
tree | 142677b91f86a880e9197769c13aa603c378a7f9 | |
parent | 49844872e6b1bc1f22d0133328b4d8cf9a668d72 (diff) |
Move ring identifier extraction out of loop.
-rw-r--r-- | client/TracySysTrace.cpp | 5 |
1 files 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: |