X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Flinuxapp%2Feal%2Feal.c;h=33e10672cae16a20e9fe93bfffae8bdf39858760;hb=bd734cf778228233f62620efab0949df0ac0ed13;hp=16f9e7c0edcf4a7f7373db8939237509ab600a5c;hpb=8baacdd30e5553ce6e0c84a0a3e09d8636386503;p=dpdk.git diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 16f9e7c0ed..33e10672ca 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -76,7 +75,6 @@ #include #include #include -#include #include "eal_private.h" #include "eal_thread.h" @@ -500,6 +498,38 @@ eal_get_hugepage_mem_size(void) return (size < SIZE_MAX) ? (size_t)(size) : SIZE_MAX; } +/* Parse the arguments for --log-level only */ +static void +eal_log_level_parse(int argc, char **argv) +{ + int opt; + char **argvopt; + int option_index; + + argvopt = argv; + + eal_reset_internal_config(&internal_config); + + while ((opt = getopt_long(argc, argvopt, eal_short_options, + eal_long_options, &option_index)) != EOF) { + + int ret; + + /* getopt is not happy, stop right now */ + if (opt == '?') + break; + + ret = (opt == OPT_LOG_LEVEL_NUM) ? + eal_parse_common_option(opt, optarg, &internal_config) : 0; + + /* common parser is not happy */ + if (ret < 0) + break; + } + + optind = 0; /* reset getopt lib */ +} + /* Parse the argument given in the command line of the application */ static int eal_parse_args(int argc, char **argv) @@ -512,8 +542,6 @@ eal_parse_args(int argc, char **argv) argvopt = argv; - eal_reset_internal_config(&internal_config); - while ((opt = getopt_long(argc, argvopt, eal_short_options, eal_long_options, &option_index)) != EOF) { @@ -718,6 +746,11 @@ rte_eal_init(int argc, char **argv) if (rte_eal_log_early_init() < 0) rte_panic("Cannot init early logs\n"); + eal_log_level_parse(argc, argv); + + /* set log level as early as possible */ + rte_set_log_level(internal_config.log_level); + if (rte_eal_cpu_init() < 0) rte_panic("Cannot detect lcores\n"); @@ -725,9 +758,6 @@ rte_eal_init(int argc, char **argv) if (fctret < 0) exit(1); - /* set log level as early as possible */ - rte_set_log_level(internal_config.log_level); - if (internal_config.no_hugetlbfs == 0 && internal_config.process_type != RTE_PROC_SECONDARY && internal_config.xen_dom0_support == 0 && @@ -798,7 +828,7 @@ rte_eal_init(int argc, char **argv) rte_eal_mcfg_complete(); TAILQ_FOREACH(solib, &solib_list, next) { - RTE_LOG(INFO, EAL, "open shared lib %s\n", solib->name); + RTE_LOG(DEBUG, EAL, "open shared lib %s\n", solib->name); solib->lib_handle = dlopen(solib->name, RTLD_NOW); if (solib->lib_handle == NULL) RTE_LOG(WARNING, EAL, "%s\n", dlerror()); @@ -853,13 +883,13 @@ rte_eal_init(int argc, char **argv) enum rte_lcore_role_t rte_eal_lcore_role(unsigned lcore_id) { - return (rte_config.lcore_role[lcore_id]); + return rte_config.lcore_role[lcore_id]; } enum rte_proc_type_t rte_eal_process_type(void) { - return (rte_config.process_type); + return rte_config.process_type; } int rte_eal_has_hugepages(void)