]> git.droids-corp.org - dpdk.git/commitdiff
eal: fix evaluation of log level option
authorDavid Marchand <david.marchand@redhat.com>
Fri, 9 Apr 2021 11:04:53 +0000 (13:04 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 9 Apr 2021 12:20:23 +0000 (14:20 +0200)
--log-level option is handled early, no need to reevaluate it later in
EAL init.

Before:
$ echo quit | ./build/app/test/dpdk-test --no-huge -m 512 \
  --log-level=lib.eal:debug \
  --log-level=lib.ethdev:debug --log-level=lib.ethdev:info \
  |& grep -i log.level

EAL: lib.eal log level changed from info to debug
EAL: lib.ethdev log level changed from info to debug
EAL: lib.ethdev log level changed from debug to info
EAL: lib.ethdev log level changed from info to debug
EAL: lib.ethdev log level changed from debug to info
EAL: lib.telemetry log level changed from disabled to warning

After:
$ echo quit | ./build/app/test/dpdk-test --no-huge -m 512 \
  --log-level=lib.eal:debug \
  --log-level=lib.ethdev:debug --log-level=lib.ethdev:info \
  |& grep -i log.level

EAL: lib.eal log level changed from info to debug
EAL: lib.ethdev log level changed from info to debug
EAL: lib.ethdev log level changed from debug to info
EAL: lib.telemetry log level changed from disabled to warning

Fixes: 6c7216eefd63 ("eal: fix log level of early messages")
Fixes: 1c806ae5c3ac ("eal/windows: support command line options parsing")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
lib/librte_eal/freebsd/eal.c
lib/librte_eal/linux/eal.c
lib/librte_eal/windows/eal.c

index 5544701f20e57478cd499464154bc88b9226e8fd..f4d1676754948cf95bc680deebbeded6249d40be 100644 (file)
@@ -521,6 +521,10 @@ eal_parse_args(int argc, char **argv)
                        goto out;
                }
 
+               /* eal_log_level_parse() already handled this option */
+               if (opt == OPT_LOG_LEVEL_NUM)
+                       continue;
+
                ret = eal_parse_common_option(opt, optarg, internal_conf);
                /* common parser is not happy */
                if (ret < 0) {
index baeead3301de97dcd3b55e2852df209a0a393113..ba19fc6347eb1bdc37ba402f7d8d2feb27f3c5b4 100644 (file)
@@ -705,6 +705,10 @@ eal_parse_args(int argc, char **argv)
                        goto out;
                }
 
+               /* eal_log_level_parse() already handled this option */
+               if (opt == OPT_LOG_LEVEL_NUM)
+                       continue;
+
                ret = eal_parse_common_option(opt, optarg, internal_conf);
                /* common parser is not happy */
                if (ret < 0) {
index 68a1fd1d21dc309c00220e02bc25e1740a09d0f7..41be20d89f9dbb9ed446c09808e1209c63d9a51c 100644 (file)
@@ -150,6 +150,10 @@ eal_parse_args(int argc, char **argv)
                        return -1;
                }
 
+               /* eal_log_level_parse() already handled this option */
+               if (opt == OPT_LOG_LEVEL_NUM)
+                       continue;
+
                ret = eal_parse_common_option(opt, optarg, internal_conf);
                /* common parser is not happy */
                if (ret < 0) {