From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by dpdk.org (Postfix) with ESMTP id CCEB0C3B8 for ; Sun, 2 Aug 2015 19:17:09 +0200 (CEST) Received: by wibxm9 with SMTP id xm9so86965308wib.1 for ; Sun, 02 Aug 2015 10:17:09 -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=I+MxKGQXaVXrbpRx7qkxpwCBaa7ofwww+q4oE7A++ls=; b=awiJSxrGbUPnS4zrsiLIa1IVXnBuPwPhw4d9PvN/FDqJfrvjd4wzhk9qCI8L+xE0Wn ed9m32Xm2Wmb3eOljY2zBgdTt2jY4jyNGFK2jB+0tOdVDLeBGSpJ4DTDeYmY1y5XV1vx hMhyyflMabQeXfO7BtY2lFjHiae2/WJDCr5/CGfH2aheLpzRwMdmmlROKGUDGu9xw4hj FHIUCORFw9lwqMRaX68leGDHW5IY7QdAhMTeW8Ss3XjA/s6OZ5jqAbBhD59BrXDWVSDu ht3SvRYMEvvpUh6DPbCz06Ov0HDNih/xeUw4HliiR/P5fEFzI/hbHB5HZWBbeiVdhObC ISJA== X-Gm-Message-State: ALoCoQmkIAlYSXKWnTKsb7NfNBQKyyOxlCKSq1234Z8Go+SUJeAhliWojnTb7cIxIjI7kZBWRRn8 X-Received: by 10.180.91.40 with SMTP id cb8mr27276628wib.54.1438535829658; Sun, 02 Aug 2015 10:17:09 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id u7sm9136529wif.3.2015.08.02.10.17.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 10:17:08 -0700 (PDT) From: Thomas Monjalon To: Keith Wiles Date: Sun, 02 Aug 2015 19:15:55 +0200 Message-ID: <6687423.9WN7KrYfak@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1433635446-78275-2-git-send-email-keith.wiles@intel.com> References: <1433635446-78275-1-git-send-email-keith.wiles@intel.com> <1433635446-78275-2-git-send-email-keith.wiles@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] log:Change magic number on RTE_LOG_LEVEL to a define 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: Sun, 02 Aug 2015 17:17:09 -0000 2015-06-06 19:04, Keith Wiles: > --- a/config/common_bsdapp > +++ b/config/common_bsdapp > @@ -93,12 +93,18 @@ CONFIG_RTE_MAX_NUMA_NODES=8 > CONFIG_RTE_MAX_MEMSEG=256 > CONFIG_RTE_MAX_MEMZONE=2560 > CONFIG_RTE_MAX_TAILQ=32 > -CONFIG_RTE_LOG_LEVEL=8 > CONFIG_RTE_LOG_HISTORY=256 > CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n > CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n > > # > +# Log level use: RTE_LOG_XXX > +# XXX = NOOP, EMERG, ALERT, CRIT, ERR, WARNING, NOTICE, INFO or DEBUG > +# Look in rte_log.h for others if any. > +# I think this comment is useless. > +CONFIG_RTE_LOG_LEVEL=RTE_LOG_DEBUG Yes, easier to read. Please do not move line without good reason. It was more logic to see it along with LOG_HISTORY. > --- a/lib/librte_eal/common/eal_common_log.c > +++ b/lib/librte_eal/common/eal_common_log.c > @@ -82,7 +82,7 @@ static struct log_history_list log_history; > /* global log structure */ > struct rte_logs rte_logs = { > .type = ~0, > - .level = RTE_LOG_DEBUG, > + .level = RTE_LOG_LEVEL, > .file = NULL, > }; OK, more consistent. It was set to RTE_LOG_LEVEL later anyway. (this comment would be useful in the commit message) > /* Can't use 0, as it gives compiler warnings */ > -#define RTE_LOG_EMERG 1U /**< System is unusable. */ > -#define RTE_LOG_ALERT 2U /**< Action must be taken immediately. */ > -#define RTE_LOG_CRIT 3U /**< Critical conditions. */ > -#define RTE_LOG_ERR 4U /**< Error conditions. */ > -#define RTE_LOG_WARNING 5U /**< Warning conditions. */ > -#define RTE_LOG_NOTICE 6U /**< Normal but significant condition. */ > -#define RTE_LOG_INFO 7U /**< Informational. */ > -#define RTE_LOG_DEBUG 8U /**< Debug-level messages. */ > +enum { > + RTE_LOG_NOOP = 0, /**< Noop not used (zero entry) */ NOOP is useless: EMERG may be = 1 > + RTE_LOG_EMERG, /**< System is unusable. */ > + RTE_LOG_ALERT, /**< Action must be taken immediately. */ > + RTE_LOG_CRIT, /**< Critical conditions. */ > + RTE_LOG_ERR, /**< Error conditions. */ > + RTE_LOG_WARNING, /**< Warning conditions. */ > + RTE_LOG_NOTICE, /**< Normal but significant condition. */ > + RTE_LOG_INFO, /**< Informational. */ > + RTE_LOG_DEBUG /**< Debug-level messages. */ > +}; What is the benefit of this change?