From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by dpdk.org (Postfix) with ESMTP id 4935E5689 for ; Wed, 23 Aug 2017 16:09:58 +0200 (CEST) Received: by mail-wr0-f176.google.com with SMTP id a47so869498wra.0 for ; Wed, 23 Aug 2017 07:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=YUExWP8KLs/kmrQjHfO6IMtq6+z7FUvCmFddqOSh+lo=; b=Ap3kNNy0Y+MdX9f7szX/qypRUmD5k0C6FE2Q5BtqeOTIZGkkSYKrZvyqbMsWBIQyKn XlsuQRhaKBaJVPxMyKmu5a0DZdwcdLdnpNNxLNrdxNKIEbVVVnOrxwQM12s3Y5O5fTfY A9Sku7NUfnhXh6eOAWQ7cRmlpkPHUkcSQJYkZOC+PmPfvWwJ1UIfessq3XXj9CYzOvku WQkMGnh0/m9iBHUuVTSpdJbSlU9dOZF2CANbIpdo75pDl+QxhRKO0+X7bnUauQPp1f0W C3HRGMLjjXnvLcl2+lSsrey2RCgQDIy8DUshv4lAAVCnx5gnWA9xBrF3eDSTGeVzS5UF SI4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=YUExWP8KLs/kmrQjHfO6IMtq6+z7FUvCmFddqOSh+lo=; b=db0qzi7LKYxlsq3VP6yWpZOnyUgaoEthVdEYZzZ9Eo4CsA6flh7icToC+59vd1i2o3 G6M32P9vMBKLP9H1YO6JQ5y+JnqfCgEHIzpUaaRCu1W9JtRFW6NuF+sw3niSMsPS/x7i 1IXCSVolAdrEhxL4CLqB5j1Wj7UDZTeyYOD3GVZMBrHRsQHv9zLsk2pYZceU710bD+fy 4/4GfYNXkqXTpqvgYY6e00VWggpNkc8XsVNR0Ht520ka7yZyj3hA3i9owN/B1Z1ATNkC yIqasmOEnMhZKwsB/qDq561yHrCcosV9zuNCnho5oBRpSAIleCeccY4UrCgJVuGF9VTQ PBMA== X-Gm-Message-State: AHYfb5iiehxGCRXRmusuSL7U8c7WnUK1MolzPuxPjoFZAsUgNA58+CJo krDJsJckiFfhbPbP26Y= X-Received: by 10.223.133.186 with SMTP id 55mr1565680wrt.211.1503497397584; Wed, 23 Aug 2017 07:09:57 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id m16sm1333872wrg.11.2017.08.23.07.09.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 07:09:56 -0700 (PDT) Date: Wed, 23 Aug 2017 16:09:46 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Xueming Li Cc: dev@dpdk.org Message-ID: <20170823140946.GZ8124@bidouze.vm.6wind.com> References: <20170823140008.184627-1-xuemingl@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170823140008.184627-1-xuemingl@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] 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: , X-List-Received-Date: Wed, 23 Aug 2017 14:09:58 -0000 Hi, On Wed, Aug 23, 2017 at 10:00:08PM +0800, Xueming Li wrote: > 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 independant switch of > assertion. > > BTW, CONFIG_RTE_LOG_LEVEL is merely a default value of runtime global > log level, not sure the value to keep it in compile time configuration. > I agree. > Signed-off-by: Xueming Li > --- > 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..ce14b1cac 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_ASSERTION=n I'm not sure about the name, but I'm not maintainer. I'd suggest something like RTE_ASSERT_ENABLE. > 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..d1104c240 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_ASSERTION > #define RTE_ASSERT(exp) RTE_VERIFY(exp) > #else > #define RTE_ASSERT(exp) do {} while (0) > -- > 2.13.3 > Regardless of which name is used: Acked-by: Gaetan Rivet -- Gaëtan Rivet 6WIND