From 5cb283073e89c33c15cb9309c679709664e404dd Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 10 May 2026 00:15:18 +0200 Subject: [PATCH] Store kernel symbol end address, not size. The end address is now readily available in lower_bound search, instead of needing to be calculated constantly in the lambda. The size can be equivalently calculated from the end address, but this only happens once, after the symbol is found. --- public/client/TracyCallstack.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/client/TracyCallstack.cpp b/public/client/TracyCallstack.cpp index 742d29b6..e9f35490 100644 --- a/public/client/TracyCallstack.cpp +++ b/public/client/TracyCallstack.cpp @@ -1145,7 +1145,7 @@ static FastVector* s_di_known; struct KernelSymbol { uint64_t addr; - uint32_t size; + uint64_t endAddr; const char* name; const char* mod; }; @@ -1226,7 +1226,7 @@ static void InitKernelSymbols() auto sym = tmpSym.push_next(); sym->addr = addr; - sym->size = 0; + sym->endAddr = addr; sym->name = strname; sym->mod = strmod; } @@ -1237,7 +1237,7 @@ static void InitKernelSymbols() std::sort( tmpSym.begin(), tmpSym.end(), []( const KernelSymbol& lhs, const KernelSymbol& rhs ) { return lhs.addr < rhs.addr; } ); for( size_t i=0; iname ); cb_data[0].file = CopyStringFast( "" ); cb_data[0].line = 0; - cb_data[0].symLen = it->size; + cb_data[0].symLen = it->endAddr - it->addr; cb_data[0].symAddr = it->addr; return { cb_data, 1, it->mod ? it->mod : "" }; }