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

Zone text (custom string) transfer.

This commit is contained in:
Bartosz Taudul
2017-09-27 02:18:17 +02:00
parent 3c0ce01954
commit d1bbb731fc
9 changed files with 93 additions and 6 deletions
+14 -1
View File
@@ -103,6 +103,15 @@ void Profiler::ZoneEnd( uint64_t id, QueueZoneEnd&& data )
ZoneEndImpl( s_token, id, std::move( data ) );
}
void Profiler::ZoneText( uint64_t id, QueueZoneText&& data )
{
QueueItem item;
item.hdr.type = QueueType::ZoneText;
item.hdr.id = id;
item.zoneText = std::move( data );
s_queue.enqueue( s_token, std::move( item ) );
}
void Profiler::FrameMark()
{
QueueItem item;
@@ -199,7 +208,7 @@ bool Profiler::SendData( const char* data, size_t len )
bool Profiler::SendString( uint64_t str, const char* ptr, QueueType type )
{
assert( type == QueueType::StringData || type == QueueType::ThreadName );
assert( type == QueueType::StringData || type == QueueType::ThreadName || type == QueueType::CustomStringData );
QueueHeader hdr;
hdr.type = type;
@@ -261,6 +270,10 @@ bool Profiler::HandleServerQuery()
SendString( ptr, GetThreadName( ptr ), QueueType::ThreadName );
}
break;
case ServerQueryCustomString:
SendString( ptr, (const char*)ptr, QueueType::CustomStringData );
delete[] (const char*)ptr;
break;
case ServerQuerySourceLocation:
SendSourceLocation( ptr );
break;