lkml.org 
[lkml]   [2010]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 18/23] sys-rq: Add option to soft dump
On Mon, 08 Nov 2010 12:33:23 -0800 Mike Waychison wrote:

> It is very useful to provide some means to force the kernel logs to make it out
> via the kmsg_oops implementations on the console. Add a new option 'Y' to
> sysrq to allow dumping of logs to kmsg_dumper drivers.
>
> Signed-off-by: Mike Waychison <mikew@google.com>

Hi,

Please add 'y' to Documentation/sysrq.txt .

> ---
> drivers/char/sysrq.c | 14 +++++++++++++-
> 1 files changed, 13 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
> index eaa5d3e..058d3c8 100644
> --- a/drivers/char/sysrq.c
> +++ b/drivers/char/sysrq.c
> @@ -41,6 +41,7 @@
> #include <linux/oom.h>
> #include <linux/slab.h>
> #include <linux/input.h>
> +#include <linux/kmsg_dump.h>
>
> #include <asm/ptrace.h>
> #include <asm/irq_regs.h>
> @@ -395,6 +396,17 @@ static struct sysrq_key_op sysrq_unrt_op = {
> .enable_mask = SYSRQ_ENABLE_RTNICE,
> };
>
> +static void sysrq_handle_softdump(int key)
> +{
> + kmsg_dump(KMSG_DUMP_SOFT, NULL);
> +}
> +static struct sysrq_key_op sysrq_softdump_op = {
> + .handler = sysrq_handle_softdump,
> + .help_msg = "soft-dump(Y)",
> + .action_msg = "Trigger a soft dump",
> + .enable_mask = SYSRQ_ENABLE_DUMP,
> +};
> +
> /* Key Operations table and lock */
> static DEFINE_SPINLOCK(sysrq_key_table_lock);
>
> @@ -451,7 +463,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
> /* x: May be registered on ppc/powerpc for xmon */
> NULL, /* x */
> /* y: May be registered on sparc64 for global register dump */
> - NULL, /* y */
> + &sysrq_softdump_op, /* y */
> &sysrq_ftrace_dump_op, /* z */
> };


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***


\
 
 \ /
  Last update: 2010-11-08 22:13    [W:0.130 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site