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

@ -161,16 +161,16 @@ void InitCallstack()
// and process module symbol loading at startup time - they will be loaded on demand later
// Sometimes this process can take a very long time and prevent resolving callstack frames
// symbols during that time.
const char* noInitLoadEnv = GetEnvVar("TRACY_NO_DBHELP_INIT_LOAD");
const bool initTimeLoadModules = !(noInitLoadEnv && noInitLoadEnv[0] == '1');
if (!initTimeLoadModules)
const char* noInitLoadEnv = GetEnvVar( "TRACY_NO_DBHELP_INIT_LOAD" );
const bool initTimeModuleLoad = !( noInitLoadEnv && noInitLoadEnv[0] == '1' );
if ( !initTimeModuleLoad )
{
printf("TRACY: skipping init dbhelper module load\n");
TracyDebug("TRACY: skipping init time dbghelper module load\n");
}
DWORD needed;
LPVOID dev[4096];
if( initTimeLoadModules && (EnumDeviceDrivers( dev, sizeof(dev), &needed ) != 0) )
if( initTimeModuleLoad && EnumDeviceDrivers( dev, sizeof(dev), &needed ) != 0 )
{
char windir[MAX_PATH];
if( !GetWindowsDirectoryA( windir, sizeof( windir ) ) ) memcpy( windir, "c:\\windows", 11 );
@ -225,7 +225,7 @@ void InitCallstack()
HANDLE proc = GetCurrentProcess();
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 );
for( size_t i=0; i<sz; i++ )

View File

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

View File

@ -1439,14 +1439,13 @@ Profiler::Profiler()
void Profiler::SpawnWorkerThreads()
{
#ifdef TRACY_HAS_SYSTEM_TRACING
// use TRACY_NO_SYS_TRACE=1 to force disabling sys tracing
// (even if available in the underlying system)
// use TRACY_NO_SYS_TRACE=1 to force disabling sys tracing (even if available in the underlying system)
// as it can have significant impact on the size of the traces
const char* noSysTrace = GetEnvVar( "TRACY_NO_SYS_TRACE" );
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 ) )
{