From 6c0c508280b8fcfe1f58ac3d266722947dee0f4c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 21 Mar 2020 15:23:51 +0100 Subject: [PATCH] Ignore kernel-only stacks. It is common to receive duplicate stack traces for the same timestamp (and thread), one containing proper user-space stack, and the second one containing only kernel frames. Discard the second one, as there's no documentation how this should be interpreted and the kernel stack is mostly useless. --- client/TracySysTrace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/TracySysTrace.cpp b/client/TracySysTrace.cpp index aa75a07d..72e098c4 100644 --- a/client/TracySysTrace.cpp +++ b/client/TracySysTrace.cpp @@ -141,7 +141,7 @@ void WINAPI EventRecordCallback( PEVENT_RECORD record ) if( hdr.EventDescriptor.Opcode == 32 ) { const auto sw = (const StackWalkEvent*)record->UserData; - if( sw->stackProcess == s_pid ) + if( sw->stackProcess == s_pid && ( sw->stack[0] & 0x8000000000000000 ) == 0 ) { const uint64_t sz = ( record->UserDataLength - 16 ) / 8; auto trace = (uint64_t*)tracy_malloc( ( 1 + sz ) * sizeof( uint64_t ) );