mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Send thread group hint message.
This commit is contained in:
parent
beb42a3d29
commit
8cea63cbca
@ -3474,7 +3474,22 @@ bool Profiler::HandleServerQuery()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SendString( ptr, GetThreadName( (uint32_t)ptr ), QueueType::ThreadName );
|
auto t = GetThreadNameData( (uint32_t)ptr );
|
||||||
|
if( t )
|
||||||
|
{
|
||||||
|
SendString( ptr, t->name, QueueType::ThreadName );
|
||||||
|
if( t->groupHint != 0 )
|
||||||
|
{
|
||||||
|
TracyLfqPrepare( QueueType::ThreadGroupHint );
|
||||||
|
MemWrite( &item->threadGroupHint.thread, (uint32_t)ptr );
|
||||||
|
MemWrite( &item->threadGroupHint.groupHint, t->groupHint );
|
||||||
|
TracyLfqCommit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendString( ptr, GetThreadName( (uint32_t)ptr ), QueueType::ThreadName );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ServerQuerySourceLocation:
|
case ServerQuerySourceLocation:
|
||||||
|
@ -9,7 +9,7 @@ namespace tracy
|
|||||||
|
|
||||||
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
|
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
|
||||||
|
|
||||||
enum : uint32_t { ProtocolVersion = 66 };
|
enum : uint32_t { ProtocolVersion = 67 };
|
||||||
enum : uint16_t { BroadcastVersion = 3 };
|
enum : uint16_t { BroadcastVersion = 3 };
|
||||||
|
|
||||||
using lz4sz_t = uint32_t;
|
using lz4sz_t = uint32_t;
|
||||||
|
@ -108,6 +108,7 @@ enum class QueueType : uint8_t
|
|||||||
SingleStringData,
|
SingleStringData,
|
||||||
SecondStringData,
|
SecondStringData,
|
||||||
MemNamePayload,
|
MemNamePayload,
|
||||||
|
ThreadGroupHint,
|
||||||
StringData,
|
StringData,
|
||||||
ThreadName,
|
ThreadName,
|
||||||
PlotName,
|
PlotName,
|
||||||
@ -477,6 +478,12 @@ struct QueueMemNamePayload
|
|||||||
uint64_t name;
|
uint64_t name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct QueueThreadGroupHint
|
||||||
|
{
|
||||||
|
uint32_t thread;
|
||||||
|
int32_t groupHint;
|
||||||
|
};
|
||||||
|
|
||||||
struct QueueMemAlloc
|
struct QueueMemAlloc
|
||||||
{
|
{
|
||||||
int64_t time;
|
int64_t time;
|
||||||
@ -732,6 +739,7 @@ struct QueueItem
|
|||||||
QueueMemAlloc memAlloc;
|
QueueMemAlloc memAlloc;
|
||||||
QueueMemFree memFree;
|
QueueMemFree memFree;
|
||||||
QueueMemNamePayload memName;
|
QueueMemNamePayload memName;
|
||||||
|
QueueThreadGroupHint threadGroupHint;
|
||||||
QueueCallstackFat callstackFat;
|
QueueCallstackFat callstackFat;
|
||||||
QueueCallstackFatThread callstackFatThread;
|
QueueCallstackFatThread callstackFatThread;
|
||||||
QueueCallstackAllocFat callstackAllocFat;
|
QueueCallstackAllocFat callstackAllocFat;
|
||||||
@ -868,6 +876,7 @@ static constexpr size_t QueueDataSize[] = {
|
|||||||
sizeof( QueueHeader ), // single string data
|
sizeof( QueueHeader ), // single string data
|
||||||
sizeof( QueueHeader ), // second string data
|
sizeof( QueueHeader ), // second string data
|
||||||
sizeof( QueueHeader ) + sizeof( QueueMemNamePayload ),
|
sizeof( QueueHeader ) + sizeof( QueueMemNamePayload ),
|
||||||
|
sizeof( QueueHeader ) + sizeof( QueueThreadGroupHint ),
|
||||||
// keep all QueueStringTransfer below
|
// keep all QueueStringTransfer below
|
||||||
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // string data
|
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // string data
|
||||||
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // thread name
|
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // thread name
|
||||||
|
Loading…
Reference in New Issue
Block a user