From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117AbdLGQEA (ORCPT ); Thu, 7 Dec 2017 11:04:00 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:44496 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751014AbdLGQD5 (ORCPT ); Thu, 7 Dec 2017 11:03:57 -0500 X-Google-Smtp-Source: AGs4zMYgTHekycXtgbQxO1zYjFYE3wstYQ1q4hIKfNTRHyDk0634JbXqCtJUxAobWsCoWr1tPJiGWw== Date: Fri, 8 Dec 2017 01:03:53 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Fengguang Wu , Kevin Hilman , Mark Brown , Greg Kroah-Hartman , Andrew Morton , LKML , Sergey Senozhatsky Subject: Re: [RFC][PATCH] printk: add console_msg_format command line option Message-ID: <20171207160353.GA481@tigerII.localdomain> References: <20171201104404.1885-1-sergey.senozhatsky@gmail.com> <20171207134844.dkwo4b2tsfj3jxyu@pathway.suse.cz> <20171207140104.GA659@tigerII.localdomain> <20171207154500.qw4oaottbczpt6qx@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171207154500.qw4oaottbczpt6qx@pathway.suse.cz> 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 On (12/07/17 16:45), Petr Mladek wrote: [.,] > > hmm... `dmesg -S --raw' doesn't show anything on my system. `dmesg --raw' > > matches the console_msg_format=syslog. > > Huh, I am confused now. I thought that I saw the extended, /dev/kmsg - like, > output with "dmesg --raw" but I do not see it now. > > Anyway, I can see a difference related to > /sys/module/printk/parameters/time. The command "dmesg --raw" always > shows the timestamp help because it reads the messages via /dev/kmsg. > But "dmesg -S --raw" shows the timestamp only when the "time" > parameter is enabled: aha, I see your point. -S forces dmesg to use syslog() syscall. so it doesn't access the kmsg. otherwise it attempts to read from kmsg first. you are right. > $> echo 0 >/sys/module/printk/parameters/time > $> dmesg -S --raw | head -n 3 > <5>Linux version 4.15.0-rc2-5-default+ (pmladek@pathway) (gcc version 4.8.5 (SUSE Linux)) #4180 SMP Thu Dec 7 16:06:42 CET 2017 > <6>Command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-rc2-5-default+ root=UUID=9ba368bb-c323-4131-ad94-c29cf3add76f resume=/dev/sda2 earlyprintk=ttyS0,115200 console=tty0 console=ttyS0,115200 console_msg_format=syslog ignore_loglevel nosplash showopts crashkernel=256M,high crashkernel=128M,low > <6>x86/fpu: x87 FPU will use FXSAVE > $> echo 1 >/sys/module/printk/parameters/time > $> dmesg -S --raw | head -n 3 > <5>[ 0.000000] Linux version 4.15.0-rc2-5-default+ (pmladek@pathway) (gcc version 4.8.5 (SUSE Linux)) #4180 SMP Thu Dec 7 16:06:42 CET 2017 > <6>[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-rc2-5-default+ root=UUID=9ba368bb-c323-4131-ad94-c29cf3add76f resume=/dev/sda2 earlyprintk=ttyS0,115200 console=tty0 console=ttyS0,115200 console_msg_format=syslog ignore_loglevel nosplash showopts crashkernel=256M,high crashkernel=128M,low > <6>[ 0.000000] x86/fpu: x87 FPU will use FXSAVE I see. > To be honest, I am somehow confused by the terminology. > We should make it clear that the "syslog" console format > is the same as the format used by the syslog syscall. yeah. that was exactly my point. syslog format means that : we do what reading from /proc/kmsg does -- do_syslog(). which "is" : the same for some dmesg modes. I thought that `dmesg --raw' always uses do_syslog(), apparently this is not the case, and that "is" was not correct. -ss