mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Check if external threads are local.
For some unknown reason, local threads may be attributed to an external process (at least when profiling on Windows). This causes some problems, for example the CPU usage graph may show that CPU is pegged by some other program, when it reality it is the profiled program that uses the CPU time. Workaround by checking first, if the thread id is known to be local by the profiler, i.e. if there were user-generated events originating from it. This still leaves other things, such as the CPU data list, being wrong, but the CPU data is meant to show raw TID -> PID mapping. If the source data is wrong, there's not much to fix here.
This commit is contained in:
parent
0f0ac2d6c5
commit
2e9d8f8215
@ -7091,7 +7091,8 @@ void Worker::ReconstructContextSwitchUsage()
|
||||
{
|
||||
const auto ct = !cpus[i].startDone ? cpus[i].it->Start() : cpus[i].it->End();
|
||||
if( nextTime != ct ) break;
|
||||
const auto isOwn = GetPidFromTid( DecompressThreadExternal( cpus[i].it->Thread() ) ) == m_pid;
|
||||
const auto tid = DecompressThreadExternal( cpus[i].it->Thread() );
|
||||
const auto isOwn = IsThreadLocal( tid ) || GetPidFromTid( tid ) == m_pid;
|
||||
if( !cpus[i].startDone )
|
||||
{
|
||||
if( isOwn )
|
||||
|
Loading…
Reference in New Issue
Block a user