mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: Mark Salyzyn <salyzyn@android.com>
Cc: linux-kernel@vger.kernel.org, pavel@ucw.cz,
	andriy.shevchenko@linux.intel.com, joe@perches.com,
	prarit@redhat.com, rjw@rjwysocki.net, tglx@linutronix.de,
	Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Kees Cook <keescook@chromium.org>,
	Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Mark Salyzyn <salyzyn@google.com>,
	"Luis R. Rodriguez" <mcgrof@kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Olof Johansson <olof@lixom.net>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [PATCH v5] printk: Add pr_info_show_time
Date: Fri, 21 Jul 2017 04:00:57 +0200	[thread overview]
Message-ID: <20170721020057.GA18884@wotan.suse.de> (raw)
In-Reply-To: <20170720182505.9357-1-salyzyn@android.com>

On Thu, Jul 20, 2017 at 11:24:22AM -0700, Mark Salyzyn wrote:
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 98fe715522e8..0d63c3fb4e24 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -30,6 +30,58 @@ config CONSOLE_LOGLEVEL_DEFAULT
>  	  usage in the kernel. That is controlled by the MESSAGE_LOGLEVEL_DEFAULT
>  	  option.
>  
> +# set if time is being printed in pr_info_show_time()
> +config PR_INFO_SHOW_TIME
> +	bool
> +
> +choice
> +	prompt "pr_info_show_time() alternate time message prefix"
> +	help
> +	  Activate alternate time prefix in pr_info_show_time
> +
> +	  The primary use of the instrumentation is to aid field
> +	  analysis of Battery and Power usage.  The instrumentation
> +	  may also help triage and synchronize kernel logs and user
> +	  space activity logs at key displacements.
> +	config PR_INFO_SHOW_TIME_MONOTONIC
> +		bool "monotonic"
> +		help
> +		  Deactivate alternate time prefix in pr_info_show_time.
> +		  Doing so because monotonic time is part of the normal
> +		  printk time logging.
> +
> +		  Print only the supplied message in pr_info_show_time,
> +		  indistinguishable from pr_info.
> +	config PR_INFO_SHOW_TIME_REALTIME
> +		bool "realtime"
> +		select PR_INFO_SHOW_TIME
> +		help
> +		  Activate alternate time prefix in pr_info_show_time
> +
> +		  The primary use of the instrumentation is to aid field
> +		  analysis of Battery and Power usage.  The instrumentation
> +		  may also help triage and synchronize kernel logs and user
> +		  space activity logs at key displacements.  For instance
> +		  CLOCK_MONOTONIC stops while suspended, while CLOCK_REALTIME
> +		  continues, and the timestamps help re-orient post-analysis.
> +
> +		  Prefix realtime [<epoch>.<ns>U] timestamp in pr_info_show_time
> +	config PR_INFO_SHOW_TIME_BOOTTIME
> +		bool "boottime"
> +		select PR_INFO_SHOW_TIME
> +		help
> +		  Activate alternate time prefix in pr_info_show_time
> +
> +		  The primary use of the instrumentation is to aid field
> +		  analysis of Battery and Power usage.  The instrumentation
> +		  may also help triage and synchronize kernel logs and user
> +		  space activity logs at key displacements.  For instance
> +		  CLOCK_MONOTONIC stops while suspended, while CLOCK_BOOTTIME
> +		  continues, and the timestamps help re-orient post-analysis.
> +
> +		  Prefix boottime [<epoch>.<ns>B] timestamp in pr_info_show_time
> +endchoice

There is no depends magic anywhere here, so none of this actually has complex
dependencies, this is just boot time preference setup, and for that I think a
boot param and sysctl value could easily not only enable the same but *also*
enable run time ability to swap between these. Even for the branch performance
consideration can't jump labels be used to address that if there is a concern
for that?

I think that would also make the code easier to read and remove all this kconfig
extra stuff. Then its just a run time thing.

Also, should there be no checks for time being available and ready before this
is used?

  Luis

  parent reply	other threads:[~2017-07-21  2:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 18:24 Mark Salyzyn
2017-07-21  0:21 ` Sergey Senozhatsky
2017-07-21  2:00 ` Luis R. Rodriguez [this message]
2017-07-21 15:00   ` Mark Salyzyn
2017-07-22  9:40 ` Pavel Machek
2017-07-24 15:47   ` 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=20170721020057.GA18884@wotan.suse.de \
    --to=mcgrof@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=geert@linux-m68k.org \
    --cc=joe@perches.com \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=olof@lixom.net \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=prarit@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=rostedt@goodmis.org \
    --cc=salyzyn@android.com \
    --cc=salyzyn@google.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®