From patchwork Thu Aug 24 08:10:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xueming Li X-Patchwork-Id: 27839 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4B5277D4A; Thu, 24 Aug 2017 10:10:37 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id A392A7D3A for ; Thu, 24 Aug 2017 10:10:35 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 24 Aug 2017 11:10:09 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.222]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v7O8A94u028438; Thu, 24 Aug 2017 11:10:09 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id v7O8A85X087021; Thu, 24 Aug 2017 16:10:08 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id v7O8A4aX087020; Thu, 24 Aug 2017 16:10:04 +0800 From: Xueming Li To: Gaetan Rivet , Wiles Keith Cc: xuemingl@mellanox.com, dev@dpdk.org Date: Thu, 24 Aug 2017 16:10:00 +0800 Message-Id: <20170824081000.86972-1-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170823140008.184627-1-xuemingl@mellanox.com> References: <20170823140008.184627-1-xuemingl@mellanox.com> Subject: [dpdk-dev] [PATCH v2] eal: add config option to enable asserts X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- v2: Changed macro name from RTE_ASSERTION to RTE_ENABLE_ASSERT --- config/common_base | 1 + lib/librte_eal/common/include/rte_debug.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/common_base b/config/common_base index 5e97a08b6..2cb445b6d 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 cab6fb4c9..79b67b3ec 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)