From 2589b45af03e34a4637f46ac7a21bf7577899890 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 29 Feb 2020 17:58:41 +0100 Subject: [PATCH] Add accessors for new data. --- server/TracyWorker.cpp | 8 ++++++++ server/TracyWorker.hpp | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 3947fad5..4d862ea1 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -2348,6 +2348,14 @@ const Worker::SourceLocationZones& Worker::GetZonesForSourceLocation( int16_t sr auto it = m_data.sourceLocationZones.find( srcloc ); return it != m_data.sourceLocationZones.end() ? it->second : empty; } + +const SymbolStats& Worker::GetSymbolStats( uint64_t symAddr ) const +{ + assert( AreCallstackSamplesReady() ); + auto it = m_data.symbolStats.find( symAddr ); + assert( it != m_data.symbolStats.end() ); + return it->second; +} #endif void Worker::Network() diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index d6abfaf5..97ac7ca6 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -403,6 +403,10 @@ public: uint64_t GetCanonicalPointer( const CallstackFrameId& id ) const; const SymbolData* GetSymbolData( uint64_t sym ) const; +#ifndef TRACY_NO_STATISTICS + const VarArray& GetParentCallstack( uint32_t idx ) const { return *m_data.parentCallstackPayload[idx]; } +#endif + const CrashEvent& GetCrashEvent() const { return m_data.crashEvent; } // Some zones may have incomplete timing data (only start time is available, end hasn't arrived yet). @@ -444,6 +448,7 @@ public: const unordered_flat_map& GetSymbolMap() const { return m_data.symbolMap; } const unordered_flat_map& GetSymbolStats() const { return m_data.symbolStats; } + const SymbolStats& GetSymbolStats( uint64_t symAddr ) const; bool AreCallstackSamplesReady() const { return m_data.callstackSamplesReady; } #endif