diff options
author | jackpoz <giacomopoz@gmail.com> | 2018-02-17 23:29:34 +0100 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2018-02-17 23:29:34 +0100 |
commit | db5c9867e2ffde3657f53bc155b474c5d46884dd (patch) | |
tree | 713027f27e45710209e20e0606607ee1e9185840 /src | |
parent | 572eab1c355d9298ee640ebd7439f55366224fb8 (diff) |
Core/Misc: Add PERFORMANCE_PROFILING CMake option
Add a new CMake option called PERFORMANCE_PROFILING that should be used only when profiling the performance.
This option is unsupported, do not report any issue happening when enabling this option.
Diffstat (limited to 'src')
-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 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h index 867040ed829..ecb8284e9da 100644 --- a/src/common/Debugging/Errors.h +++ b/src/common/Debugging/Errors.h @@ -52,7 +52,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> inline T* ASSERT_NOTNULL(T* pointer) diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h index 740ffaf03c9..6af294e1321 100644 --- a/src/common/Logging/Log.h +++ b/src/common/Logging/Log.h @@ -144,7 +144,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 3c7ebc5c387..777610fdde3 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()) \ |