From e8fb2abb2af2edbd5520230f67da2c2122be73eb Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 25 Nov 2021 22:27:35 +0100 Subject: [PATCH] Dispatch kernel code retrieval. --- client/TracyProfiler.cpp | 27 ++++++++++++++++++++------- client/TracyProfiler.hpp | 1 + 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 1a457eb8..54407ebd 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -3100,6 +3100,12 @@ void Profiler::QueueExternalName( uint64_t ptr ) #endif } +void Profiler::QueueKernelCode( uint64_t symbol, uint32_t size ) +{ + assert( symbol >> 63 != 0 ); + AckServerQuery(); +} + #ifdef TRACY_HAS_CALLSTACK void Profiler::HandleSymbolQueueItem( const SymbolQueueItem& si ) { @@ -3660,16 +3666,23 @@ void Profiler::HandleParameter( uint64_t payload ) void Profiler::HandleSymbolCodeQuery( uint64_t symbol, uint32_t size ) { -#ifdef __ANDROID__ - // On Android it's common for code to be in mappings that are only executable - // but not readable. - if( !EnsureReadable( symbol ) ) + if( symbol >> 63 != 0 ) { - AckServerQuery(); - return; + QueueKernelCode( symbol, size ); } + else + { +#ifdef __ANDROID__ + // On Android it's common for code to be in mappings that are only executable + // but not readable. + if( !EnsureReadable( symbol ) ) + { + AckServerQuery(); + return; + } #endif - SendLongString( symbol, (const char*)symbol, size, QueueType::SymbolCode ); + SendLongString( symbol, (const char*)symbol, size, QueueType::SymbolCode ); + } } void Profiler::HandleSourceCodeQuery() diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index 7c2c8170..6f378d25 100644 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -753,6 +753,7 @@ private: void QueueSymbolQuery( uint64_t symbol ); void QueueCodeLocation( uint64_t ptr ); void QueueExternalName( uint64_t ptr ); + void QueueKernelCode( uint64_t symbol, uint32_t size ); bool HandleServerQuery(); void HandleDisconnect();