diff --git a/cmake_modules/commonSetup.cmake b/cmake_modules/commonSetup.cmake index 1ccf2ee5607..ee3cdca1626 100644 --- a/cmake_modules/commonSetup.cmake +++ b/cmake_modules/commonSetup.cmake @@ -259,6 +259,7 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "") endif () if (PROFILING AND (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)) add_definitions (-fno-omit-frame-pointer) + add_definitions (-D_PROFILING) endif () if (WIN32) diff --git a/system/jlib/jmutex.cpp b/system/jlib/jmutex.cpp index 670158a5d2f..1789a59633f 100644 --- a/system/jlib/jmutex.cpp +++ b/system/jlib/jmutex.cpp @@ -121,6 +121,8 @@ int Mutex::unlockAll() static SpinLock sl; void InstrumentedCriticalSection::reportContended(bool destructor) { + if (!queryLogMsgManager()) + return; if (contended*2 > uncontended && contended % 1000 == 0) { SpinBlock block(sl); diff --git a/system/jlib/jmutex.hpp b/system/jlib/jmutex.hpp index abea2381f70..05b8efaba88 100644 --- a/system/jlib/jmutex.hpp +++ b/system/jlib/jmutex.hpp @@ -35,8 +35,8 @@ extern jlib_decl void spinUntilReady(std::atomic_uint &value); //#define SPINLOCK_USE_MUTEX // for testing #define SPINLOCK_RR_CHECK // checks for realtime threads #define _ASSERT_LOCK_SUPPORT -#define USE_INSTRUMENTED_CRITSECS -#elif defined(_PROFILE) +//#define USE_INSTRUMENTED_CRITSECS +#elif defined(_PROFILING) #define USE_INSTRUMENTED_CRITSECS #endif