From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030468AbdIZLsu (ORCPT ); Tue, 26 Sep 2017 07:48:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:59315 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965952AbdIZLss (ORCPT ); Tue, 26 Sep 2017 07:48:48 -0400 Date: Tue, 26 Sep 2017 13:48:42 +0200 From: Petr Mladek To: Prarit Bhargava 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 Subject: Re: [PATCH 3/3 v12] printk: Add monotonic, boottime, and realtime timestamps Message-ID: <20170926114842.GB13820@pathway.suse.cz> References: <1505757060-2004-1-git-send-email-prarit@redhat.com> <1505757060-2004-4-git-send-email-prarit@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1505757060-2004-4-git-send-email-prarit@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; > #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