Patchwork Maximum/default console log level for kconfig

login
register
about
Submitter Uwe Hermann
Date 2009-10-10 15:52:10
Message ID <20091010155210.GD15511@greenwood>
Download mbox | patch
Permalink /patch/385/
State Accepted
Headers show

Comments

Uwe Hermann - 2009-10-10 15:52:10
See patch.


Uwe.
Peter Stuge - 2009-10-11 03:07:04
Uwe Hermann wrote:
> Make console maximum/default log level a choice option.
> 
> Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
> 
> Index: src/console/Kconfig
> ===================================================================
> --- src/console/Kconfig	(Revision 4756)
> +++ src/console/Kconfig	(Arbeitskopie)
> @@ -78,18 +78,119 @@
>  	help
>  	  If not selected, the last adapter found will be used.
>  
> -# TODO: User-friendly "choice" selection.
> -# TODO: Add help text.
> +choice
> +        prompt "Maximum console log level"
> +        default MAXIMUM_CONSOLE_LOGLEVEL_8

What does this mean? Maybe a help text?


> +config MAXIMUM_CONSOLE_LOGLEVEL_8
> +        bool "8: BIOS_SPEW"

Please remove BIOS_ from all these strings. coreboot isn't a BIOS.
Then it's

Acked-by: Peter Stuge <peter@stuge.se>
Uwe Hermann - 2009-10-11 13:37:46
On Sun, Oct 11, 2009 at 05:07:04AM +0200, Peter Stuge wrote:
> > +choice
> > +        prompt "Maximum console log level"
> > +        default MAXIMUM_CONSOLE_LOGLEVEL_8
> 
> What does this mean? Maybe a help text?

This is how many of the loglevel messages are actually compiled into the
coreboot image, where as "default console log level" says which loglevels
are actually shown on seriali (or USB Debug).

"choice" help texts are not shown in menuconfig, AFAICS. Only the
individual items can have help texts, it seems.


> > +config MAXIMUM_CONSOLE_LOGLEVEL_8
> > +        bool "8: BIOS_SPEW"
> 
> Please remove BIOS_ from all these strings. coreboot isn't a BIOS.

Done.


> Acked-by: Peter Stuge <peter@stuge.se>

Thanks, r4758.


Uwe.
Myles Watson - 2009-10-12 20:09:03
>> > +config MAXIMUM_CONSOLE_LOGLEVEL_8
>> > +        bool "8: BIOS_SPEW"
BIOS_SPEW is 9, not 8.  Could you fix it?

Thanks,
Myles
Uwe Hermann - 2009-10-12 22:17:41
On Mon, Oct 12, 2009 at 02:09:03PM -0600, Myles Watson wrote:
> >> > +config MAXIMUM_CONSOLE_LOGLEVEL_8
> >> > +        bool "8: BIOS_SPEW"
> BIOS_SPEW is 9, not 8.  Could you fix it?

Hm, nope, I think all Config.lb files are wrong here, they should use 8.

From src/include/console/loglevel.h:
#define BIOS_EMERG      0   /* system is unusable                   */
#define BIOS_ALERT      1   /* action must be taken immediately     */
#define BIOS_CRIT       2   /* critical conditions                  */
#define BIOS_ERR        3   /* error conditions                     */
#define BIOS_WARNING    4   /* warning conditions                   */
#define BIOS_NOTICE     5   /* normal but significant condition     */
#define BIOS_INFO       6   /* informational                        */
#define BIOS_DEBUG      7   /* debug-level messages                 */
#define BIOS_SPEW       8   /* Way too many details                 */

Using 9 has the same effect as using 8 I guess.


Uwe.
Marc Jones - 2009-10-12 22:26:58
On Mon, Oct 12, 2009 at 4:17 PM, Uwe Hermann <uwe@hermann-uwe.de> wrote:

> Using 9 has the same effect as using 8 I guess.

I always turn it up to 11! ;)

Marc
Myles Watson - 2009-10-12 22:34:47
On Mon, Oct 12, 2009 at 4:17 PM, Uwe Hermann <uwe@hermann-uwe.de> wrote:
> On Mon, Oct 12, 2009 at 02:09:03PM -0600, Myles Watson wrote:
>> >> > +config MAXIMUM_CONSOLE_LOGLEVEL_8
>> >> > +        bool "8: BIOS_SPEW"
>> BIOS_SPEW is 9, not 8.  Could you fix it?
>
> Hm, nope, I think all Config.lb files are wrong here, they should use 8.
What a pain.  That is where I was looking.

Thanks,
Myles

Patch

Make console maximum/default log level a choice option.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>

Index: src/console/Kconfig
===================================================================
--- src/console/Kconfig	(Revision 4756)
+++ src/console/Kconfig	(Arbeitskopie)
@@ -78,18 +78,119 @@ 
 	help
 	  If not selected, the last adapter found will be used.
 
-# TODO: User-friendly "choice" selection.
-# TODO: Add help text.
+choice
+        prompt "Maximum console log level"
+        default MAXIMUM_CONSOLE_LOGLEVEL_8
+
+config MAXIMUM_CONSOLE_LOGLEVEL_8
+        bool "8: BIOS_SPEW"
+        help
+          Way too many details.
+config MAXIMUM_CONSOLE_LOGLEVEL_7
+        bool "7: BIOS_DEBUG"
+        help
+          Debug-level messages.
+config MAXIMUM_CONSOLE_LOGLEVEL_6
+        bool "6: BIOS_INFO"
+        help
+          Informational messages.
+config MAXIMUM_CONSOLE_LOGLEVEL_5
+        bool "5: BIOS_NOTICE"
+        help
+          Normal but significant conditions.
+config MAXIMUM_CONSOLE_LOGLEVEL_4
+        bool "4: BIOS_WARNING"
+        help
+          Warning conditions.
+config MAXIMUM_CONSOLE_LOGLEVEL_3
+        bool "3: BIOS_ERR"
+        help
+          Error conditions.
+config MAXIMUM_CONSOLE_LOGLEVEL_2
+        bool "2: BIOS_CRIT"
+        help
+          Critical conditions.
+config MAXIMUM_CONSOLE_LOGLEVEL_1
+        bool "1: BIOS_ALERT"
+        help
+          Action must be taken immediately.
+config MAXIMUM_CONSOLE_LOGLEVEL_0
+        bool "0: BIOS_EMERG"
+        help
+          System is unusable.
+
+endchoice
+
 config MAXIMUM_CONSOLE_LOGLEVEL
-	int "Maximum console loglevel"
-	default 9
+	int
+	default 0 if MAXIMUM_CONSOLE_LOGLEVEL_0
+	default 1 if MAXIMUM_CONSOLE_LOGLEVEL_1
+	default 2 if MAXIMUM_CONSOLE_LOGLEVEL_2
+	default 3 if MAXIMUM_CONSOLE_LOGLEVEL_3
+	default 4 if MAXIMUM_CONSOLE_LOGLEVEL_4
+	default 5 if MAXIMUM_CONSOLE_LOGLEVEL_5
+	default 6 if MAXIMUM_CONSOLE_LOGLEVEL_6
+	default 7 if MAXIMUM_CONSOLE_LOGLEVEL_7
+	default 8 if MAXIMUM_CONSOLE_LOGLEVEL_8
+	help
+	  Map the log level config names to an integer.
 
-# TODO: User-friendly "choice" selection.
-# TODO: Add help text.
+choice
+        prompt "Default console log level"
+        default DEFAULT_CONSOLE_LOGLEVEL_8
+
+config DEFAULT_CONSOLE_LOGLEVEL_8
+        bool "8: BIOS_SPEW"
+        help
+          Way too many details.
+config DEFAULT_CONSOLE_LOGLEVEL_7
+        bool "7: BIOS_DEBUG"
+        help
+          Debug-level messages.
+config DEFAULT_CONSOLE_LOGLEVEL_6
+        bool "6: BIOS_INFO"
+        help
+          Informational messages.
+config DEFAULT_CONSOLE_LOGLEVEL_5
+        bool "5: BIOS_NOTICE"
+        help
+          Normal but significant conditions.
+config DEFAULT_CONSOLE_LOGLEVEL_4
+        bool "4: BIOS_WARNING"
+        help
+          Warning conditions.
+config DEFAULT_CONSOLE_LOGLEVEL_3
+        bool "3: BIOS_ERR"
+        help
+          Error conditions.
+config DEFAULT_CONSOLE_LOGLEVEL_2
+        bool "2: BIOS_CRIT"
+        help
+          Critical conditions.
+config DEFAULT_CONSOLE_LOGLEVEL_1
+        bool "1: BIOS_ALERT"
+        help
+          Action must be taken immediately.
+config DEFAULT_CONSOLE_LOGLEVEL_0
+        bool "0: BIOS_EMERG"
+        help
+          System is unusable.
+
+endchoice
+
 config DEFAULT_CONSOLE_LOGLEVEL
-	int "Default console loglevel"
-	default 9
+	int
+	default 0 if DEFAULT_CONSOLE_LOGLEVEL_0
+	default 1 if DEFAULT_CONSOLE_LOGLEVEL_1
+	default 2 if DEFAULT_CONSOLE_LOGLEVEL_2
+	default 3 if DEFAULT_CONSOLE_LOGLEVEL_3
+	default 4 if DEFAULT_CONSOLE_LOGLEVEL_4
+	default 5 if DEFAULT_CONSOLE_LOGLEVEL_5
+	default 6 if DEFAULT_CONSOLE_LOGLEVEL_6
+	default 7 if DEFAULT_CONSOLE_LOGLEVEL_7
+	default 8 if DEFAULT_CONSOLE_LOGLEVEL_8
+	help
+	  Map the log level config names to an integer.
 
 endmenu
 
-