From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754715AbcANOp2 (ORCPT ); Thu, 14 Jan 2016 09:45:28 -0500 Received: from www.linutronix.de ([62.245.132.108]:57362 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752533AbcANOp0 (ORCPT ); Thu, 14 Jan 2016 09:45:26 -0500 Date: Thu, 14 Jan 2016 15:44:23 +0100 (CET) From: Thomas Gleixner To: Petr Mladek cc: Prarit Bhargava , linux-kernel@vger.kernel.org, John Stultz , Xunlei Pang , Baolin Wang , Andrew Morton , Greg Kroah-Hartman , Tejun Heo , Peter Hurley , Vasily Averin , Joe Perches Subject: Re: [PATCH 0/2] printk, Add printk.clock kernel parameter [v2] In-Reply-To: <20160114125238.GU731@pathway.suse.cz> Message-ID: References: <1452688466-14877-1-git-send-email-prarit@redhat.com> <569660FA.2020802@redhat.com> <20160114125238.GU731@pathway.suse.cz> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Jan 2016, Petr Mladek wrote: > On Wed 2016-01-13 18:28:50, Thomas Gleixner wrote: > > You can solve the whole business by changing the timestamp in printk_log to > > > > u64 mono; > > u64 offset_real; > > This is not so easy because the structure is proceed by userspace tool, > e.g. crash, see log_buf_kexec_setup(). We would need to update all > the tools as well. Fair enough. > > and have a function which does: > > > > u64 ktime_get_log_ts(u64 *offset_real) > > { > > *offset_real = tk_core.timekeeper.offs_real; > > > > if (timekeeping_active) > > return ktime_get_mono_fast_ns(); > > else > > return local_clock(); > > } > > A solution would be to apply the offset_real immediately. I wonder if > any tool expects the messages to be sorted by a monotonic clock. In > fact, it might be useful to see that some messages are disordered > against the real time, e.g. because of the leaf second. Not only leap seconds, it's also settimeofday and NTP might make the wall time jump under certain conditions. Thanks, tglx