1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Store zone source location.

This commit is contained in:
Bartosz Taudul
2017-09-21 21:57:40 +02:00
parent 7446e27e60
commit 5065743bf0
4 changed files with 58 additions and 0 deletions
+17
View File
@@ -209,10 +209,27 @@ void View::ProcessZoneBegin( uint64_t id, const QueueZoneBegin& ev )
{
auto it = m_pendingEndZone.find( id );
auto zone = m_slab.Alloc<Event>();
CheckString( ev.filename );
CheckString( ev.function );
zone->start = ev.time;
SourceLocation srcloc { ev.filename, ev.function, ev.line };
auto lit = m_locationRef.find( srcloc );
std::unique_lock<std::mutex> lock( m_lock );
if( lit == m_locationRef.end() )
{
const auto ref = uint32_t( m_srcFile.size() );
zone->srcloc = ref;
m_locationRef.emplace( srcloc, ref );
m_srcFile.push_back( srcloc );
}
else
{
zone->srcloc = lit->second;
}
if( it == m_pendingEndZone.end() )
{
zone->end = -1;