All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Prarit Bhargava <prarit@redhat.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Mark Salyzyn <salyzyn@android.com>,
	Jonathan Corbet <corbet@lwn.net>, Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Christoffer Dall <cdall@linaro.org>,
	Deepa Dinamani <deepa.kernel@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Joel Fernandes <joelaf@google.com>,
	Kees Cook <keescook@chromium.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	"Luis R. Rodriguez" <mcgrof@kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	Olof Johansson <olof@lixom.net>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH v2] printk: Add boottime and real timestamps
Date: Tue, 1 Aug 2017 10:00:30 -0700	[thread overview]
Message-ID: <CALAqxLWhTKaUTU=EPwEbU5KNwsyJ1RjvPnsZirxmZpKMp+S59w@mail.gmail.com> (raw)
In-Reply-To: <1501592128-11334-1-git-send-email-prarit@redhat.com>

On Tue, Aug 1, 2017 at 5:55 AM, Prarit Bhargava <prarit@redhat.com> 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 timestampes by adding options for no
> timestamp, the local hardware clock, the monotonic 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.
>
> Real clock & 32-bit systems:  Selecting the real clock printk timestamp may
> lead to unlikely situations where a timestamp is wrong because the real time
> offset is read without the protection of a sequence lock in the call to
> ktime_get_log_ts() in printk_get_ts().
>
> v2: Use peterz's suggested Kconfig options.  Merge patchset together.  Fix
> i386 !CONFIG_PRINTK builds.
>
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
...
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 98fe715522e8..7a8870b4ddbb 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -1,8 +1,39 @@
>  menu "printk and dmesg options"
>
> +choice
> +       prompt "printk default clock"
> +       config PRINTK_TIME_DISABLE
> +       bool "Disabled"
> +       help
> +        Selecting this option disables the time stamps of printk().
> +
> +       config PRINTK_TIME_LOCAL
> +       bool "Local Clock"
> +       help
> +         Selecting this option causes the time stamps of printk() to be
> +         stamped with the unadjusted hardware clock.
> +
> +       config PRINTK_TIME_MONO
> +       bool "CLOCK_MONOTONIC"
> +       help
> +         Selecting this option causes the time stamps of printk() to be
> +         stamped with the adjusted monotonic clock.
> +
> +       config PRINTK_TIME_REAL
> +       bool "CLOCK_REALTIME"
> +       help
> +         Selecting this option causes the time stamps of printk() to be
> +         stamped with the adjusted realtime clock.

Its been asked already, but I've not yet seen an answer.
Is there a reason your not also adding PRINTK_TIME_BOOT here (which to
me would be more generally useful then REAL or MONO)?

thanks
-john

  parent reply	other threads:[~2017-08-01 17:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01 12:55 [PATCH v2] printk: Add boottime and real timestamps Prarit Bhargava
2017-08-01 16:29 ` Luis R. Rodriguez
2017-08-01 18:33   ` Prarit Bhargava
2017-08-01 17:00 ` John Stultz [this message]
2017-08-01 17:35   ` Prarit Bhargava
2017-08-01 17:40     ` John Stultz
2017-08-01 19:13     ` Thomas Gleixner
2017-08-01 19:46     ` Mark Salyzyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALAqxLWhTKaUTU=EPwEbU5KNwsyJ1RjvPnsZirxmZpKMp+S59w@mail.gmail.com' \
    --to=john.stultz@linaro.org \
    --cc=Jason@zx2c4.com \
    --cc=akpm@linux-foundation.org \
    --cc=cdall@linaro.org \
    --cc=corbet@lwn.net \
    --cc=deepa.kernel@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=joelaf@google.com \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mingo@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=olof@lixom.net \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=prarit@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=salyzyn@android.com \
    --cc=sboyd@codeaurora.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.