mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Setup system tracing before launching profiler threads.
This makes sure that profiler threads are properly included in sample data on Linux. This was previously working because sample capture was performed system-wide. Now samples are only captured in client context, which includes all spawned threads. Since this inclusion only works for threads which will be spawned after the trace starts, no thread can be created before sampling setup is done.
This commit is contained in:
parent
3c31fb56a8
commit
859aa3b2b0
@ -1207,14 +1207,6 @@ Profiler::Profiler()
|
||||
|
||||
void Profiler::SpawnWorkerThreads()
|
||||
{
|
||||
s_thread = (Thread*)tracy_malloc( sizeof( Thread ) );
|
||||
new(s_thread) Thread( LaunchWorker, this );
|
||||
|
||||
#ifndef TRACY_NO_FRAME_IMAGE
|
||||
s_compressThread = (Thread*)tracy_malloc( sizeof( Thread ) );
|
||||
new(s_compressThread) Thread( LaunchCompressWorker, this );
|
||||
#endif
|
||||
|
||||
#ifdef TRACY_HAS_SYSTEM_TRACING
|
||||
if( SysTraceStart( m_samplingPeriod ) )
|
||||
{
|
||||
@ -1224,6 +1216,14 @@ void Profiler::SpawnWorkerThreads()
|
||||
}
|
||||
#endif
|
||||
|
||||
s_thread = (Thread*)tracy_malloc( sizeof( Thread ) );
|
||||
new(s_thread) Thread( LaunchWorker, this );
|
||||
|
||||
#ifndef TRACY_NO_FRAME_IMAGE
|
||||
s_compressThread = (Thread*)tracy_malloc( sizeof( Thread ) );
|
||||
new(s_compressThread) Thread( LaunchCompressWorker, this );
|
||||
#endif
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
s_profilerThreadId = GetThreadId( s_thread->Handle() );
|
||||
AddVectoredExceptionHandler( 1, CrashFilter );
|
||||
|
Loading…
Reference in New Issue
Block a user