Stack frame accessor.

This commit is contained in:
Bartosz Taudul 2018-06-20 01:18:59 +02:00
parent 0c0afa5ac7
commit 4000f27e15
2 changed files with 15 additions and 0 deletions

View File

@ -721,6 +721,19 @@ std::pair <int, int> Worker::GetFrameRange( int64_t from, int64_t to )
return std::make_pair( zbegin, zend ); 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 ) int64_t Worker::GetZoneEnd( const ZoneEvent& ev )
{ {
auto ptr = &ev; auto ptr = &ev;

View File

@ -145,7 +145,9 @@ public:
const Vector<PlotData*>& GetPlots() const { return m_data.plots; } const Vector<PlotData*>& GetPlots() const { return m_data.plots; }
const Vector<ThreadData*>& GetThreadData() const { return m_data.threads; } const Vector<ThreadData*>& GetThreadData() const { return m_data.threads; }
const MemData& GetMemData() const { return m_data.memory; } const MemData& GetMemData() const { return m_data.memory; }
const VarArray<uint64_t>& GetCallstack( uint32_t idx ) { return *m_data.callstackPayload[idx]; } const VarArray<uint64_t>& 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). // 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 // GetZoneEnd() will try to infer the end time by looking at child zones (parent zone can't end