[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZdxFcP2UkocRXbm_@sony.com>
Date: Mon, 26 Feb 2024 13:31:52 +0530
From: Sreenath Vijayan <sreenath.vijayan@...y.com>
To: Petr Mladek <pmladek@...e.com>
Cc: john.ogness@...utronix.de, corbet@....net, gregkh@...uxfoundation.org,
jirislaby@...nel.org, rdunlap@...radead.org, rostedt@...dmis.org,
senozhatsky@...omium.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
taichi.shimoyashiki@...y.com, daniel.palmer@...y.com,
anandakumar.balasubramaniam@...y.com
Subject: Re: [PATCH v4 2/2] tty/sysrq: Dump printk ring buffer messages via
sysrq
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
Powered by blists - more mailing lists