From: Xueming Li Date: Thu, 24 Aug 2017 08:23:10 +0000 (+0800) Subject: config: add option to enable asserts X-Git-Tag: spdx-start~1681 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f38530635781adf11134f57498582a50cc32c623;p=dpdk.git config: add option to enable asserts Currently, enabling assertion have to set CONFIG_RTE_LOG_LEVEL to RTE_LOG_DEBUG. CONFIG_RTE_LOG_LEVEL is the default log level of control path, RTE_LOG_DP_LEVEL is the log level of data path. It's a little bit hard to understand literally that assertion is decided by control path LOG_LEVEL, especially assertion used on data path. On the other hand, DPDK need an assertion enabling switch w/o impacting log output level, assuming "--log-level" not specified. Assertion is an important API to balance DPDK high performance and robustness. To promote assertion usage, it's valuable to unhide assertion out of COFNIG_RTE_LOG_LEVEL. In one word, log is log, assertion is assertion, debug is hot pot :) Rationale of this patch is to introduce an dedicate switch of assertion: RTE_ENABLE_ASSERT Signed-off-by: Xueming Li Acked-by: Gaetan Rivet --- diff --git a/config/common_base b/config/common_base index 22068c5c00..725a5730e3 100644 --- a/config/common_base +++ b/config/common_base @@ -93,6 +93,7 @@ CONFIG_RTE_MAX_NUMA_NODES=8 CONFIG_RTE_MAX_MEMSEG=256 CONFIG_RTE_MAX_MEMZONE=2560 CONFIG_RTE_MAX_TAILQ=32 +CONFIG_RTE_ENABLE_ASSERT=n CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO CONFIG_RTE_LOG_HISTORY=256 diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h index cab6fb4c94..79b67b3ec3 100644 --- a/lib/librte_eal/common/include/rte_debug.h +++ b/lib/librte_eal/common/include/rte_debug.h @@ -79,7 +79,7 @@ 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 +#ifdef RTE_ENABLE_ASSERT #define RTE_ASSERT(exp) RTE_VERIFY(exp) #else #define RTE_ASSERT(exp) do {} while (0)