From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751368AbdKVF0h (ORCPT ); Wed, 22 Nov 2017 00:26:37 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35506 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbdKVF0g (ORCPT ); Wed, 22 Nov 2017 00:26:36 -0500 X-Google-Smtp-Source: AGs4zMYz+yfCTlpAy1BONDdXeMkNle0KTeCFCuwDI7a/6fzD745xxtsGTVTB4n70vuebnJdNTqqX8g== Date: Wed, 22 Nov 2017 14:26:30 +0900 From: Sergey Senozhatsky To: Fengguang Wu Cc: Kevin Hilman , Mark Brown , Greg Kroah-Hartman , LKML , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds Subject: Re: kernel CI: printk loglevels in kernel boot logs? Message-ID: <20171122052630.GA447@jagdpanzerIV> References: <20171122015610.x3kgzqgtwywlurmz@wfg-t540p.sh.intel.com> <20171122032702.zd5ouuugrxyemqbh@wfg-t540p.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171122032702.zd5ouuugrxyemqbh@wfg-t540p.sh.intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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