linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Sreenath Vijayan <sreenath.vijayan@sony.com>,
	pmladek@suse.com, corbet@lwn.net, gregkh@linuxfoundation.org,
	jirislaby@kernel.org
Cc: rdunlap@infradead.org, rostedt@goodmis.org,
	senozhatsky@chromium.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	taichi.shimoyashiki@sony.com, daniel.palmer@sony.com,
	anandakumar.balasubramaniam@sony.com, sreenath.vijayan@sony.com
Subject: Re: [PATCH v5 2/2] tty/sysrq: Replay kernel log messages on consoles via sysrq
Date: Thu, 07 Mar 2024 15:06:17 +0106	[thread overview]
Message-ID: <87wmqe87m6.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <bf9829e1b3785aca8b7e2d018fac0935522d00dc.1709277332.git.sreenath.vijayan@sony.com>

On 2024-03-07, Sreenath Vijayan <sreenath.vijayan@sony.com> wrote:
> diff --git a/Documentation/admin-guide/sysrq.rst b/Documentation/admin-guide/sysrq.rst
> index 2f2e5bd440f9..8098a1b4908d 100644
> --- a/Documentation/admin-guide/sysrq.rst
> +++ b/Documentation/admin-guide/sysrq.rst
> @@ -161,6 +161,8 @@ Command	    Function
>              will be printed to your console. (``0``, for example would make
>              it so that only emergency messages like PANICs or OOPSes would
>              make it to your console.)
> +
> +``R``	    Replay the kernel log messages on consoles.
>  =========== ===================================================================
>  
>  Okay, so what can I use them for?
> @@ -211,6 +213,12 @@ processes.
>  "just thaw ``it(j)``" is useful if your system becomes unresponsive due to a
>  frozen (probably root) filesystem via the FIFREEZE ioctl.
>  
> +``Replay logs(R)`` is useful to view the kernel log messages when system is hung
> +or you are not able to use dmesg command to view the messages in printk buffer.
> +User may have to press the key combination multiple times if console system is
> +busy. If it is completely locked up, then messages won't be printed. Output
> +messages depend on current console loglevel.
> +

I recommend including a reference to SysRq [0-9] about changing the
loglevel.

>  Sometimes SysRq seems to get 'stuck' after using it, what can I do?
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  
> diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
> index 02217e3c916b..c4deea41a8b5 100644
> --- a/drivers/tty/sysrq.c
> +++ b/drivers/tty/sysrq.c
> @@ -450,6 +450,17 @@ static const struct sysrq_key_op sysrq_unrt_op = {
>  	.enable_mask	= SYSRQ_ENABLE_RTNICE,
>  };
>  
> +static void sysrq_handle_replay_logs(u8 key)
> +{
> +	console_replay_all();
> +}
> +static struct sysrq_key_op sysrq_replay_logs_op = {
> +	.handler        = sysrq_handle_replay_logs,
> +	.help_msg       = "replay-kernel-logs(R)",
> +	.action_msg     = "replay kernel logs on consoles",

If I do:

$ grep '\.action_msg' drivers/tty/sysrq.c

This is the only action message that begins lowercase. Please start with
a capital letter for consistency.

With the change to the action message:

Reviewed-by: John Ogness <john.ogness@linutronix.de>

      reply	other threads:[~2024-03-07 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 12:49 [PATCH v5 0/2] Add support to replay kernel log on console via sysrq Sreenath Vijayan
2024-03-07 12:55 ` [PATCH v5 1/2] printk: Add function to replay kernel log on consoles Sreenath Vijayan
2024-03-07 13:53   ` John Ogness
2024-03-07 12:59 ` [PATCH v5 2/2] tty/sysrq: Replay kernel log messages on consoles via sysrq Sreenath Vijayan
2024-03-07 14:00   ` John Ogness [this message]

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=87wmqe87m6.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=anandakumar.balasubramaniam@sony.com \
    --cc=corbet@lwn.net \
    --cc=daniel.palmer@sony.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rdunlap@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=sreenath.vijayan@sony.com \
    --cc=taichi.shimoyashiki@sony.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).