Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1693342

Re: [PATCH v5] printk: Add pr_info_show_time

From "Luis R. Rodriguez" <mcgrof@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v5] printk: Add pr_info_show_time
Date 2017-07-21 04:10 +0200
Message-ID <u5vya-7aa-23@gated-at.bofh.it> (permalink)
References <u5on0-2zZ-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5] printk: Add pr_info_show_time Mark Salyzyn <salyzyn@android.com> - 2017-07-20 20:30 +0200
  Re: [PATCH v5] printk: Add pr_info_show_time Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-07-21 02:30 +0200
  Re: [PATCH v5] printk: Add pr_info_show_time "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-07-21 04:10 +0200
    Re: [PATCH v5] printk: Add pr_info_show_time Mark Salyzyn <salyzyn@android.com> - 2017-07-21 17:10 +0200
  Re: [PATCH v5] printk: Add pr_info_show_time Pavel Machek <pavel@ucw.cz> - 2017-07-23 09:50 +0200
    Re: [PATCH v5] printk: Add pr_info_show_time Mark Salyzyn <salyzyn@android.com> - 2017-07-24 17:50 +0200

csiph-web