mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Callstack frame map must not be touched by statistics.
This commit is contained in:
+18
-1
@@ -2041,6 +2041,7 @@ std::pair<int, int> Worker::GetFrameRange( const FrameData& fd, int64_t from, in
|
||||
|
||||
const CallstackFrameData* Worker::GetCallstackFrame( const CallstackFrameId& ptr ) const
|
||||
{
|
||||
assert( ptr.custom == 0 );
|
||||
auto it = m_data.callstackFrameMap.find( ptr );
|
||||
if( it == m_data.callstackFrameMap.end() )
|
||||
{
|
||||
@@ -2052,6 +2053,22 @@ const CallstackFrameData* Worker::GetCallstackFrame( const CallstackFrameId& ptr
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef TRACY_NO_STATISTICS
|
||||
const CallstackFrameData* Worker::GetParentCallstackFrame( const CallstackFrameId& ptr ) const
|
||||
{
|
||||
assert( ptr.custom == 1 );
|
||||
auto it = m_data.parentCallstackFrameMap.find( ptr );
|
||||
if( it == m_data.parentCallstackFrameMap.end() )
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
const SymbolData* Worker::GetSymbolData( uint64_t sym ) const
|
||||
{
|
||||
auto it = m_data.symbolMap.find( sym );
|
||||
@@ -5402,7 +5419,7 @@ void Worker::UpdateSampleStatisticsImpl( const CallstackFrameData** frames, uint
|
||||
parentFrameId.idx = m_callstackParentNextIdx++;
|
||||
parentFrameId.sel = 0;
|
||||
parentFrameId.custom = 1;
|
||||
m_data.callstackFrameMap.emplace( parentFrameId, frameData );
|
||||
m_data.parentCallstackFrameMap.emplace( parentFrameId, frameData );
|
||||
m_data.revParentFrameMap.emplace( frameData, parentFrameId );
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user