From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Keith Wiles <keith.wiles@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] log:Change magic number on RTE_LOG_LEVEL to a define
Date: Sun, 02 Aug 2015 19:15:55 +0200 [thread overview]
Message-ID: <6687423.9WN7KrYfak@xps13> (raw)
In-Reply-To: <1433635446-78275-2-git-send-email-keith.wiles@intel.com>
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?
next prev parent reply other threads:[~2015-08-02 17:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-07 0:04 [dpdk-dev] [PATCH] eal:Fix log messages always being printed from rte_eal_cpu_init Keith Wiles
2015-06-07 0:04 ` [dpdk-dev] [PATCH] log:Change magic number on RTE_LOG_LEVEL to a define Keith Wiles
2015-08-02 17:15 ` Thomas Monjalon [this message]
2015-08-02 19:10 ` Wiles, Keith
2015-08-02 19:15 ` Wiles, Keith
2015-08-02 20:44 ` Thomas Monjalon
2015-08-02 20:58 ` Wiles, Keith
2015-08-02 21:22 ` Thomas Monjalon
2015-08-02 21:40 ` [dpdk-dev] [PATCH v2] log:Change magic number on RTE_LOG_LEVEL to an enum name Keith Wiles
2015-08-03 3:13 ` Stephen Hemminger
2015-06-08 11:09 ` [dpdk-dev] [PATCH] eal:Fix log messages always being printed from rte_eal_cpu_init Bruce Richardson
2015-06-08 13:33 ` Wiles, Keith
2015-06-08 13:59 ` Wiles, Keith
2015-06-08 21:55 ` [dpdk-dev] [PATCH v2] " Keith Wiles
2015-06-19 9:54 ` David Marchand
2015-06-22 20:04 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6687423.9WN7KrYfak@xps13 \
--to=thomas.monjalon@6wind.com \
--cc=dev@dpdk.org \
--cc=keith.wiles@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).