From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968968AbdIZMze (ORCPT ); Tue, 26 Sep 2017 08:55:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59572 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966354AbdIZMz3 (ORCPT ); Tue, 26 Sep 2017 08:55:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9832E80B2A Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=prarit@redhat.com Subject: Re: [PATCH 3/3 v12] printk: Add monotonic, boottime, and realtime timestamps To: Petr Mladek References: <1505757060-2004-1-git-send-email-prarit@redhat.com> <1505757060-2004-4-git-send-email-prarit@redhat.com> <20170926114842.GB13820@pathway.suse.cz> Cc: linux-kernel@vger.kernel.org, Mark Salyzyn , Jonathan Corbet , Sergey Senozhatsky , Steven Rostedt , John Stultz , Thomas Gleixner , Stephen Boyd , Andrew Morton , Greg Kroah-Hartman , "Paul E. McKenney" , Christoffer Dall , Deepa Dinamani , Ingo Molnar , Joel Fernandes , Kees Cook , Peter Zijlstra , Geert Uytterhoeven , "Luis R. Rodriguez" , Nicholas Piggin , "Jason A. Donenfeld" , Olof Johansson , Josh Poimboeuf , linux-doc@vger.kernel.org From: Prarit Bhargava Message-ID: Date: Tue, 26 Sep 2017 08:55:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170926114842.GB13820@pathway.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 26 Sep 2017 12:55:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/26/2017 07:48 AM, Petr Mladek wrote: > On Mon 2017-09-18 13:51:00, Prarit Bhargava wrote: >> printk.time=1/CONFIG_PRINTK_TIME=1 adds a unmodified local hardware clock >> timestamp to printk messages. The local hardware clock loses time each >> day making it difficult to determine exactly when an issue has occurred in >> the kernel log, and making it difficult to determine how kernel and >> hardware issues relate to each other in real time. >> >> Make printk output different timestamps by adding options for no >> timestamp, the local hardware clock, the monotonic clock, the boottime >> clock, and the real clock. Allow a user to pick one of the clocks by >> using the printk.time kernel parameter. Output the type of clock in >> /sys/module/printk/parameters/time so userspace programs can interpret the >> timestamp. >> >> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c >> index 512f7c2baedd..5e0bf2ef02f7 100644 >> --- a/kernel/printk/printk.c >> +++ b/kernel/printk/printk.c >> @@ -1201,14 +1204,130 @@ static inline void boot_delay_msec(int level) >> +static int printk_time = CONFIG_PRINTK_TIME_TYPE; >> + >> +static int printk_set_ts_source(enum timestamp_sources ts_source) >> +{ >> + int err = 0; > > >> @@ -1861,6 +1980,7 @@ static size_t msg_print_text(const struct printk_log *msg, >> bool syslog, char *buf, size_t size) { return 0; } >> static bool suppress_message_printing(int level) { return false; } >> >> +static int printk_time; > > I worried if the variable should have got initialized. But it seems to > be a relic from an older version. The variable is not longer used and > needed when CONFIG_PRINTK is not defined. It is proved by gcc: > > CC kernel/printk/printk.o > kernel/printk/printk.c:1983:12: warning: ‘printk_time’ defined but not used [-Wunused-variable] > static int printk_time; > I didn't catch that :(. tglx, want a v14? P. > >> #endif /* CONFIG_PRINTK */ >> >> #ifdef CONFIG_EARLY_PRINTK > > Otherwise that patch looks fine. With the unused variable removed, > feel free to use: > > Reviewed-by: Petr Mladek > > Best Regards, > Petr >