fix coding style

This commit is contained in:
Tiago Rodrigues 2023-11-13 13:43:03 -05:00
parent 5f60ac7ad2
commit c373647dae
3 changed files with 16 additions and 18 deletions

View File

@ -162,15 +162,15 @@ void InitCallstack()
// Sometimes this process can take a very long time and prevent resolving callstack frames // Sometimes this process can take a very long time and prevent resolving callstack frames
// symbols during that time. // symbols during that time.
const char* noInitLoadEnv = GetEnvVar( "TRACY_NO_DBHELP_INIT_LOAD" ); const char* noInitLoadEnv = GetEnvVar( "TRACY_NO_DBHELP_INIT_LOAD" );
const bool initTimeLoadModules = !(noInitLoadEnv && noInitLoadEnv[0] == '1'); const bool initTimeModuleLoad = !( noInitLoadEnv && noInitLoadEnv[0] == '1' );
if (!initTimeLoadModules) if ( !initTimeModuleLoad )
{ {
printf("TRACY: skipping init dbhelper module load\n"); TracyDebug("TRACY: skipping init time dbghelper module load\n");
} }
DWORD needed; DWORD needed;
LPVOID dev[4096]; LPVOID dev[4096];
if( initTimeLoadModules && (EnumDeviceDrivers( dev, sizeof(dev), &needed ) != 0) ) if( initTimeModuleLoad && EnumDeviceDrivers( dev, sizeof(dev), &needed ) != 0 )
{ {
char windir[MAX_PATH]; char windir[MAX_PATH];
if( !GetWindowsDirectoryA( windir, sizeof( windir ) ) ) memcpy( windir, "c:\\windows", 11 ); if( !GetWindowsDirectoryA( windir, sizeof( windir ) ) ) memcpy( windir, "c:\\windows", 11 );
@ -225,7 +225,7 @@ void InitCallstack()
HANDLE proc = GetCurrentProcess(); HANDLE proc = GetCurrentProcess();
HMODULE mod[1024]; HMODULE mod[1024];
if( initTimeLoadModules && (EnumProcessModules( proc, mod, sizeof( mod ), &needed ) != 0) ) if( initTimeModuleLoad && EnumProcessModules( proc, mod, sizeof( mod ), &needed ) != 0 )
{ {
const auto sz = needed / sizeof( HMODULE ); const auto sz = needed / sizeof( HMODULE );
for( size_t i=0; i<sz; i++ ) for( size_t i=0; i<sz; i++ )

View File

@ -9,13 +9,12 @@
# include <unwind.h> # include <unwind.h>
#elif TRACY_HAS_CALLSTACK >= 3 #elif TRACY_HAS_CALLSTACK >= 3
# ifdef TRACE_CLIENT_LIBUNWIND_BACKTRACE # ifdef TRACE_CLIENT_LIBUNWIND_BACKTRACE
// libunwind is in general significantly faster than execinfo based backtraces // libunwind is, in general, significantly faster than execinfo based backtraces
# define UNW_LOCAL_ONLY # define UNW_LOCAL_ONLY
# include <libunwind.h> # include <libunwind.h>
# else # else
# include <execinfo.h> # include <execinfo.h>
# endif # endif
#endif #endif
#ifndef TRACY_HAS_CALLSTACK #ifndef TRACY_HAS_CALLSTACK

View File

@ -1439,14 +1439,13 @@ Profiler::Profiler()
void Profiler::SpawnWorkerThreads() void Profiler::SpawnWorkerThreads()
{ {
#ifdef TRACY_HAS_SYSTEM_TRACING #ifdef TRACY_HAS_SYSTEM_TRACING
// use TRACY_NO_SYS_TRACE=1 to force disabling sys tracing // use TRACY_NO_SYS_TRACE=1 to force disabling sys tracing (even if available in the underlying system)
// (even if available in the underlying system)
// as it can have significant impact on the size of the traces // as it can have significant impact on the size of the traces
const char* noSysTrace = GetEnvVar( "TRACY_NO_SYS_TRACE" ); const char* noSysTrace = GetEnvVar( "TRACY_NO_SYS_TRACE" );
const bool disableSystrace = (noSysTrace && noSysTrace[0] == '1'); const bool disableSystrace = (noSysTrace && noSysTrace[0] == '1');
if( disableSystrace ) if( disableSystrace )
{ {
printf("TRACY: systrace was disabled by 'TRACY_NO_SYS_TRACE=1'\n"); TracyDebug("TRACY: Sys Trace was disabled by 'TRACY_NO_SYS_TRACE=1'\n");
} }
else if( SysTraceStart( m_samplingPeriod ) ) else if( SysTraceStart( m_samplingPeriod ) )
{ {