From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: David VomLehn <dvomlehn@cisco.com>
Cc: linux-embedded@vger.kernel.org, akpm@linux-foundation.org,
dwm2@infradead.org, linux-kernel@vger.kernel.org,
mpm@selenic.com
Subject: Re: [PATCH, RFC] panic-note: Annotation from user space for panics
Date: Thu, 12 Nov 2009 14:50:41 -0500 [thread overview]
Message-ID: <4AFC6711.1090405@windriver.com> (raw)
In-Reply-To: <20091112021322.GA6166@dvomlehn-lnx2.corp.sa.net>
David VomLehn wrote:
> Allows annotation of panics to include platform information. It's no big
> deal to collect information, but way helpful when you are collecting
> failure reports from a eventual base of millions of systems deployed in
> other people's homes.
>
> One of the biggest reasons this is an RFC is that I'm uncomfortable with
> putting the pseudo-file that holds the annotation information in /proc.
> Different layers of the software stack may drop dynamic information, such
> as DHCP-supplied IP addresses, in here as they come up. This means it's
> necessary to be able to append to the end of the annotation, so this looks
> much more like a real file than a sysctl file. It also has multiple lines,
> which doesn't look a sysctl file. Annotation can be viewed as a debug thing,
> so maybe it belongs in debugfs, but people seem to be doing somewhat different
> things with that filesystem.
>
> So, suggestions on this issue, and any others are most welcome. If there a
> better way to do this, I'll be happy to use it.
>
> Signed-off-by: David VomLehn <dvomlehn@cisco.com>
> ---
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -70,6 +70,7 @@ NORET_TYPE void panic(const char * fmt, ...)
> vsnprintf(buf, sizeof(buf), fmt, args);
> va_end(args);
> printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
> + panic_note_print();
> #ifdef CONFIG_DEBUG_BUGVERBOSE
> dump_stack();
> #endif
Why hook into panic() directly like this, vs. using the panic
notifier list? If you use that, and then put the data handling
magic that you need into your own kernel module that knows how
to interface with the reporting apps that you have, you can
do the whole thing without having to alter existing code, I think.
Paul.
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 30df586..bade7a1 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -1045,6 +1045,14 @@ config DMA_API_DEBUG
> This option causes a performance degredation. Use only if you want
> to debug device drivers. If unsure, say N.
>
> +config PANIC_NOTE
> + bool "Create file for user space data to be reported at panic time"
> + default n
> + help
> + This creates a pseudo-file, named /proc/panic_note, into which
> + user space data can be written. If a panic occurs, the contents
> + of the file will be included in the failure report.
> +
> source "samples/Kconfig"
>
> source "lib/Kconfig.kgdb"
next prev parent reply other threads:[~2009-11-12 19:50 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
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 [this message]
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=4AFC6711.1090405@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=akpm@linux-foundation.org \
--cc=dvomlehn@cisco.com \
--cc=dwm2@infradead.org \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
/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).