Imported Upstream version 16.07-rc1
[deb_dpdk.git] / lib / librte_eal / common / include / rte_debug.h
index 94129fa..cab6fb4 100644 (file)
@@ -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)