diff options
-rw-r--r-- | cmake/showoptions.cmake | 7 | ||||
-rw-r--r-- | src/common/Debugging/Errors.h | 5 | ||||
-rw-r--r-- | src/common/Logging/Log.h | 4 | ||||
-rw-r--r-- | src/common/Metric/Metric.h | 5 |
4 files changed, 19 insertions, 2 deletions
diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index 600d3c086cb..a4ed07dcaa8 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -104,6 +104,13 @@ if ( HELGRIND ) add_definitions(-DHELGRIND) endif() +if ( PERFORMANCE_PROFILING ) + message("") + message(" *** PERFORMANCE_PROFILING - WARNING!") + message(" *** Please note that this is for PERFORMANCE PROFILING only! Do NOT report any issue when enabling this configuration!") + add_definitions(-DPERFORMANCE_PROFILING) +endif() + if (BUILD_SHARED_LIBS) message("") message(" *** WITH_DYNAMIC_LINKING - INFO!") diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h index fe898e772a2..098917396fc 100644 --- a/src/common/Debugging/Errors.h +++ b/src/common/Debugging/Errors.h @@ -51,7 +51,12 @@ namespace Trinity #define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END #define WPAbort() ASSERT_BEGIN do { Trinity::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END +#ifdef PERFORMANCE_PROFILING +#define ASSERT(cond, ...) ((void)0) +#else #define ASSERT WPAssert +#endif + #define ABORT WPAbort template <typename T> diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h index 498bd830676..c5ca989ef5d 100644 --- a/src/common/Logging/Log.h +++ b/src/common/Logging/Log.h @@ -143,7 +143,9 @@ class TC_COMMON_API Log } \ } -#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS +#ifdef PERFORMANCE_PROFILING +#define TC_LOG_MESSAGE_BODY(filterType__, level__, ...) ((void)0) +#elif TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS void check_args(char const*, ...) ATTR_PRINTF(1, 2); void check_args(std::string const&, ...); diff --git a/src/common/Metric/Metric.h b/src/common/Metric/Metric.h index 1ce27649fd9..1182db6b501 100644 --- a/src/common/Metric/Metric.h +++ b/src/common/Metric/Metric.h @@ -121,7 +121,10 @@ public: #define sMetric Metric::instance() -#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS +#ifdef PERFORMANCE_PROFILING +#define TC_METRIC_EVENT(category, title, description) ((void)0) +#define TC_METRIC_VALUE(category, value) ((void)0) +#elif TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS #define TC_METRIC_EVENT(category, title, description) \ do { \ if (sMetric->IsEnabled()) \ |