[dpdk-dev,1/6] eal: fix default log level

Message ID 20170418142225.6308-1-olivier.matz@6wind.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Olivier Matz April 18, 2017, 2:22 p.m. UTC
  The initialization of the default log level (from configuration) was
removed by mistake in a previous commit. The global log level was
wrongly set to debug when no --log-level argument was passed. Restore
this initialization.

Before:
  $ ./build/app/test
  RTE>>dump_log_types
  global log level is debug
  ...

After:
  $ ./build/app/test
  RTE>>dump_log_types
  global log level is info
  ...

Fixes: 845afe51e428 ("eal: change specific log levels at startup")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_eal/bsdapp/eal/eal.c   | 1 +
 lib/librte_eal/linuxapp/eal/eal.c | 1 +
 2 files changed, 2 insertions(+)
  

Comments

Ferruh Yigit April 18, 2017, 3:29 p.m. UTC | #1
On 4/18/2017 3:22 PM, Olivier Matz wrote:
> The initialization of the default log level (from configuration) was
> removed by mistake in a previous commit. The global log level was
> wrongly set to debug when no --log-level argument was passed. Restore
> this initialization.
> 
> Before:
>   $ ./build/app/test
>   RTE>>dump_log_types
>   global log level is debug
>   ...
> 
> After:
>   $ ./build/app/test
>   RTE>>dump_log_types
>   global log level is info
>   ...
> 
> Fixes: 845afe51e428 ("eal: change specific log levels at startup")
> 
> Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Series Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Thomas Monjalon April 19, 2017, 11:31 p.m. UTC | #2
18/04/2017 17:29, Ferruh Yigit:
> On 4/18/2017 3:22 PM, Olivier Matz wrote:
> > The initialization of the default log level (from configuration) was
> > removed by mistake in a previous commit. The global log level was
> > wrongly set to debug when no --log-level argument was passed. Restore
> > this initialization.
> > 
> > Before:
> >   $ ./build/app/test
> >   RTE>>dump_log_types
> >   global log level is debug
> >   ...
> > 
> > After:
> >   $ ./build/app/test
> >   RTE>>dump_log_types
> >   global log level is info
> >   ...
> > 
> > Fixes: 845afe51e428 ("eal: change specific log levels at startup")
> > 
> > Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> 
> Series Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Series Applied, thanks
  

Patch

diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 3b66da6cd..db154db9a 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -324,6 +324,7 @@  eal_log_level_parse(int argc, char **argv)
 	optreset = 1;
 
 	eal_reset_internal_config(&internal_config);
+	rte_log_set_global_level(internal_config.log_level);
 
 	while ((opt = getopt_long(argc, argvopt, eal_short_options,
 				  eal_long_options, &option_index)) != EOF) {
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index f3fbeb9c7..b2758799c 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -493,6 +493,7 @@  eal_log_level_parse(int argc, char **argv)
 	optind = 1;
 
 	eal_reset_internal_config(&internal_config);
+	rte_log_set_global_level(internal_config.log_level);
 
 	while ((opt = getopt_long(argc, argvopt, eal_short_options,
 				  eal_long_options, &option_index)) != EOF) {