From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Petr Mladek <pmladek@suse.com>,
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@gmail.com>
Subject: Re: [PATCHv2] printk: add console_msg_format command line option
Date: Wed, 20 Dec 2017 00:32:24 +0900 [thread overview]
Message-ID: <20171219153224.GB591@tigerII.localdomain> (raw)
In-Reply-To: <20171219101727.15ddb486@gandalf.local.home>
Hi,
On (12/19/17 10:17), Steven Rostedt wrote:
[..]
> > + console_msg_format=
> > + [KNL] Change console messages format
> > + default
> > + By default we print messages on consoles 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: "<%u>[time stamp] text\n"
> > + IOW, each message will have a facility and loglevel
> > + prefix. The format is similar to one used by syslog()
> > + syscall, or to executing "dmesg -S --raw" or to reading
> > + from /proc/kmsg.
>
> Just to clarify. This affects all consoles, not just serial?
yes.
just like printk_time param/config option affects all the consoles,
console_msg_format affects all of them. we msg_print_text() once, that
makes messages look the same on every console. so I kept the existing
behaviour.
[..]
> > +enum con_msg_format {
> > + MSG_FORMAT_DEFAULT = 0,
> > + MSG_FORMAT_SYSLOG = (1 << 0),
> > +};
>
> So the con_msg_format will be a flag (as denoted with the (1<<0)).
> Should we call it "con_msg_format_flags" to make it more obvious that
> these are treated as flags and not a simple number.
ok, can do.
[..]
> > +static int __init console_msg_format_setup(char *str)
> > +{
> > + if (!strncmp(str, "syslog", 6))
> > + console_msg_format = MSG_FORMAT_SYSLOG;
> > + if (!strncmp(str, "default", 7))
>
> You can use strcmp() instead of strncmp(), the init code will nul
> terminate the string for you before calling this function. Otherwise if
> we add "syslog_special" or "default_extra" they will be confused with
> the above.
ok, that's a minor thing, but can change.
-ss
next prev parent reply other threads:[~2017-12-19 15:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-19 8:42 [PATCHv2] printk: add console_msg_format command line option Sergey Senozhatsky
2017-12-19 15:17 ` Steven Rostedt
2017-12-19 15:32 ` Sergey Senozhatsky [this message]
2017-12-21 5:41 ` [PATCHv3] " Sergey Senozhatsky
2017-12-22 14:30 ` Petr Mladek
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=20171219153224.GB591@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;
as well as URLs for NNTP newsgroup(s).