public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Crutcher Dunnavant <crutcher+kernel@datastacks.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: sysrq loglevel
Date: Wed, 7 Jan 2009 12:37:58 +0000	[thread overview]
Message-ID: <20090107123725.GC2520@shadowen.org> (raw)

It seems that we deliberatly manage the console_loglevel while handling a
sysrq request.  Raising it to 7 to emit the sysrq command header, and then
lower it before processing the command itself.  When booting the kernel
'quiet' this means that we only see the header of the command and not its
output on the console, the whole thing is in dmesg and thereby in syslog
(if it is working).

void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
[...]
        console_loglevel = 7;
        printk(KERN_INFO "SysRq : ");
[...]
                        printk("%s\n", op_p->action_msg);
                        console_loglevel = orig_log_level;
                        op_p->handler(key, tty);
[...]

Is this intentional?  I can see arguments both ways.  One way to look at
it would be that I asked for the output so I should get it regardless.
The other side might be that consoles can be really slow (serial or
something) and so only outputting it there if logging is enabled
generally is sane.

Obviously we can work round this at the moment using sysrq-7 to up the
loglevel before the command and sysrq-4 after to restore quiet.

What do people think.  If we are happy with the status quo then I will
spin a documentation patch to point out this behaviour and the work
around.  Else I will happily spin a patch to fix it.

Thoughts?

-apw

             reply	other threads:[~2009-01-07 12:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 12:37 Andy Whitcroft [this message]
2009-01-07 19:25 ` sysrq loglevel Andrew Morton
2009-01-07 20:50   ` Andy Whitcroft
2009-01-07 21:49     ` [PATCH 0/3] document sysrq interaction with loglevels Andy Whitcroft
2009-01-07 21:49       ` [PATCH 1/3] sysrq documentation: remove the redundant updated date Andy Whitcroft
2009-01-07 21:49       ` [PATCH 2/3] sysrq documentation: document why the command header only is shown Andy Whitcroft
2009-01-07 23:30         ` Randy Dunlap
2009-01-07 21:49       ` [PATCH 3/3] sysrq: add commentary on why we use the console loglevel over using KERN_EMERG Andy Whitcroft
2009-01-08  8:44         ` Nick Andrew
2009-01-08  2:10     ` [PATCH 0/3] document sysrq interaction with loglevels V2 Andy Whitcroft
2009-01-08  2:10       ` [PATCH 1/3] sysrq documentation: remove the redundant updated date Andy Whitcroft
2009-01-08  2:10       ` [PATCH 2/3] sysrq documentation: document why the command header only is shown Andy Whitcroft
2009-01-08  2:10       ` [PATCH 3/3] sysrq: add commentary on why we use the console loglevel over using KERN_EMERG Andy Whitcroft

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=20090107123725.GC2520@shadowen.org \
    --to=apw@canonical.com \
    --cc=akpm@linux-foundation.org \
    --cc=crutcher+kernel@datastacks.com \
    --cc=linux-kernel@vger.kernel.org \
    /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