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

Store on-demand frame offset.

This commit is contained in:
Bartosz Taudul 2018-07-10 22:39:41 +02:00
parent 6a9caabc63
commit a78981e040
2 changed files with 4 additions and 1 deletions

View File

@ -995,6 +995,7 @@ void Worker::Exec()
{ {
OnDemandPayloadMessage onDemand; OnDemandPayloadMessage onDemand;
if( !m_sock.Read( &onDemand, sizeof( onDemand ), &tv, ShouldExit ) ) goto close; if( !m_sock.Read( &onDemand, sizeof( onDemand ), &tv, ShouldExit ) ) goto close;
m_data.frameOffset = onDemand.frames;
} }
} }

View File

@ -73,7 +73,7 @@ class Worker
struct DataBlock struct DataBlock
{ {
DataBlock() : zonesCnt( 0 ), lastTime( 0 ), threadLast( std::numeric_limits<uint64_t>::max(), 0 ) {} DataBlock() : zonesCnt( 0 ), lastTime( 0 ), frameOffset( 0 ), threadLast( std::numeric_limits<uint64_t>::max(), 0 ) {}
NonRecursiveBenaphore lock; NonRecursiveBenaphore lock;
Vector<int64_t> frames; Vector<int64_t> frames;
@ -84,6 +84,7 @@ class Worker
MemData memory; MemData memory;
uint64_t zonesCnt; uint64_t zonesCnt;
int64_t lastTime; int64_t lastTime;
uint64_t frameOffset;
flat_hash_map<uint64_t, const char*, nohash<uint64_t>> strings; flat_hash_map<uint64_t, const char*, nohash<uint64_t>> strings;
Vector<const char*> stringData; Vector<const char*> stringData;
@ -149,6 +150,7 @@ public:
size_t GetFrameCount() const { return m_data.frames.size(); } size_t GetFrameCount() const { return m_data.frames.size(); }
int64_t GetLastTime() const { return m_data.lastTime; } int64_t GetLastTime() const { return m_data.lastTime; }
uint64_t GetZoneCount() const { return m_data.zonesCnt; } uint64_t GetZoneCount() const { return m_data.zonesCnt; }
uint64_t GetFrameOffset() const { return m_data.frameOffset; }
int64_t GetFrameTime( size_t idx ) const; int64_t GetFrameTime( size_t idx ) const;
int64_t GetFrameBegin( size_t idx ) const; int64_t GetFrameBegin( size_t idx ) const;