Add child samples data structure.

This commit is contained in:
Bartosz Taudul 2021-04-09 20:26:21 +02:00
parent fa8c99fd74
commit 4dc6222ba1
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 10 additions and 0 deletions

View File

@ -2196,6 +2196,14 @@ const Vector<SampleDataRange>* Worker::GetSamplesForSymbol( uint64_t symAddr ) c
if( it == m_data.symbolSamples.end() ) return nullptr;
return &it->second;
}
const Vector<Int48>* Worker::GetChildSamples( uint64_t addr ) const
{
assert( m_data.symbolSamplesReady );
auto it = m_data.childSamples.find( addr );
if( it == m_data.childSamples.end() ) return nullptr;
return &it->second;
}
#endif
const SymbolData* Worker::GetSymbolData( uint64_t sym ) const

View File

@ -294,6 +294,7 @@ private:
unordered_flat_map<uint64_t, unordered_flat_map<CallstackFrameId, uint32_t, CallstackFrameIdHash, CallstackFrameIdCompare>> instructionPointersMap;
unordered_flat_map<uint64_t, Vector<SampleDataRange>> symbolSamples;
unordered_flat_map<CallstackFrameId, Vector<SampleDataRange>, CallstackFrameIdHash, CallstackFrameIdCompare> pendingSymbolSamples;
unordered_flat_map<uint64_t, Vector<Int48>> childSamples;
bool newFramesWereReceived = false;
bool callstackSamplesReady = false;
bool ghostZonesReady = false;
@ -497,6 +498,7 @@ public:
const VarArray<CallstackFrameId>& GetParentCallstack( uint32_t idx ) const { return *m_data.parentCallstackPayload[idx]; }
const CallstackFrameData* GetParentCallstackFrame( const CallstackFrameId& ptr ) const;
const Vector<SampleDataRange>* GetSamplesForSymbol( uint64_t symAddr ) const;
const Vector<Int48>* GetChildSamples( uint64_t addr ) const;
#endif
const CrashEvent& GetCrashEvent() const { return m_data.crashEvent; }