From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6E0D55A95 for ; Tue, 23 Jun 2015 18:00:26 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 23 Jun 2015 09:00:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,666,1427785200"; d="scan'208";a="593296033" Received: from bricha3-mobl3.ger.corp.intel.com ([10.34.84.85]) by orsmga003.jf.intel.com with SMTP; 23 Jun 2015 09:00:08 -0700 Received: by (sSMTP sendmail emulation); Tue, 23 Jun 2015 17:00:08 +0025 Date: Tue, 23 Jun 2015 17:00:08 +0100 From: Bruce Richardson To: Thomas Monjalon Message-ID: <20150623160007.GA2460@bricha3-MOBL3> References: <1433520077-11234-1-git-send-email-bruce.richardson@intel.com> <19910784.6F5piXXB0d@xps13> <20150608105810.GC3996@bricha3-MOBL3> <3471063.5PjCouUNn0@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3471063.5PjCouUNn0@xps13> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] examples/distributor: fix missing "; " in debug macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2015 16:00:26 -0000 On Mon, Jun 22, 2015 at 10:53:25PM +0200, Thomas Monjalon wrote: > 2015-06-08 11:58, Bruce Richardson: > > On Fri, Jun 05, 2015 at 10:45:04PM +0200, Thomas Monjalon wrote: > > > It shows that such dead code is almost never tested. > > > It would be saner if this command would return no result: > > > git grep 'ifdef.*DEBUG' examples > > > examples/distributor/main.c:#ifdef DEBUG > > > examples/l3fwd-acl/main.c:#ifdef L3FWDACL_DEBUG > > > examples/l3fwd-acl/main.c:#ifdef L3FWDACL_DEBUG > > > examples/l3fwd-acl/main.c:#ifdef L3FWDACL_DEBUG > > > examples/l3fwd-acl/main.c:#ifdef L3FWDACL_DEBUG > > > examples/packet_ordering/main.c:#ifdef DEBUG > > > examples/vhost/main.c:#ifdef DEBUG > > > examples/vhost/main.h:#ifdef DEBUG > > > examples/vhost_xen/main.c:#ifdef DEBUG > > > examples/vhost_xen/main.h:#ifdef DEBUG > > > > > > There is no good reason to not use CONFIG_RTE_LOG_LEVEL to trigger debug build. > > > > > I agree and disagree. > > > > I agree it would be good if we had a standard way of setting up > > a DEBUG build that would make it easier to test and pick up on this sort of things. > > > > I disagree that the compile time log level is the way to do this. The log level > > at compile time specifies the default log level only, the actual log level is > > controllable at runtime. Having the default log level also affect what kind of > > build is done, e.g. with -O0 rather than -O3, introduces an unnecessary dependency. > > Setting the default log level to 5 and changing it to 9 at runtime should be > > the same as setting the default to 9. > > Setting CONFIG_RTE_LOG_LEVEL to 9 means we don't care about performance > degradation due to debug log branches. So it is necessarily a debug build. > Then the default log level must be set by the application. > The EAL default set from CONFIG_RTE_LOG_LEVEL is a last chance default in > case the application doesn't care about it. > > Maybe it won't convince you but anyway, it's not important here because the > example applications don't use the DEBUG flag for anything else than the logs. > That's why I think these flags must be removed. > Please check "git grep 'ifdef.*DEBUG' examples". > For checking if the app cares about performance, I would check the __optimize__ define rather than having a specific DEBUG macro, or using the DEFAULT_LOG_LEVEL setting. /Bruce