From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH] examples/distributor: fix missing "; " in debug macro Date: Mon, 8 Jun 2015 11:58:10 +0100 Message-ID: <20150608105810.GC3996@bricha3-MOBL3> References: <1433520077-11234-1-git-send-email-bruce.richardson@intel.com> <19910784.6F5piXXB0d@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 670431288 for ; Mon, 8 Jun 2015 12:58:14 +0200 (CEST) Content-Disposition: inline In-Reply-To: <19910784.6F5piXXB0d@xps13> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jun 05, 2015 at 10:45:04PM +0200, Thomas Monjalon wrote: > 2015-06-05 17:01, Bruce Richardson: > > The macro to turn on additional debug output when the app was compiled > > with "-DDEBUG" was missing a ";". > > 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. /Bruce