From b418c98e634f381611184c0678a010720f3293ca Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 7 Aug 2020 19:14:21 +0200 Subject: [PATCH] Add symbol samples accessor. --- server/TracyWorker.cpp | 8 ++++++++ server/TracyWorker.hpp | 1 + 2 files changed, 9 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index aed2b31c..6bda3d8b 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2057,6 +2057,14 @@ const CallstackFrameData* Worker::GetParentCallstackFrame( const CallstackFrameI return it->second; } } + +const Vector* Worker::GetSamplesForSymbol( uint64_t symAddr ) const +{ + assert( m_data.symbolSamplesReady ); + auto it = m_data.symbolSamples.find( symAddr ); + if( it == m_data.symbolSamples.end() ) return nullptr; + return &it->second; +} #endif const SymbolData* Worker::GetSymbolData( uint64_t sym ) const diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index d1fb0a04..fcdf0950 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -502,6 +502,7 @@ public: #ifndef TRACY_NO_STATISTICS const VarArray& GetParentCallstack( uint32_t idx ) const { return *m_data.parentCallstackPayload[idx]; } const CallstackFrameData* GetParentCallstackFrame( const CallstackFrameId& ptr ) const; + const Vector* GetSamplesForSymbol( uint64_t symAddr ) const; #endif const CrashEvent& GetCrashEvent() const { return m_data.crashEvent; }