1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-30 04:43:53 +00:00

Send source location answer in stream, not as separate packet.

This commit is contained in:
Bartosz Taudul 2017-09-26 19:00:25 +02:00
parent e90a86e06e
commit e076d1d475
2 changed files with 3 additions and 12 deletions

View File

@ -216,7 +216,7 @@ bool Profiler::SendString( uint64_t str, const char* ptr, QueueType type )
return SendData( buf, sizeof( hdr ) + sizeof( l16 ) + l16 ); return SendData( buf, sizeof( hdr ) + sizeof( l16 ) + l16 );
} }
bool Profiler::SendSourceLocation( uint64_t ptr ) void Profiler::SendSourceLocation( uint64_t ptr )
{ {
auto srcloc = (const SourceLocation*)ptr; auto srcloc = (const SourceLocation*)ptr;
QueueItem item; QueueItem item;
@ -226,16 +226,7 @@ bool Profiler::SendSourceLocation( uint64_t ptr )
item.srcloc.function = (uint64_t)srcloc->function; item.srcloc.function = (uint64_t)srcloc->function;
item.srcloc.line = srcloc->line; item.srcloc.line = srcloc->line;
item.srcloc.color = srcloc->color; item.srcloc.color = srcloc->color;
s_queue.enqueue( GetToken(), std::move( item ) );
const auto sz = QueueDataSize[item.hdr.idx];
auto buf = m_buffer + m_bufferOffset;
memcpy( buf, &item, sz );
m_bufferOffset += sz;
if( m_bufferOffset > TargetFrameSize * 2 ) m_bufferOffset = 0;
return SendData( buf, sz );
} }
bool Profiler::HandleServerQuery() bool Profiler::HandleServerQuery()

View File

@ -54,7 +54,7 @@ private:
bool SendData( const char* data, size_t len ); bool SendData( const char* data, size_t len );
bool SendString( uint64_t ptr, const char* str, QueueType type ); bool SendString( uint64_t ptr, const char* str, QueueType type );
bool SendSourceLocation( uint64_t ptr ); void SendSourceLocation( uint64_t ptr );
bool HandleServerQuery(); bool HandleServerQuery();