All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: Kevin Hilman <khilman@baylibre.com>,
	Mark Brown <broonie@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: kernel CI: printk loglevels in kernel boot logs?
Date: Wed, 22 Nov 2017 14:26:30 +0900	[thread overview]
Message-ID: <20171122052630.GA447@jagdpanzerIV> (raw)
In-Reply-To: <20171122032702.zd5ouuugrxyemqbh@wfg-t540p.sh.intel.com>

Hello,

On (11/22/17 11:27), Fengguang Wu wrote:
> [CC LKML for possible printk improvements]

[..]

> > > In kernelCI, we're considering submitting a patch to add a
> > > "show_loglevel" command-line argument to enable that option on kernel
> > > boot.
> > 
> > Thanks for doing that patch! It'll obviously make it easier to catch
> > various warnings, which will be useful when used with caution,
> > especially when false warnings (wrt. real problems that should be
> > fixed) can be effectively filtered out.

both /dev/kmsg and /proc/kmsg show log levels. user space then can
hide those levels or show them via "--raw" mode/etc. we don't (*sort
of don't*) have a "--raw" mode for serial consoles. we do have extended
consoles, which print metadata on consoles: msg_print_ext_header()
and msg_print_ext_body()

	sprintf(... "%u,%llu,%llu,%c;",
		(msg->facility << 3) | msg->level, seq, ts_usec, ....)

basically the same format as for /dev/kmsg. but extended console drivers
come at a price - broken pr_cont(). "sad!". and, besides, may be ext
consoles can show more data than needed.

/proc/kmsg has different format. it does not do the ext_header/ext_body
thing, but instead calls msg_print_text()->print_prefix(), which simply
does

	prefix = (msg->facility << 3) | msg->level;
	sprintf(buf, "<%u>", prefix);

console_unlock(), the function that prints messages on the consoles,
calls msg_print_text() function, but does not do print_prefix()
("bool syslog" is false).

so may be we can add "syslog" mode for console drivers and do print_prefix()
in console_unlock() [unless have nr_ext_console_drivers]. if this is what
you guys are talking about. (frankly, I have no idea if there are tools
that parse output from serial consoles/net consoles and thus might get
confused by extra <%u> in every message).

	-ss

  reply	other threads:[~2017-11-22  5:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOi56cVORdyjTXK4QGYRfyD1Q=QBgsU3B__gZT0xj6OBKaasLQ@mail.gmail.com>
     [not found] ` <20171122015610.x3kgzqgtwywlurmz@wfg-t540p.sh.intel.com>
2017-11-22  3:27   ` kernel CI: printk loglevels in kernel boot logs? Fengguang Wu
2017-11-22  5:26     ` Sergey Senozhatsky [this message]
2017-11-22 10:42       ` Mark Brown
2017-11-22 11:34     ` Petr Mladek
2017-11-22 12:38       ` Sergey Senozhatsky
2017-11-22 12:52         ` Fengguang Wu
2017-11-23  2:59           ` Sergey Senozhatsky
2017-11-23  3:14             ` Fengguang Wu
2017-11-23  4:31               ` Sergey Senozhatsky
2017-11-29  0:13             ` Kevin Hilman
2017-11-29  7:25               ` Sergey Senozhatsky
2017-11-30 17:45                 ` Kevin Hilman
2017-12-01  1:25                   ` Sergey Senozhatsky
2017-11-23 10:04           ` Petr Mladek
2017-11-22 20:22         ` Kevin Hilman
2017-11-22 14:10       ` Fengguang Wu
2017-12-05 15:55         ` Petr Mladek
2017-12-05 16:13           ` Sergey Senozhatsky
2017-12-05 20:54           ` Steven Rostedt
2017-12-06 13:54             ` 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=20171122052630.GA447@jagdpanzerIV \
    --to=sergey.senozhatsky.work@gmail.com \
    --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@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 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.