mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Hardcode windows PID 4 as "System".
This commit is contained in:
parent
40eb8a5a03
commit
e9080bdbcd
@ -188,9 +188,20 @@ void SysTraceSendExternalName( uint64_t thread )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if( !threadSent )
|
||||
{
|
||||
GetProfiler().SendString( thread, "???", QueueType::ExternalThreadName );
|
||||
}
|
||||
const auto pid = GetProcessIdOfThread( hnd );
|
||||
CloseHandle( hnd );
|
||||
if( pid != 0 )
|
||||
{
|
||||
if( pid == 4 )
|
||||
{
|
||||
GetProfiler().SendString( thread, "System", QueueType::ExternalName );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto phnd = OpenProcess( PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid );
|
||||
if( phnd != INVALID_HANDLE_VALUE )
|
||||
@ -200,10 +211,6 @@ void SysTraceSendExternalName( uint64_t thread )
|
||||
CloseHandle( phnd );
|
||||
if( sz != 0 )
|
||||
{
|
||||
if( !threadSent )
|
||||
{
|
||||
GetProfiler().SendString( thread, "???", QueueType::ExternalThreadName );
|
||||
}
|
||||
auto ptr = buf + sz - 1;
|
||||
while( ptr > buf && *ptr != '\\' ) ptr--;
|
||||
if( *ptr == '\\' ) ptr++;
|
||||
@ -213,8 +220,12 @@ void SysTraceSendExternalName( uint64_t thread )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !threadSent )
|
||||
{
|
||||
GetProfiler().SendString( thread, "???", QueueType::ExternalThreadName );
|
||||
}
|
||||
GetProfiler().SendString( thread, "???", QueueType::ExternalName );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user