diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 99b52867..b2b9e675 100755 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -17,6 +17,8 @@ struct Event int64_t start; int64_t end; uint64_t srcloc; + int8_t cpu_start; + int8_t cpu_end; TextData* text; Event* parent; diff --git a/server/TracyView.cpp b/server/TracyView.cpp index e0aff3c8..35e3c423 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -372,6 +372,7 @@ void View::ProcessZoneBegin( uint64_t id, const QueueZoneBegin& ev ) zone->start = ev.time * m_timerMul; zone->srcloc = ev.srcloc; + zone->cpu_start = ev.cpu; zone->text = nullptr; std::unique_lock lock( m_lock ); @@ -386,6 +387,7 @@ void View::ProcessZoneBegin( uint64_t id, const QueueZoneBegin& ev ) else { zone->end = it->second.time * m_timerMul; + zone->cpu_end = it->second.cpu; assert( zone->start <= zone->end ); NewZone( zone, ev.thread ); lock.unlock(); @@ -406,6 +408,7 @@ void View::ProcessZoneEnd( uint64_t id, const QueueZoneEnd& ev ) std::unique_lock lock( m_lock ); assert( zone->end == -1 ); zone->end = ev.time * m_timerMul; + zone->cpu_end = ev.cpu; assert( zone->end >= zone->start ); UpdateZone( zone ); lock.unlock(); @@ -1639,6 +1642,9 @@ void View::WriteTimeline( FileWrite& f, const Vector& vec ) f.Write( &v->start, sizeof( v->start ) ); f.Write( &v->end, sizeof( v->end ) ); f.Write( &v->srcloc, sizeof( v->srcloc ) ); + f.Write( &v->cpu_start, sizeof( v->cpu_start ) ); + f.Write( &v->cpu_end, sizeof( v->cpu_end ) ); + if( v->text ) { uint8_t flag = 1; @@ -1671,6 +1677,8 @@ void View::ReadTimeline( FileRead& f, Vector& vec, Event* parent, const f.Read( &zone->start, sizeof( zone->start ) ); f.Read( &zone->end, sizeof( zone->end ) ); f.Read( &zone->srcloc, sizeof( zone->srcloc ) ); + f.Read( &zone->cpu_start, sizeof( zone->cpu_start ) ); + f.Read( &zone->cpu_end, sizeof( zone->cpu_end ) ); uint8_t flag; f.Read( &flag, sizeof( flag ) );