On 08/17/2017 12:46 AM, John Stultz wrote:
> From: Prarit Bhargava <pra...@redhat.com>
> 
> 
> Prarit,
>   So I took my own shot at cleaning up the Kconfig settings to make
> it a bit more sane in my opinion. This should allow the legacy
> defconfigs to just work, and avoids all the defconfig churn in the
> patch.
> 
> I almost went through to try to simplify the code and make
> PRINTK_TIME_DISABLE = 0 and to get rid of PRINTK_TIME_UNDEFINED,
> as that seems like extra complexity that could probably be done
> simpler, but I didn't quite have the time to get my head around
> it all, so I left it be. But you might want to see if it can't
> be further simplified (ie: initialize it to CONFIG_PRINTK_TIME_VAL
> and then override it by the boot parameter if specified).
> 
> Anwyay, let me know what you think, and feel free to adopt this
> along with any other changes you have planned.
> 
> thanks
> -john

<snip>

> index 98fe715..83683e9ad 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -8,12 +8,64 @@ config PRINTK_TIME
>         messages to be added to the output of the syslog() system
>         call and at the console.
>  
> +choice
> +     prompt "printk default clock timestamp"
> +     default PRINTK_TIME_LOCAL if PRINTK_TIME
> +     default PRINTK_TIME_DISABLE if !PRINTK_TIME
> +     help
> +       This option is selected by setting one of
> +       PRINTK_TIME_[DISABLE|LOCAL|BOOT|MONO|REAL] and causes time stamps of
> +       the printk() messages to be added to the output of the syslog()
> +       system call and at the console.
> +
>         The timestamp is always recorded internally, and exported
>         to /dev/kmsg. This flag just specifies if the timestamp should
>         be included, not that the timestamp is recorded.
>  
>         The behavior is also controlled by the kernel command line
> -       parameter printk.time=1. See 
> Documentation/admin-guide/kernel-parameters.rst
> +       parameter printk.time. See
> +       Documentation/admin-guide/kernel-parameters.rst
> +
> +config PRINTK_TIME_DISABLE
> +     bool "Disabled" if !PRINTK_TIME
> +     help
> +      Selecting this option disables the time stamps of printk().
> +
> +config PRINTK_TIME_LOCAL
> +     bool "Local Clock" if PRINTK_TIME
> +     help
> +       Selecting this option causes the time stamps of printk() to be
> +       stamped with the unadjusted hardware clock.
> +
> +config PRINTK_TIME_BOOT
> +     bool "CLOCK_BOOTTIME" if PRINTK_TIME
> +     help
> +       Selecting this option causes the time stamps of printk() to be
> +       stamped with the adjusted boottime clock.
> +
> +config PRINTK_TIME_MONO
> +     bool "CLOCK_MONOTONIC" if PRINTK_TIME
> +     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" if PRINTK_TIME
> +     help
> +       Selecting this option causes the time stamps of printk() to be
> +       stamped with the adjusted realtime clock.
> +endchoice
> +
> +config PRINTK_TIME_TYPE
> +     int
> +     depends on PRINTK
> +     range 1 5
> +     default 1 if PRINTK_TIME_DISABLE
> +     default 2 if PRINTK_TIME_LOCAL
> +     default 3 if PRINTK_TIME_BOOT
> +     default 4 if PRINTK_TIME_MONO
> +     default 5 if PRINTK_TIME_REAL
> +

So, IIUC the result of this is, for example,

PRINT_TIME=y
PRINT_TIME_BOOT=y
PRINT_TIME_TIME_TYPE=3

In an earlier version of my patchset someone said not to introduce new config
options like this.  The reason I did introduce (IIRC I called it
CONFIG_PRINTK_CLOCK) was to avoid all the config churn but that was shot down.

If this is back on the table, then I too have a version that does essentially
what your patch does.

P.

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to