mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Decode PID and TID when generating imported thread names.
This commit is contained in:
parent
8ea02a4794
commit
7f1f929662
@ -435,14 +435,30 @@ Worker::Worker( const char* name, const char* program, const std::vector<ImportE
|
|||||||
if( name != threadNames.end() )
|
if( name != threadNames.end() )
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
int len = snprintf( buf, sizeof( buf ), "(%" PRIu64 ") %s", t.first, name->second.c_str() );
|
int len;
|
||||||
|
if( t.first <= std::numeric_limits<uint32_t>::max() )
|
||||||
|
{
|
||||||
|
len = snprintf( buf, sizeof( buf ), "(%" PRIu64 ") %s", t.first, name->second.c_str() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
len = snprintf( buf, sizeof( buf ), "(PID %" PRIu64 " TID %" PRIu64 ") %s", t.first >> 32, t.first & 0xFFFFFFFF, name->second.c_str() );
|
||||||
|
}
|
||||||
AddThreadString( t.first, buf, len );
|
AddThreadString( t.first, buf, len );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
sprintf( buf, "%" PRIu64, t.first );
|
int len;
|
||||||
AddThreadString( t.first, buf, strlen( buf ) );
|
if( t.first <= std::numeric_limits<uint32_t>::max() )
|
||||||
|
{
|
||||||
|
len = sprintf( buf, "%" PRIu64, t.first );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
len = sprintf( buf, "PID %" PRIu64 " TID %" PRIu64, t.first >> 32, t.first & 0xFFFFFFFF );
|
||||||
|
}
|
||||||
|
AddThreadString( t.first, buf, len );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user