All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] logbuff: Change default console loglevel to 8
@ 2010-05-06 23:48 Peter Tyser
  2010-05-07  9:15 ` Detlev Zundel
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Tyser @ 2010-05-06 23:48 UTC (permalink / raw)
  To: u-boot

Previously, a default of 3 was assigned to the console loglevel while
standard messages had a level of 4.  This resulted in U-Boot's console
disappearing if a user enabled CONFIG_LOGBUFFER but didn't manually set
the 'loglevel' environment variable to a value greater than 4.

Setting the default console loglevel to 8 causes all messages to be
printed to the console, which is standard U-Boot operation.  Users can
then reduce the console loglevel if they want using the 'loglevel'
environment variable.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
 common/cmd_log.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/common/cmd_log.c b/common/cmd_log.c
index 3653fe1..e3ebe96 100644
--- a/common/cmd_log.c
+++ b/common/cmd_log.c
@@ -55,8 +55,12 @@ static int logbuff_printk(const char *line);
 
 static char buf[1024];
 
-/* This combination will not print messages with the default loglevel */
-static unsigned console_loglevel = 3;
+/*
+ * This combination will print all messages to the console by default.  A user
+ * can reduce the console_loglevel via the "loglevel" environment variable if
+ * needed.
+ */
+static unsigned console_loglevel = 8;
 static unsigned default_message_loglevel = 4;
 static unsigned log_version = 1;
 #ifdef CONFIG_ALT_LB_ADDR
-- 
1.6.2.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] logbuff: Change default console loglevel to 8
  2010-05-06 23:48 [U-Boot] [PATCH] logbuff: Change default console loglevel to 8 Peter Tyser
@ 2010-05-07  9:15 ` Detlev Zundel
  2010-05-07 17:57   ` Peter Tyser
  0 siblings, 1 reply; 3+ messages in thread
From: Detlev Zundel @ 2010-05-07  9:15 UTC (permalink / raw)
  To: u-boot

Hi Peter,

> Previously, a default of 3 was assigned to the console loglevel while
> standard messages had a level of 4.  This resulted in U-Boot's console
> disappearing if a user enabled CONFIG_LOGBUFFER but didn't manually set
> the 'loglevel' environment variable to a value greater than 4.
>
> Setting the default console loglevel to 8 causes all messages to be
> printed to the console, which is standard U-Boot operation.  Users can
> then reduce the console loglevel if they want using the 'loglevel'
> environment variable.

I don't really like that patch as I think it will alter how U-Boot
"looks" (i.e. what it outputs) on e.g. the lwmon5 board where the
logbuffer is used primarily for logging POST results.

Can you please explain to me again, why the messages are not output any
more once CONFIG_LOGBUFFER is enabled?  If 'stdout' is serial (and I
don't see why this should not be the case) then is there already a
problem?

Cheers
  Detlev

-- 
X-Windows has to be the most expensive way ever of popping up an Emacs
window.
                                          -- The UNIX Haters Handbook
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] logbuff: Change default console loglevel to 8
  2010-05-07  9:15 ` Detlev Zundel
@ 2010-05-07 17:57   ` Peter Tyser
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Tyser @ 2010-05-07 17:57 UTC (permalink / raw)
  To: u-boot

H Detlev,

> > Previously, a default of 3 was assigned to the console loglevel while
> > standard messages had a level of 4.  This resulted in U-Boot's console
> > disappearing if a user enabled CONFIG_LOGBUFFER but didn't manually set
> > the 'loglevel' environment variable to a value greater than 4.
> >
> > Setting the default console loglevel to 8 causes all messages to be
> > printed to the console, which is standard U-Boot operation.  Users can
> > then reduce the console loglevel if they want using the 'loglevel'
> > environment variable.
> 
> I don't really like that patch as I think it will alter how U-Boot
> "looks" (i.e. what it outputs) on e.g. the lwmon5 board where the
> logbuffer is used primarily for logging POST results.
> 
> Can you please explain to me again, why the messages are not output any
> more once CONFIG_LOGBUFFER is enabled?  If 'stdout' is serial (and I
> don't see why this should not be the case) then is there already a
> problem?

I'll step through the process I used to try out CONFIG_LOGBUFFER:
1. Take an board that has a u-boot image on it without logbuff support,
without CONFIG_SYS_CONSOLE_IS_IN_ENV defined, or any of the logbuff
environment variables defined.

2. Build an image for the same board, this time with CONFIG_LOGBUFFER
enabled.

3. Program and boot the new logbuff-enabled image and you'll see
something like the following on the serial console:
...
FLASH: 128 MiB
L2:    512 KB already enabled
NAND:  512 MiB

    PCI1: 64 bit PCI, >= 66 MHz, agent, external-arbiter
    PCI1 on bus 00 - 00
<no more output past this point>


This is because most of U-Boot's output is printed with a message
loglevel of 4, but the default console loglevel was 3.  When the message
loglevel is greater than or equal to the console loglevel, the serial
output is discarded (see line 317 in common/cmd_log.c).

So having a default console loglevel of 3 results in the vast majority
of U-Boot's output being discarded (only after the GD_FLG_DEVINIT is set
in gd->flags, prior to that all output is sent to the serial port).
Thus a user is never presented with a U-Boot prompt and can't interact
with the board.  The board is in essence bricked until it can be
reprogrammed.

Setting the default console loglevel to 8 ensures that by default all
messages will be displayed on the console.  This seems like a more sane
default and the user can decrease the loglevel via the 'loglevel'
environment variable if they need.

I'm not intimately familiar with the logging features, so let me know if
I'm missing something.

Best,
Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-07 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-06 23:48 [U-Boot] [PATCH] logbuff: Change default console loglevel to 8 Peter Tyser
2010-05-07  9:15 ` Detlev Zundel
2010-05-07 17:57   ` Peter Tyser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.