linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Getz <rgetz@blackfin.uclinux.org>
To: David VomLehn <dvomlehn@cisco.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>,
	Greg Ungerer <gerg@snapgear.com>,
	Russell King <rmk@arm.linux.org.uk>,
	Paul Mundt <lethal@linux-sh.org>, Tim Bird <tim.bird@am.sony.com>,
	Wolfgang Denk <wd@denx.de>,
	Grant Erickson <gerickson@nuovations.com>,
	linux-embedded <linux-embedded@vger.kernel.org>
Subject: Re: Kernel crashing and log buffers...
Date: Fri, 12 Jun 2009 00:54:46 -0400	[thread overview]
Message-ID: <200906120054.46965.rgetz@blackfin.uclinux.org> (raw)
In-Reply-To: <20090612010707.GB23715@cuplxvomd02.corp.sa.net>

On Thu 11 Jun 2009 21:07, David VomLehn pondered:
> It may be helpful if you can say a bit more about
> the problem you are trying to solve.

Yeah, I guess defining the goals is a good place to start (and 
the hardest to come to agreement on).

 - early crash analysis - before the kernel has set up the console 
   or console drivers, (which happens after interrupts, caches, & 
   memory, are set up) crashes are pretty difficult to figure out. 
   Typically - the kernel crashes or hangs without any output on 
   the console.
   What the end users experiences is typically...
   "Starting Kernel at = xxxx"
   and nothing else. The valuable info (if any) is stuck in the 
   kernel's log buffer.

   earlyprintk helps with this, however - this assumes that the 
   kernel has set up the early_printk console properly. If there
   is a problem doing that (wrong driver compiled in, wrong pin 
   muxing, etc), then the info is still stuck (unseen) in the
   kernel's log buffer.

   - but is only to be supported on:
   Documentation/kernel-parameters.txt
       earlyprintk=    [X86-32,X86-64,SH,BLACKFIN]
                        earlyprintk=vga
                        earlyprintk=serial[,ttySn[,baudrate]]
                        earlyprintk=dbgp

   see:
   arch/x86/kernel/early_printk.c
   arch/sh/kernel/early_printk.c
   arch/blackfin/kernel/early_printk.c

   For giggles - put a panic() in your arch/*/kernel/setup.c:setup_arch()
   With earlyprintk - you still get to see what happened (if the 
   earlyprintk console is working OK).

   Problem:
    Even with earlyprintk - there are times when things not getting
    out of the system, and are stuck in the printk __log_buf.

   David's patch might help with this - as architectures could register, 
   and write all the prink data into a buffer in memory - where it could
   be read out by the bootloader, or future kernels - but it would need
   some tweaks to support early functionality (but I don't think much).

 - late crash analysis - Sometimes - even after the kernel is up
   and running properly - a device driver does a bad thing. 
   Normally - complete kernel dumps can come out a serial
   console, and you can you your favourite serial application
   to scroll back and determine what is going on.

   In many embedded devices - this is not a possibility, since
   all the serial ports are in use (Irda, Bluetooth, GPS, etc).

   In devices that are deployed in the field - this is not a
   possibility, since nothing is connected to the serial 
   console (if it exists) for logging.

   Even when there is no console device, or anything attached to the
   console device, everything is in the __log_buf.

   Problem:
   There doesn't appear (to me) to be anything in mainline to help 
   with this.

   David's patch might help with this - as architectures could register, 
   and write all the prink data into a buffer in memory - where it could
   be read out by the bootloader, or future kernels.

 - allowing board startup information (POST) created/output from
   the boot loader to be transfered to the standard/normal kernel
   log processing features (syslog/dmesg/etc).

   There doesn't appear (to me) to be anything in mainline to help 
   with this.
 
   David's patch could help with this - as architectures could register, 
   and if a magic number was in the start of the buffer, it could just
   strnlen the buffer, and then do a printk on it. The downside is it would
   not be at the start of the buffer - as Grant's and Wolfgang's suggestion.
   But I'm not sure this is a requirement???


Is there anything I'm missing?

  reply	other threads:[~2009-06-12  4:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-11  1:26 Kernel crashing and log buffers Robin Getz
2009-06-11 17:53 ` David VomLehn
2009-06-11 18:22   ` Tim Bird
2009-06-11 22:46     ` David VomLehn
2009-06-11 18:52   ` Robin Getz
2009-06-11 19:35     ` David VomLehn
2009-06-11 22:57     ` Grant Erickson
2009-06-12  0:33       ` David VomLehn
2009-06-12  5:33         ` Wolfgang Denk
2009-06-11 23:27   ` Mike Frysinger
2009-06-12  1:07     ` David VomLehn
2009-06-12  4:54       ` Robin Getz [this message]
2009-06-13 16:49         ` Jamie Lokier
2009-06-26 14:39   ` Robin Getz
2009-06-26 17:42     ` David VomLehn
2009-06-26 17:50       ` Mike Frysinger
2009-06-26 17:59       ` Robin Getz
2009-06-13 10:26 ` Russell King
2009-06-13 18:59   ` Wolfgang Denk
2009-06-14 18:33     ` Robin Getz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200906120054.46965.rgetz@blackfin.uclinux.org \
    --to=rgetz@blackfin.uclinux.org \
    --cc=dvomlehn@cisco.com \
    --cc=gerg@snapgear.com \
    --cc=gerickson@nuovations.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-embedded@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=tim.bird@am.sony.com \
    --cc=vapier.adi@gmail.com \
    --cc=wd@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).