From: Sreenath Vijayan <sreenath.vijayan@sony.com>
To: Petr Mladek <pmladek@suse.com>
Cc: john.ogness@linutronix.de, corbet@lwn.net,
gregkh@linuxfoundation.org, jirislaby@kernel.org,
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
Subject: Re: [PATCH v4 2/2] tty/sysrq: Dump printk ring buffer messages via sysrq
Date: Mon, 26 Feb 2024 13:31:52 +0530 [thread overview]
Message-ID: <ZdxFcP2UkocRXbm_@sony.com> (raw)
In-Reply-To: <ZcygJOj9TaHZUKd-@sony.com>
On Wed, Feb 14, 2024 at 04:42:36PM +0530, Sreenath Vijayan wrote:
> On Wed, Feb 07, 2024 at 04:09:34PM +0100, Petr Mladek wrote:
> > Idea:
> >
> > Using console_trylock() actually might be more reliable than
> > workqueues. console_trylock() might fail repeatably when:
> >
> > + the console_lock() owner is stuck. But workqueues would fail
> > in this case as well.
> >
> > + there is a flood of messages. In this case, replaying
> > the log would not help much.
> >
> > Another advantage is that the consoles would be flushed
> > in sysrq context with the manipulated console_loglevel.
> >
> > Best Regards,
> > Petr
>
> Yes, this seems to work well from interrupt context when the
> console lock owner is not stuck. We can also manipulate
> the console_loglevel. Something like this:
>
> //in printk.c
> void console_replay_all(void)
> {
> if (console_trylock()) {
> __console_rewind_all();
> console_unlock();
> }
> }
>
> //in sysrq.c
> static void sysrq_handle_dmesg_dump(u8 key)
> {
> int orig_log_level = console_loglevel;
> console_loglevel = CONSOLE_LOGLEVEL_DEFAULT;
> console_replay_all();
> console_loglevel = orig_log_level;
> }
>
>
> The downside I see is that the user may have to hit the
> key multiple times or give up trying if the console lock
> owner is busy at the time of key press. This information
> should probably be updated in the documentation.
>
> Please let me know your opinion.
>
> Regards,
> Sreenath
Hi,
Kindly let me know your opinion on the suggested changes.
Regards,
Sreenath
next prev parent reply other threads:[~2024-02-26 8:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 10:16 [PATCH v4 0/2] Add support to dump printk buffer to console via sysrq Sreenath Vijayan
2024-02-01 10:23 ` [PATCH v4 1/2] printk: Add function to dump printk buffer directly to consoles Sreenath Vijayan
2024-02-01 11:28 ` John Ogness
2024-02-07 14:43 ` Petr Mladek
2024-02-14 10:33 ` Sreenath Vijayan
2024-02-01 10:29 ` [PATCH v4 2/2] tty/sysrq: Dump printk ring buffer messages via sysrq Sreenath Vijayan
2024-02-01 11:29 ` John Ogness
2024-02-07 15:09 ` Petr Mladek
2024-02-08 10:18 ` Greg KH
2024-02-08 13:39 ` John Ogness
2024-02-14 10:40 ` Sreenath Vijayan
2024-02-14 11:12 ` Sreenath Vijayan
2024-02-26 8:01 ` Sreenath Vijayan [this message]
2024-02-26 9:28 ` John Ogness
2024-02-07 14:12 ` [PATCH v4 0/2] Add support to dump printk buffer to console " Petr Mladek
2024-02-14 10:30 ` Sreenath Vijayan
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=ZdxFcP2UkocRXbm_@sony.com \
--to=sreenath.vijayan@sony.com \
--cc=anandakumar.balasubramaniam@sony.com \
--cc=corbet@lwn.net \
--cc=daniel.palmer@sony.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=john.ogness@linutronix.de \
--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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.