From 8b25d1ad5d2264bdfc2818c7bda74ee2697df6db Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Wed, 6 Jul 2016 09:22:35 +0200 Subject: Imported Upstream version 16.07-rc1 Change-Id: I40a523e52f12e8496fdd69e902824b0226c303de Signed-off-by: Christian Ehrhardt --- lib/librte_eal/common/include/rte_debug.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/librte_eal/common/include/rte_debug.h') diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h index 94129fab..cab6fb4c 100644 --- a/lib/librte_eal/common/include/rte_debug.h +++ b/lib/librte_eal/common/include/rte_debug.h @@ -43,6 +43,9 @@ * the implementation is architecture-specific. */ +#include "rte_log.h" +#include "rte_branch_prediction.h" + #ifdef __cplusplus extern "C" { #endif @@ -76,8 +79,13 @@ void rte_dump_registers(void); #define rte_panic(...) rte_panic_(__func__, __VA_ARGS__, "dummy") #define rte_panic_(func, format, ...) __rte_panic(func, format "%.0s", __VA_ARGS__) +#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG +#define RTE_ASSERT(exp) RTE_VERIFY(exp) +#else +#define RTE_ASSERT(exp) do {} while (0) +#endif #define RTE_VERIFY(exp) do { \ - if (!(exp)) \ + if (unlikely(!(exp))) \ rte_panic("line %d\tassert \"" #exp "\" failed\n", __LINE__); \ } while (0) -- cgit 1.2.3-korg