public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marco Stornelli <marco.stornelli@gmail.com>
To: dedekind1@gmail.com
Cc: Simon Kagstrom <simon.kagstrom@netinsight.net>,
	David VomLehn <dvomlehn@cisco.com>,
	linux-embedded@vger.kernel.org, akpm@linux-foundation.org,
	dwm2@infradead.org, linux-kernel@vger.kernel.org,
	mpm@selenic.com, paul.gortmaker@windriver.com
Subject: Re: [PATCH, RFC] panic-note: Annotation from user space for panics
Date: Sat, 14 Nov 2009 09:28:04 +0100	[thread overview]
Message-ID: <4AFE6A14.4010507@gmail.com> (raw)
In-Reply-To: <1258112748.21596.1227.camel@localhost>

I think in general the procedure should be: at startup or event (for
example acquired IP address from DHCP) user applications write in flash
(better in persistent ram) a log with a tag or a timestamp or something
like this, when there is a kernel panic, it is captured in a file stored
together the log and when possible the system should send all via
network for example. Are there problems that I can't see to follow this
approach? When David says "...so this looks much more like a real file
than a sysctl file" I quite agree, it seems a normal application/system
log indeed.

Marco

Artem Bityutskiy wrote:
> On Fri, 2009-11-13 at 09:10 +0100, Simon Kagstrom wrote:
>> On Thu, 12 Nov 2009 16:56:49 -0500
>> David VomLehn <dvomlehn@cisco.com> wrote:
>>
>>> Good question. Some more detail on our application might help. In some
>>> situations, we may have no disk and only enough flash for the bootloader.
>>> The kernel is downloaded over the network. When we get to user space, we
>>> initialize a number of things dynamically. For example, we dynamically
>>> compute some MAC address, and most of the IP addresses are obtained with
>>> DHCP. This are very useful to have for panic analysis.
>>>
>>> Since there is neither flash nor disk, user space has no place to store
>>> this information, should the kernel panic. When we come back up, we will get
>>> different MAC and IP addresses. Storing them in memory is our only hope.
>>>
>>> Fortunately, there is a section of RAM that the bootloader promises not
>>> to overwrite. On a panic, we capture the messages written on the console
>>> and store them in the protected area. If the information from the
>>> /proc file is written as part of the panic, we will capture it, too.
>> Can't you solve this completely from userspace using phram and mtdoops
>> instead? I.e., setup two phram areas
>>
>> 	modprobe phram 4K@start-of-your-area,4K@start-of-your-area+4K    # Can't remember the exact syntax!
>>
>> you'll then get /dev/mtdX and /dev/mtdX+1 for these two. You can then do
>>
>> 	modprobe mtdoops mtddev=/dev/mtdX+1 dump_oops=0
>>
>> to load mtdoops to catch the panic in the second area, and just write
>> your userspace messages to /dev/mtdX.
> 
> This might work for them, not sure, but not for us. We store panics on
> flash, and later they are automatically sent to the panic collection
> system via the network. And the complications are:
> 
> 1. There may be many panics before the device has network access and has
> a chance to send the panics.
> 2. User can re-flash the device with different SW inbetween.
> 
> So we really need to print some user-space supplied information during
> the panic, and then we store it on flash with mtdoops, and the later,
> when the device has network access we send whole bunch of oopses via the
> network.
> 
>> One thing probably have to be fixed though: I don't think phram has a
>> panic_write, which will be needed by mtdoops to catch the panic - this
>> should be trivial to add though since it's plain RAM.
> 

  parent reply	other threads:[~2009-11-14  8:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12  2:13 [PATCH, RFC] panic-note: Annotation from user space for panics David VomLehn
2009-11-12 18:00 ` Marco Stornelli
2009-11-12 21:56   ` David VomLehn
2009-11-13  8:10     ` Simon Kagstrom
2009-11-13 11:45       ` Artem Bityutskiy
2009-11-13 11:59         ` Simon Kagstrom
2009-11-13 14:16           ` Artem Bityutskiy
2009-11-14  8:28         ` Marco Stornelli [this message]
2009-11-17  8:53           ` Artem Bityutskiy
2009-11-17 12:45             ` Marco Stornelli
2009-11-17 13:10               ` Artem Bityutskiy
2009-11-17 15:45                 ` Eric W. Biederman
2009-11-17 23:56                   ` David VomLehn
2009-11-18  0:28                     ` Eric W. Biederman
2009-11-18  0:53                       ` David VomLehn
2009-11-18  9:01                         ` Américo Wang
2009-11-18 17:01                         ` Eric W. Biederman
2009-11-18  0:56                       ` Matt Mackall
2009-11-18 16:07                         ` Eric W. Biederman
2009-11-18 17:52                           ` Tim Bird
2009-11-18 18:16                             ` Eric W. Biederman
2009-11-18  8:26                   ` Artem Bityutskiy
2009-11-17 17:53                 ` Marco Stornelli
2009-11-12 18:06 ` Matt Mackall
2009-11-12 21:58   ` David VomLehn
2009-11-13 11:35   ` Artem Bityutskiy
2009-11-12 19:50 ` Paul Gortmaker
2009-11-12 22:09   ` David VomLehn
2009-11-13 11:50     ` Shargorodsky Atal (EXT-Teleca/Helsinki)
2009-11-13 11:26 ` Artem Bityutskiy
2009-11-17  9:03 ` Artem Bityutskiy

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=4AFE6A14.4010507@gmail.com \
    --to=marco.stornelli@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dedekind1@gmail.com \
    --cc=dvomlehn@cisco.com \
    --cc=dwm2@infradead.org \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=simon.kagstrom@netinsight.net \
    /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