diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index eba67b79..d37b3769 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -721,6 +721,19 @@ std::pair Worker::GetFrameRange( int64_t from, int64_t to ) return std::make_pair( zbegin, zend ); } +const CallstackFrame* Worker::GetCallstackFrame( uint64_t ptr ) +{ + auto it = m_data.callstackFrameMap.find( ptr ); + if( it == m_data.callstackFrameMap.end() ) + { + return nullptr; + } + else + { + return it->second; + } +} + int64_t Worker::GetZoneEnd( const ZoneEvent& ev ) { auto ptr = &ev; diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index aef69417..d3e46dc6 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -145,7 +145,9 @@ public: const Vector& GetPlots() const { return m_data.plots; } const Vector& GetThreadData() const { return m_data.threads; } const MemData& GetMemData() const { return m_data.memory; } + const VarArray& GetCallstack( uint32_t idx ) { return *m_data.callstackPayload[idx]; } + const CallstackFrame* GetCallstackFrame( uint64_t ptr ); // Some zones may have incomplete timing data (only start time is available, end hasn't arrived yet). // GetZoneEnd() will try to infer the end time by looking at child zones (parent zone can't end