Re: [PATCH 2/2 v6] printk: Add monotonic, boottime, and realtime timestamps

From: John Stultz
Date: Wed Aug 16 2017 - 23:47:02 EST


> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 98fe715522e8..c303b235a0b1 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -1,19 +1,61 @@
> menu "printk and dmesg options"
>
> +choice
> + prompt "printk default clock timestamp"
> +
> +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_BOOT
> + bool "CLOCK_BOOTTIME"
> + 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"
> + 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.
> +
> +endchoice
> +
> config PRINTK_TIME
> - bool "Show timing information on printks"
> + int "Show timestamp information on printks"

You need to drop the prompt on this, as it ends up with this insane
setup where you chose from the choice list, but then you can go and
set the PRINTK_TIME manually to something else?

So PRINTK_TIME_REAL can be y, but PRINTK_TIME can be 2... Yuck.

I'm still annoyed enough with this Kconfig/defconfig noise in the
patch that I'm going to take my own shot at it ( hopefully there's a
better way, but likely it will help me understand why it was done this
way :).

thanks
-john