diff --git a/lib/env_dpdk/init.c b/lib/env_dpdk/init.c index eba9b29eb..11c8a9485 100644 --- a/lib/env_dpdk/init.c +++ b/lib/env_dpdk/init.c @@ -302,6 +302,21 @@ spdk_build_eal_cmdline(const struct spdk_env_opts *opts) } } + /* Lower default EAL loglevel to RTE_LOG_NOTICE - normal, but significant messages. + * This can be overridden by specifying the same option in opts->env_context + */ + args = spdk_push_arg(args, &argcount, strdup("--log-level=lib.eal:6")); + if (args == NULL) { + return -1; + } + + if (opts->env_context) { + args = spdk_push_arg(args, &argcount, strdup(opts->env_context)); + if (args == NULL) { + return -1; + } + } + #ifdef __linux__ /* Set the base virtual address - it must be an address that is not in the * ASAN shadow region, otherwise ASAN-enabled builds will ignore the @@ -416,8 +431,5 @@ spdk_env_init(const struct spdk_env_opts *opts) spdk_env_unlink_shared_files(); } - /* Print only the significant EAL messages */ - rte_log_set_level(RTE_LOGTYPE_EAL, RTE_LOG_NOTICE); - return spdk_env_dpdk_post_init(); } diff --git a/test/env/vtophys/vtophys.c b/test/env/vtophys/vtophys.c index 62c9f5cc0..62ae0828d 100644 --- a/test/env/vtophys/vtophys.c +++ b/test/env/vtophys/vtophys.c @@ -33,11 +33,16 @@ #include "spdk/stdinc.h" +#include "spdk/config.h" #include "spdk/env.h" #include "spdk/util.h" #include "CUnit/Basic.h" +#define __SPDK_ENV_NAME(path) (strrchr(#path, '/') + 1) +#define _SPDK_ENV_NAME(path) __SPDK_ENV_NAME(path) +#define SPDK_ENV_NAME _SPDK_ENV_NAME(SPDK_CONFIG_ENV) + static void vtophys_malloc_test(void) { @@ -156,6 +161,10 @@ main(int argc, char **argv) spdk_env_opts_init(&opts); opts.name = "vtophys"; opts.core_mask = "0x1"; + if (strcmp(SPDK_ENV_NAME, "env_dpdk") == 0) { + opts.env_context = "--log-level=lib.eal:8"; + } + if (spdk_env_init(&opts) < 0) { printf("Err: Unable to initialize SPDK env\n"); return 1;