All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Petr Mladek <pmladek@suse.com>, Feng Tang <feng.tang@intel.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	Borislav Petkov <bp@suse.de>,
	ying.huang@intel.com
Subject: Re: [PATCH v2] panic: add an option to replay all the printk message in buffer
Date: Thu, 18 Apr 2019 09:00:14 +0900	[thread overview]
Message-ID: <20190418000014.GA2059@jagdpanzerIV> (raw)
In-Reply-To: <20190417151817.xsun2k7cxff5rknn@shbuild888>

On (04/17/19 23:18), Feng Tang wrote:
> > > +++ b/kernel/printk/printk.c
> > > @@ -2549,6 +2549,14 @@ void console_flush_on_panic(void)
> > >  	 */
> > >  	console_trylock();
> > >  	console_may_schedule = 0;
> > > +	if (flush_mode == CONSOLE_FLUSH_ALL) {
> > > +		/*
> > > +		 * Can be done under logbuf lock, but it's unlikely that
> > > +		 * we will have any race conditions here.
> > > +		 */
> > > +		console_seq = log_first_seq;
> > > +		console_idx = log_first_idx;
> 
> This is very similar to my V1 patch :), excepted I used a bool
> as the parameter.

Yes it is :)

I will reply to Petr's and Feng's email.

> > I agree that it is easier. The cost is that the same messages are
> > printed again without any explanation.
> > 
> > I still think that it would be convenient to write a header line.
> > It would help to understand the log for any, even 3rd-party, reader.
> > Also it would help to find the beginning in a very long log.
>
> My thought is, the replay is only a debug option and disabled by default,
> so when user specifically enable the bit of PANIC_PRINT_ALL_PRINTK_MSG,
> the whole replay of printk msg should be expected.

I think that PANIC_PRINT_ALL_PRINTK_MSG is a debugging option; a quite
specific one. So people who ask the kernel to PANIC_PRINT_ALL_PRINTK_MSG
they know what they are doing, and we probably will not cofuse anyone.
After all, we don't print any headers when we ftrace_dump() or imitate
sysrq via sysrq_timer_list_show(), or for any other panic_print_sys_info()
printouts. So it's OK to just do the simple thing for
PANIC_PRINT_ALL_PRINTK_MSG.

	-ss

  reply	other threads:[~2019-04-18  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10 15:37 [PATCH v2] panic: add an option to replay all the printk message in buffer Feng Tang
2019-04-17  4:19 ` Andrew Morton
2019-04-17  6:48   ` Feng Tang
2019-04-17  9:18     ` Petr Mladek
2019-04-17  9:46       ` Sergey Senozhatsky
2019-04-17 10:50         ` Sergey Senozhatsky
2019-04-17 12:24           ` Petr Mladek
2019-04-17 15:18             ` Feng Tang
2019-04-18  0:00               ` Sergey Senozhatsky [this message]
2019-04-18  7:45                 ` Petr Mladek
2019-04-18  9:00                   ` Feng Tang
2019-04-18 11:01                     ` Petr Mladek
2019-04-19  2:08                       ` Feng Tang
2019-04-18 10:50                   ` Sergey Senozhatsky

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=20190418000014.GA2059@jagdpanzerIV \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=feng.tang@intel.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=ying.huang@intel.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.