From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbcAZUfw (ORCPT ); Tue, 26 Jan 2016 15:35:52 -0500 Received: from www.linutronix.de ([62.245.132.108]:38536 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbcAZUfs (ORCPT ); Tue, 26 Jan 2016 15:35:48 -0500 Date: Tue, 26 Jan 2016 21:34:42 +0100 (CET) From: Thomas Gleixner To: Prarit Bhargava cc: linux-kernel@vger.kernel.org, John Stultz , Xunlei Pang , Baolin Wang , Andrew Morton , Greg Kroah-Hartman , Petr Mladek , Tejun Heo , Peter Hurley , Vasily Averin , Joe Perches Subject: Re: [PATCH] printk, allow different timestamps for printk.time In-Reply-To: <1453734744-28425-1-git-send-email-prarit@redhat.com> Message-ID: References: <1453734744-28425-1-git-send-email-prarit@redhat.com> 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 Prarit, On Mon, 25 Jan 2016, Prarit Bhargava wrote: > diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt > index 87d40a7..2cf6692 100644 > --- a/Documentation/kernel-parameters.txt > +++ b/Documentation/kernel-parameters.txt > @@ -3060,8 +3060,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. > Format: (1/Y/y=enable, 0/N/n=disable) > default: disabled > > - printk.time= Show timing data prefixed to each printk message line > - Format: (1/Y/y=enable, 0/N/n=disable) > + printk.time= Show timestamp prefixed to each printk message line > + Format: [0-2] (0 = disable, > + 1 = monotonic clock, 2 = real clock) Doesn't this break systems, which have 'Y/y' on the command line? > static DEFINE_RAW_SPINLOCK(timekeeper_lock); > static struct timekeeper shadow_timekeeper; > +static int timekeeping_active; > > /** > * struct tk_fast - NMI safe timekeeper > @@ -401,6 +402,16 @@ u64 ktime_get_raw_fast_ns(void) > } > EXPORT_SYMBOL_GPL(ktime_get_raw_fast_ns); > > +u64 ktime_get_log_ts(u64 *offset_real) > +{ > + *offset_real = ktime_to_ns(tk_core.timekeeper.offs_real); > + > + if (timekeeping_active) > + return ktime_get_mono_fast_ns(); > + else > + return local_clock(); Just for the record: The fast timekeeper stops across the inner workings of suspend/resume. But I think that doesn't matter much. Otherwise, this looks good now. Thanks, tglx