Add symbol samples accessor.

This commit is contained in:
Bartosz Taudul 2020-08-07 19:14:21 +02:00
parent aa8b60a824
commit b418c98e63
2 changed files with 9 additions and 0 deletions

View File

@ -2057,6 +2057,14 @@ const CallstackFrameData* Worker::GetParentCallstackFrame( const CallstackFrameI
return it->second; return it->second;
} }
} }
const Vector<Int48>* 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 #endif
const SymbolData* Worker::GetSymbolData( uint64_t sym ) const const SymbolData* Worker::GetSymbolData( uint64_t sym ) const

View File

@ -502,6 +502,7 @@ public:
#ifndef TRACY_NO_STATISTICS #ifndef TRACY_NO_STATISTICS
const VarArray<CallstackFrameId>& GetParentCallstack( uint32_t idx ) const { return *m_data.parentCallstackPayload[idx]; } const VarArray<CallstackFrameId>& GetParentCallstack( uint32_t idx ) const { return *m_data.parentCallstackPayload[idx]; }
const CallstackFrameData* GetParentCallstackFrame( const CallstackFrameId& ptr ) const; const CallstackFrameData* GetParentCallstackFrame( const CallstackFrameId& ptr ) const;
const Vector<Int48>* GetSamplesForSymbol( uint64_t symAddr ) const;
#endif #endif
const CrashEvent& GetCrashEvent() const { return m_data.crashEvent; } const CrashEvent& GetCrashEvent() const { return m_data.crashEvent; }