From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 687ABC7BC for ; Mon, 22 Jun 2015 22:54:28 +0200 (CEST) Received: by wguu7 with SMTP id u7so79525740wgu.3 for ; Mon, 22 Jun 2015 13:54:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=RlSn6Z5XsCcPwBXVNEJ1ejzmhxj/j7tQVPWSlKy98gI=; b=YndlkJGZmyTdxjzM9HIjmllBNrxd+JenXfh5mLS4xP+yNXBSWxk11RVOkE3jbheVIv 6cWv3I//K5DzFvw6biZwFABru+lJHA2DK3VOX/D+VjzK3rD8kytv/bfje94DsV9iIhFB m5cJZIt6KZ5MvnWEkCvVo3PeQvnhGa1dQ4wQJNn36Fkh/0QoCzIAoAWyfpfG/85ispA4 HbBYJjBAKhGt8DwuOMMTKOqtuqtFFo2plCOwHuuFNJM5bV8N50vOwaV0rg32PPz9C1nu 2+aKzUEZIlLghHtq4rv0YerK9KWXan2Cs5K1swGjN8Fgnp7hlhx07UVxniPKy/PSacI6 p1bw== X-Gm-Message-State: ALoCoQk9+1kWkyo4IksA1/xZIs9Bzbnkg8ZZR9JcI+cwhiV2s8h6qlrz0hF24tM/p6AYhnevIcXe X-Received: by 10.181.27.131 with SMTP id jg3mr34772735wid.89.1435006468267; Mon, 22 Jun 2015 13:54:28 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id nb9sm18958283wic.10.2015.06.22.13.54.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 13:54:27 -0700 (PDT) From: Thomas Monjalon To: Bruce Richardson Date: Mon, 22 Jun 2015 22:53:25 +0200 Message-ID: <3471063.5PjCouUNn0@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <20150608105810.GC3996@bricha3-MOBL3> References: <1433520077-11234-1-git-send-email-bruce.richardson@intel.com> <19910784.6F5piXXB0d@xps13> <20150608105810.GC3996@bricha3-MOBL3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Mon, 22 Jun 2015 20:54:28 -0000 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".