mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Mark Brown <broonie@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: Re: [RFC][PATCH] printk: add console_msg_format command line option
Date: Thu, 7 Dec 2017 23:01:04 +0900	[thread overview]
Message-ID: <20171207140104.GA659@tigerII.localdomain> (raw)
In-Reply-To: <20171207134844.dkwo4b2tsfj3jxyu@pathway.suse.cz>

Hi,

On (12/07/17 14:48), Petr Mladek wrote:
[..]
> > This patch introduces a `console_msg_format=' command line option,
> > to switch between different message formatting on serial consoles.
> > For the time being we have just one option - syslog. This option
> > makes serial console messages to appear in syslog format, matching
> > the `dmesg --raw' and `cat /proc/kmsg' output formats:
> 
> I have realized that 'cat /proc/kmsg' did not work. It can be done using:

hm, it does work on my system. what do you mean by 'did not work'?


> Also the format is more comlicated here, see printk.c:
> 
>  * /dev/kmsg exports the structured data in the following line format:
>  *   "<level>,<sequnum>,<timestamp>,<contflag>[,additional_values, ... ];<message text>\n"

that's /dev/kmsg. /dev/kmsg != /proc/kmsg. I never mentioned /dev/kmsg
in my commit. /dev/kmsg prints the extended stuff, /proc/kmsg does not.


> > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > index 28467638488d..2dd91c5073f9 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@ -643,6 +643,16 @@
> >  			console=brl,ttyS0
> >  		For now, only VisioBraille is supported.
> >  
> > +	console_msg_format=
> > +			[KNL] Control message format
> > +			By default we print messages in "[time stamp] text\n"
> > +			format (time stamp may not be printed, depending on
> > +			CONFIG_PRINTK_TIME or `printk_time' param).
> > +		syslog
> > +			Switch to syslog format (similar to "dmesg --raw" or
> > +			reading from /proc/kmsg): "<%u>[time stamp] text\n"
> 
> To be precise, it exactly the same as "dmesg -S --raw". Also it is the
> format used by SYSLOG_ACTION_READ* actions of the syslog syscall.

hmm... `dmesg -S --raw' doesn't show anything on my system. `dmesg --raw'
matches the console_msg_format=syslog.


> > +static int __init console_msg_format_setup(char *str)
> > +{
> > +	if (!strncmp(str, "syslog", 6))
> > +		console_msg_format = MSG_FORMAT_SYSLOG;
> 
> It might make sense to accept also the "default" format.
> 
> > +	return 1;
> > +}
> > +__setup("console_msg_format=", console_msg_format_setup);
> 
> I would use early_param() so that it takes effect as soon as possible.

ok. can take a look.

	-ss

  reply	other threads:[~2017-12-07 14:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 10:44 Sergey Senozhatsky
2017-12-07 13:48 ` Petr Mladek
2017-12-07 14:01   ` Sergey Senozhatsky [this message]
2017-12-07 15:45     ` Petr Mladek
2017-12-07 16:03       ` 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=20171207140104.GA659@tigerII.localdomain \
    --to=sergey.senozhatsky@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@kernel.org \
    --cc=fengguang.wu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®