Skip to contentSkip to conversation

printk: allow different timestamps for printk.time

PATCH In review Prarit Bhargava 6 participants 10 messages Jul 25, 2017 – Jul 31, 2017

Subsystems (32)
lore
Share & tools
lore
#0 lore raw

cover printk: allow different timestamps for printk.time

Over the past years I've seen many reports of bugs that include time-stamped kernel logs (enabled when CONFIG_PRINTK_TIME=y or print.time=1 is specified as a kernel parameter) that do not align with either external time stamped logs or /var/log/messages. This also makes determining the time of a failure difficult in cases where /var/log/messages is unavailable.

For example,

[root@intel-wildcatpass-06 ~]# date; echo "Hello!" > /dev/kmsg ; date Thu Jul 20 11:38:22 EST 2017
Thu Jul 20 11:38:22 EST 2017

which displays

[83973.768912] Hello!

on the serial console.

Running a script to convert this to the stamped time,

[root@intel-wildcatpass-06 ~]# ./human.sh | tail -1

[Thu July 17 11:39:45 2017] Hello!

which is already off by 1 minute and 23 seconds off after ~24 hours of uptime.

This occurs because the printk time stamp is obtained from a call to local_clock() which (on x86) is a direct call to the hardware. These hardware clock reads are not modified by the standard ntp or ptp protocol The other timestamps are and that results in situations external time sources are further and further offset from the kernel log timestamps.

Implement printk.time settings to allow a user to specify the monotonic or real clocks. The default is the local clock (hardware clock).

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().

Cc Mark Salyzyn <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc John Stultz <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc "Paul E. McKenney" <[email protected]>
Cc Christoffer Dall <[email protected]>
Cc Deepa Dinamani <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Joel Fernandes <[email protected]>
Cc Kees Cook <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc "Luis R. Rodriguez" <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc "Jason A. Donenfeld" <[email protected]>
Cc Olof Johansson <[email protected]>
Cc "Theodore Ts'o" <[email protected]>
Cc Josh Poimboeuf <[email protected]>

Prarit Bhargava (2):
printk: Make CONFIG_PRINTK_TIME an int
printk: Add boottime and real timestamps

 Documentation/admin-guide/kernel-parameters.txt    |  6 +-
 arch/arm/configs/aspeed_g4_defconfig               |  2 +-
 arch/arm/configs/aspeed_g5_defconfig               |  2 +-
 arch/arm/configs/axm55xx_defconfig                 |  2 +-
 arch/arm/configs/bcm2835_defconfig                 |  2 +-
 arch/arm/configs/colibri_pxa270_defconfig          |  2 +-
 arch/arm/configs/colibri_pxa300_defconfig          |  2 +-
 arch/arm/configs/dove_defconfig                    |  2 +-
 arch/arm/configs/efm32_defconfig                   |  2 +-
 arch/arm/configs/exynos_defconfig                  |  2 +-
 arch/arm/configs/ezx_defconfig                     |  2 +-
 arch/arm/configs/h5000_defconfig                   |  2 +-
 arch/arm/configs/hisi_defconfig                    |  2 +-
 arch/arm/configs/imote2_defconfig                  |  2 +-
 arch/arm/configs/imx_v6_v7_defconfig               |  2 +-
 arch/arm/configs/keystone_defconfig                |  2 +-
 arch/arm/configs/lpc18xx_defconfig                 |  2 +-
 arch/arm/configs/magician_defconfig                |  2 +-
 arch/arm/configs/mmp2_defconfig                    |  2 +-
 arch/arm/configs/moxart_defconfig                  |  2 +-
 arch/arm/configs/mps2_defconfig                    |  2 +-
 arch/arm/configs/multi_v7_defconfig                |  2 +-
 arch/arm/configs/mvebu_v7_defconfig                |  2 +-
 arch/arm/configs/mxs_defconfig                     |  2 +-
 arch/arm/configs/omap2plus_defconfig               |  2 +-
 arch/arm/configs/pxa168_defconfig                  |  2 +-
 arch/arm/configs/pxa3xx_defconfig                  |  2 +-
 arch/arm/configs/pxa910_defconfig                  |  2 +-
 arch/arm/configs/pxa_defconfig                     |  2 +-
 arch/arm/configs/qcom_defconfig                    |  2 +-
 arch/arm/configs/raumfeld_defconfig                |  2 +-
 arch/arm/configs/shmobile_defconfig                |  2 +-
 arch/arm/configs/socfpga_defconfig                 |  2 +-
 arch/arm/configs/stm32_defconfig                   |  2 +-
 arch/arm/configs/sunxi_defconfig                   |  2 +-
 arch/arm/configs/tango4_defconfig                  |  2 +-
 arch/arm/configs/tegra_defconfig                   |  2 +-
 arch/arm/configs/u300_defconfig                    |  2 +-
 arch/arm/configs/u8500_defconfig                   |  2 +-
 arch/arm/configs/vt8500_v6_v7_defconfig            |  2 +-
 arch/arm/configs/xcep_defconfig                    |  2 +-
 arch/arm/configs/zx_defconfig                      |  2 +-
 arch/arm64/configs/defconfig                       |  2 +-
 arch/m68k/configs/amcore_defconfig                 |  2 +-
 arch/mips/configs/ath25_defconfig                  |  2 +-
 arch/mips/configs/bcm47xx_defconfig                |  2 +-
 arch/mips/configs/bmips_be_defconfig               |  2 +-
 arch/mips/configs/bmips_stb_defconfig              |  2 +-
 arch/mips/configs/ci20_defconfig                   |  2 +-
 arch/mips/configs/generic_defconfig                |  2 +-
 arch/mips/configs/lemote2f_defconfig               |  2 +-
 arch/mips/configs/loongson3_defconfig              |  2 +-
 arch/mips/configs/nlm_xlp_defconfig                |  2 +-
 arch/mips/configs/nlm_xlr_defconfig                |  2 +-
 arch/mips/configs/pistachio_defconfig              |  2 +-
 arch/mips/configs/qi_lb60_defconfig                |  2 +-
 arch/mips/configs/rt305x_defconfig                 |  2 +-
 arch/mips/configs/xway_defconfig                   |  2 +-
 arch/parisc/configs/generic-64bit_defconfig        |  2 +-
 arch/powerpc/configs/40x/virtex_defconfig          |  2 +-
 arch/powerpc/configs/44x/fsp2_defconfig            |  2 +-
 arch/powerpc/configs/44x/virtex5_defconfig         |  2 +-
 arch/powerpc/configs/44x/warp_defconfig            |  2 +-
 arch/powerpc/configs/52xx/cm5200_defconfig         |  2 +-
 arch/powerpc/configs/52xx/lite5200b_defconfig      |  2 +-
 arch/powerpc/configs/52xx/motionpro_defconfig      |  2 +-
 arch/powerpc/configs/52xx/tqm5200_defconfig        |  2 +-
 arch/powerpc/configs/gamecube_defconfig            |  2 +-
 arch/powerpc/configs/mpc5200_defconfig             |  2 +-
 arch/powerpc/configs/pasemi_defconfig              |  2 +-
 arch/powerpc/configs/wii_defconfig                 |  2 +-
 arch/s390/configs/default_defconfig                |  2 +-
 arch/s390/configs/gcov_defconfig                   |  2 +-
 arch/s390/configs/performance_defconfig            |  2 +-
 arch/s390/configs/zfcpdump_defconfig               |  2 +-
 arch/sh/configs/edosk7760_defconfig                |  2 +-
 arch/sh/configs/sdk7786_defconfig                  |  2 +-
 arch/sh/configs/se7722_defconfig                   |  2 +-
 arch/sh/configs/sh7785lcr_32bit_defconfig          |  2 +-
 arch/sh/configs/urquell_defconfig                  |  2 +-
 arch/sparc/configs/sparc64_defconfig               |  2 +-
 arch/x86/configs/i386_defconfig                    |  2 +-
 arch/x86/configs/x86_64_defconfig                  |  2 +-
 arch/xtensa/configs/audio_kc705_defconfig          |  2 +-
 arch/xtensa/configs/cadence_csp_defconfig          |  2 +-
 arch/xtensa/configs/generic_kc705_defconfig        |  2 +-
 arch/xtensa/configs/nommu_kc705_defconfig          |  2 +-
 arch/xtensa/configs/smp_lx200_defconfig            |  2 +-
 include/linux/timekeeping.h                        |  1 +
 kernel/printk/printk.c                             | 95 +++++++++++++++++++++-
 kernel/time/timekeeping.c                          | 14 ++++
 lib/Kconfig.debug                                  |  8 +-
 .../selftests/rcutorture/configs/lock/CFcommon     |  2 +-
 .../selftests/rcutorture/configs/rcu/CFcommon      |  2 +-
 .../selftests/rcutorture/configs/rcuperf/CFcommon  |  2 +-
 95 files changed, 206 insertions(+), 98 deletions(-)
Signature · 1 line
1.8.5.5
#1 lore raw

PATCH 1/2 printk: Make CONFIG_PRINTK_TIME an int

CONFIG_PRINTK_TIME is a bool and in order to add timestamp options for the monotonic and real time clock it must be expanded to an int.

Cc Mark Salyzyn <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc John Stultz <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc "Paul E. McKenney" <[email protected]>
Cc Christoffer Dall <[email protected]>
Cc Deepa Dinamani <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Joel Fernandes <[email protected]>
Cc Kees Cook <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc "Luis R. Rodriguez" <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc "Jason A. Donenfeld" <[email protected]>
Cc Olof Johansson <[email protected]>
Cc "Theodore Ts'o" <[email protected]>
Cc Josh Poimboeuf <[email protected]>
---
 Documentation/admin-guide/kernel-parameters.txt    |  2 +-
 arch/arm/configs/aspeed_g4_defconfig               |  2 +-
 arch/arm/configs/aspeed_g5_defconfig               |  2 +-
 arch/arm/configs/axm55xx_defconfig                 |  2 +-
 arch/arm/configs/bcm2835_defconfig                 |  2 +-
 arch/arm/configs/colibri_pxa270_defconfig          |  2 +-
 arch/arm/configs/colibri_pxa300_defconfig          |  2 +-
 arch/arm/configs/dove_defconfig                    |  2 +-
 arch/arm/configs/efm32_defconfig                   |  2 +-
 arch/arm/configs/exynos_defconfig                  |  2 +-
 arch/arm/configs/ezx_defconfig                     |  2 +-
 arch/arm/configs/h5000_defconfig                   |  2 +-
 arch/arm/configs/hisi_defconfig                    |  2 +-
 arch/arm/configs/imote2_defconfig                  |  2 +-
 arch/arm/configs/imx_v6_v7_defconfig               |  2 +-
 arch/arm/configs/keystone_defconfig                |  2 +-
 arch/arm/configs/lpc18xx_defconfig                 |  2 +-
 arch/arm/configs/magician_defconfig                |  2 +-
 arch/arm/configs/mmp2_defconfig                    |  2 +-
 arch/arm/configs/moxart_defconfig                  |  2 +-
 arch/arm/configs/mps2_defconfig                    |  2 +-
 arch/arm/configs/multi_v7_defconfig                |  2 +-
 arch/arm/configs/mvebu_v7_defconfig                |  2 +-
 arch/arm/configs/mxs_defconfig                     |  2 +-
 arch/arm/configs/omap2plus_defconfig               |  2 +-
 arch/arm/configs/pxa168_defconfig                  |  2 +-
 arch/arm/configs/pxa3xx_defconfig                  |  2 +-
 arch/arm/configs/pxa910_defconfig                  |  2 +-
 arch/arm/configs/pxa_defconfig                     |  2 +-
 arch/arm/configs/qcom_defconfig                    |  2 +-
 arch/arm/configs/raumfeld_defconfig                |  2 +-
 arch/arm/configs/shmobile_defconfig                |  2 +-
 arch/arm/configs/socfpga_defconfig                 |  2 +-
 arch/arm/configs/stm32_defconfig                   |  2 +-
 arch/arm/configs/sunxi_defconfig                   |  2 +-
 arch/arm/configs/tango4_defconfig                  |  2 +-
 arch/arm/configs/tegra_defconfig                   |  2 +-
 arch/arm/configs/u300_defconfig                    |  2 +-
 arch/arm/configs/u8500_defconfig                   |  2 +-
 arch/arm/configs/vt8500_v6_v7_defconfig            |  2 +-
 arch/arm/configs/xcep_defconfig                    |  2 +-
 arch/arm/configs/zx_defconfig                      |  2 +-
 arch/arm64/configs/defconfig                       |  2 +-
 arch/m68k/configs/amcore_defconfig                 |  2 +-
 arch/mips/configs/ath25_defconfig                  |  2 +-
 arch/mips/configs/bcm47xx_defconfig                |  2 +-
 arch/mips/configs/bmips_be_defconfig               |  2 +-
 arch/mips/configs/bmips_stb_defconfig              |  2 +-
 arch/mips/configs/ci20_defconfig                   |  2 +-
 arch/mips/configs/generic_defconfig                |  2 +-
 arch/mips/configs/lemote2f_defconfig               |  2 +-
 arch/mips/configs/loongson3_defconfig              |  2 +-
 arch/mips/configs/nlm_xlp_defconfig                |  2 +-
 arch/mips/configs/nlm_xlr_defconfig                |  2 +-
 arch/mips/configs/pistachio_defconfig              |  2 +-
 arch/mips/configs/qi_lb60_defconfig                |  2 +-
 arch/mips/configs/rt305x_defconfig                 |  2 +-
 arch/mips/configs/xway_defconfig                   |  2 +-
 arch/parisc/configs/generic-64bit_defconfig        |  2 +-
 arch/powerpc/configs/40x/virtex_defconfig          |  2 +-
 arch/powerpc/configs/44x/fsp2_defconfig            |  2 +-
 arch/powerpc/configs/44x/virtex5_defconfig         |  2 +-
 arch/powerpc/configs/44x/warp_defconfig            |  2 +-
 arch/powerpc/configs/52xx/cm5200_defconfig         |  2 +-
 arch/powerpc/configs/52xx/lite5200b_defconfig      |  2 +-
 arch/powerpc/configs/52xx/motionpro_defconfig      |  2 +-
 arch/powerpc/configs/52xx/tqm5200_defconfig        |  2 +-
 arch/powerpc/configs/gamecube_defconfig            |  2 +-
 arch/powerpc/configs/mpc5200_defconfig             |  2 +-
 arch/powerpc/configs/pasemi_defconfig              |  2 +-
 arch/powerpc/configs/wii_defconfig                 |  2 +-
 arch/s390/configs/default_defconfig                |  2 +-
 arch/s390/configs/gcov_defconfig                   |  2 +-
 arch/s390/configs/performance_defconfig            |  2 +-
 arch/s390/configs/zfcpdump_defconfig               |  2 +-
 arch/sh/configs/edosk7760_defconfig                |  2 +-
 arch/sh/configs/sdk7786_defconfig                  |  2 +-
 arch/sh/configs/se7722_defconfig                   |  2 +-
 arch/sh/configs/sh7785lcr_32bit_defconfig          |  2 +-
 arch/sh/configs/urquell_defconfig                  |  2 +-
 arch/sparc/configs/sparc64_defconfig               |  2 +-
 arch/x86/configs/i386_defconfig                    |  2 +-
 arch/x86/configs/x86_64_defconfig                  |  2 +-
 arch/xtensa/configs/audio_kc705_defconfig          |  2 +-
 arch/xtensa/configs/cadence_csp_defconfig          |  2 +-
 arch/xtensa/configs/generic_kc705_defconfig        |  2 +-
 arch/xtensa/configs/nommu_kc705_defconfig          |  2 +-
 arch/xtensa/configs/smp_lx200_defconfig            |  2 +-
 kernel/printk/printk.c                             | 36 ++++++++++++++++++++--
 lib/Kconfig.debug                                  |  7 +++--
 .../selftests/rcutorture/configs/lock/CFcommon     |  2 +-
 .../selftests/rcutorture/configs/rcu/CFcommon      |  2 +-
 .../selftests/rcutorture/configs/rcuperf/CFcommon  |  2 +-
 93 files changed, 130 insertions(+), 95 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +1 -1
index d9c171ce4190..c3b14abf9da4 100644
@@ -3189,7 +3189,7 @@
 			Default: ratelimit
 
 	printk.time=	Show timing data prefixed to each printk message line
-			Format: <bool>  (1/Y/y=enable, 0/N/n=disable)
+			Format: <string>  (1/Y/y=enable, 0/N/n=disable)
 
 	processor.max_cstate=	[HW,ACPI]
 			Limit processor to maximum C-state
arch/arm/configs/aspeed_g4_defconfig +1 -1
index cfc2465e8b77..a2eea1ec90a5 100644
@@ -162,7 +162,7 @@ CONFIG_JFFS2_FS_XATTR=y
 CONFIG_UBIFS_FS=y
 CONFIG_SQUASHFS=y
 CONFIG_SQUASHFS_XZ=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
arch/arm/configs/aspeed_g5_defconfig +1 -1
index 3c20d93de389..804c353f4cb2 100644
@@ -165,7 +165,7 @@ CONFIG_JFFS2_FS_XATTR=y
 CONFIG_UBIFS_FS=y
 CONFIG_SQUASHFS=y
 CONFIG_SQUASHFS_XZ=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
arch/arm/configs/axm55xx_defconfig +1 -1
index 8e17e7ed1f02..53c5dc35e930 100644
@@ -231,7 +231,7 @@ CONFIG_NFS_FSCACHE=y
 CONFIG_SUNRPC_DEBUG=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
arch/arm/configs/bcm2835_defconfig +1 -1
index 3ee9d78c412a..b6b990169fef 100644
@@ -141,7 +141,7 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_BOOT_PRINTK_DELAY=y
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
arch/arm/configs/colibri_pxa270_defconfig +1 -1
index 8995695fc118..b2b498348416 100644
@@ -144,7 +144,7 @@ CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
arch/arm/configs/colibri_pxa300_defconfig +1 -1
index d282e8b0bf33..9c716b3f7eb9 100644
@@ -51,7 +51,7 @@ CONFIG_EXT3_FS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_USER=y
arch/arm/configs/dove_defconfig +1 -1
index a93cc2fcf791..4d346feafff7 100644
@@ -118,7 +118,7 @@ CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_2=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 # CONFIG_SCHED_DEBUG is not set
arch/arm/configs/efm32_defconfig +1 -1
index 860d27138e6f..57508965aa77 100644
@@ -92,7 +92,7 @@ CONFIG_EXT2_FS=y
 CONFIG_ROMFS_FS=y
 CONFIG_ROMFS_BACKED_BY_MTD=y
 # CONFIG_NETWORK_FILESYSTEMS is not set
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
arch/arm/configs/exynos_defconfig +1 -1
index 25325ed9319e..c8e3e50e11b7 100644
@@ -253,7 +253,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
arch/arm/configs/ezx_defconfig +1 -1
index 23660f3d0f7f..0ada33fc3b4c 100644
@@ -363,7 +363,7 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
arch/arm/configs/h5000_defconfig +1 -1
index e90d1dfeb188..b8eeb3746646 100644
@@ -61,7 +61,7 @@ CONFIG_TMPFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 # CONFIG_NETWORK_FILESYSTEMS is not set
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
arch/arm/configs/hisi_defconfig +1 -1
index b2e340b272ee..4dc0a4a26c2f 100644
@@ -82,7 +82,7 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_FS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
arch/arm/configs/imote2_defconfig +1 -1
index f204017c26b9..ad64ef5bf1a3 100644
@@ -336,7 +336,7 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
arch/arm/configs/imx_v6_v7_defconfig +1 -1
index e74de69caeab..7ad72116eea9 100644
@@ -382,7 +382,7 @@ CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_SCHED_DEBUG is not set
arch/arm/configs/keystone_defconfig +1 -1
index 1331f6dc456a..51f4a5914059 100644
@@ -200,7 +200,7 @@ CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_SHIRQ=y
 CONFIG_DEBUG_USER=y
arch/arm/configs/lpc18xx_defconfig +1 -1
index 23df2518203d..72db8de33e84 100644
@@ -160,7 +160,7 @@ CONFIG_EXT2_FS=y
 # CONFIG_INOTIFY_USER is not set
 CONFIG_JFFS2_FS=y
 # CONFIG_NETWORK_FILESYSTEMS is not set
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
arch/arm/configs/magician_defconfig +1 -1
index ec5674c229a3..32ecf552a14d 100644
@@ -154,7 +154,7 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_1251=m
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
 CONFIG_TIMER_STATS=y
arch/arm/configs/mmp2_defconfig +1 -1
index 1eeee7f11d91..b1eb8f2da3a3 100644
@@ -74,7 +74,7 @@ CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
arch/arm/configs/moxart_defconfig +1 -1
index 2da0d9ee2107..c91605a17074 100644
@@ -123,7 +123,7 @@ CONFIG_EXT3_FS=y
 CONFIG_TMPFS=y
 CONFIG_CONFIGFS_FS=y
 CONFIG_JFFS2_FS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
arch/arm/configs/mps2_defconfig +1 -1
index 0bcdec7cc169..ce119cdd1d33 100644
@@ -98,7 +98,7 @@ CONFIG_NFS_V4_1=y
 CONFIG_NFS_V4_2=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
arch/arm/configs/multi_v7_defconfig +1 -1
index 4d19c1b4b8e7..59e72eeaf7e8 100644
@@ -929,7 +929,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOCKUP_DETECTOR=y
arch/arm/configs/mvebu_v7_defconfig +1 -1
index 69553704f2dc..a9f750c9b162 100644
@@ -152,7 +152,7 @@ CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_2=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
arch/arm/configs/mxs_defconfig +1 -1
index e5822ab01b7d..998b3be6d4bf 100644
@@ -167,7 +167,7 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_15=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_FRAME_WARN=2048
 CONFIG_UNUSED_SYMBOLS=y
arch/arm/configs/omap2plus_defconfig +1 -1
index a120ae816260..495940dde8fe 100644
@@ -493,7 +493,7 @@ CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_INFO_SPLIT=y
 CONFIG_DEBUG_INFO_DWARF4=y
arch/arm/configs/pxa168_defconfig +1 -1
index e7c7b91b6de2..3de60f0b5f2c 100644
@@ -50,7 +50,7 @@ CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_PREEMPT is not set
arch/arm/configs/pxa3xx_defconfig +1 -1
index bfea6874b0a1..0a579b68c83a 100644
@@ -109,7 +109,7 @@ CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_SHIRQ=y
arch/arm/configs/pxa910_defconfig +1 -1
index 3aff71e6dae5..966e606ae100 100644
@@ -58,7 +58,7 @@ CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_PREEMPT is not set
arch/arm/configs/pxa_defconfig +1 -1
index 64e3a2a8cede..6a6baf309aa3 100644
@@ -727,7 +727,7 @@ CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 CONFIG_FRAME_WARN=0
arch/arm/configs/qcom_defconfig +1 -1
index b02039c712c3..dfc984afc4c7 100644
@@ -231,7 +231,7 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 CONFIG_MAGIC_SYSRQ=y
arch/arm/configs/raumfeld_defconfig +1 -1
index e3dc80ead465..f0cf5f178f0f 100644
@@ -187,7 +187,7 @@ CONFIG_NLS_ISO8859_15=y
 CONFIG_NLS_KOI8_R=y
 CONFIG_NLS_KOI8_U=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_USER=y
arch/arm/configs/shmobile_defconfig +1 -1
index 3c66a422fb4d..ef3a92ebc2fd 100644
@@ -218,7 +218,7 @@ CONFIG_NFS_V4_1=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
 # CONFIG_ARM_UNWIND is not set
arch/arm/configs/socfpga_defconfig +1 -1
index 2620ce790db0..25f751956338 100644
@@ -155,7 +155,7 @@ CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DETECT_HUNG_TASK=y
arch/arm/configs/stm32_defconfig +1 -1
index 90e5c46913a5..ff2b87638feb 100644
@@ -74,7 +74,7 @@ CONFIG_STM32_ADC=y
 # CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY_USER is not set
 CONFIG_NLS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
arch/arm/configs/sunxi_defconfig +1 -1
index 0ec1d1ec130f..b5ef2a35dcc5 100644
@@ -151,6 +151,6 @@ CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_FS=y
 CONFIG_CRYPTO_DEV_SUN4I_SS=y
arch/arm/configs/tango4_defconfig +1 -1
index 68725d4eae45..2c6a9dca57f9 100644
@@ -90,5 +90,5 @@ CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_CRYPTO_ECHAINIV is not set
arch/arm/configs/tegra_defconfig +1 -1
index f0efc854b5a2..4253b642b008 100644
@@ -286,7 +286,7 @@ CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
arch/arm/configs/u300_defconfig +1 -1
index 36d77406e31b..c4e9fe4529dd 100644
@@ -62,7 +62,7 @@ CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
 # CONFIG_SCHED_DEBUG is not set
arch/arm/configs/u8500_defconfig +1 -1
index e2151a7aaf49..0566e2732b86 100644
@@ -127,7 +127,7 @@ CONFIG_NFS_FS=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
arch/arm/configs/vt8500_v6_v7_defconfig +1 -1
index 1bfaa7bfc392..d5a2cc807940 100644
@@ -84,6 +84,6 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOCKUP_DETECTOR=y
arch/arm/configs/xcep_defconfig +1 -1
index 2eda24635e65..0b25bff6b928 100644
@@ -79,7 +79,7 @@ CONFIG_NFS_V3=y
 CONFIG_NLS=m
 CONFIG_NLS_DEFAULT="utf8"
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
arch/arm/configs/zx_defconfig +1 -1
index dfc061d87d2f..fe4fae21ccfa 100644
@@ -95,7 +95,7 @@ CONFIG_TMPFS_POSIX_ACL=y
 CONFIG_NLS_CODEPAGE_936=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_INFO=y
arch/arm64/configs/defconfig +1 -1
index 6c7d147eed54..351968d0af49 100644
@@ -548,7 +548,7 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_VIRTUALIZATION=y
 CONFIG_KVM=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
arch/m68k/configs/amcore_defconfig +1 -1
index 131b4101ae5d..8866b5d622ba 100644
@@ -107,7 +107,7 @@ CONFIG_JFFS2_FS=y
 CONFIG_ROMFS_FS=y
 CONFIG_ROMFS_BACKED_BY_BOTH=y
 # CONFIG_NETWORK_FILESYSTEMS is not set
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
arch/mips/configs/ath25_defconfig +1 -1
index 2c829950be17..8d488cfd5e66 100644
@@ -105,7 +105,7 @@ CONFIG_SQUASHFS_FILE_DIRECT=y
 CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
 # CONFIG_SQUASHFS_ZLIB is not set
 CONFIG_SQUASHFS_XZ=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
arch/mips/configs/bcm47xx_defconfig +1 -1
index fad8e964f14c..e4a29db1c416 100644
@@ -74,7 +74,7 @@ CONFIG_USB_HCD_BCMA=y
 CONFIG_USB_HCD_SSB=y
 CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_INFO_REDUCED=y
 CONFIG_STRIP_ASM_SYMS=y
arch/mips/configs/bmips_be_defconfig +1 -1
index a7072a14d396..8133a2809fd6 100644
@@ -32,7 +32,7 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_BRCMSTB_GISB_ARB=y
 CONFIG_MTD=y
 CONFIG_MTD_BCM63XX_PARTS=y
arch/mips/configs/bmips_stb_defconfig +1 -1
index 3cefa6bc01dd..44269214aa88 100644
@@ -85,7 +85,7 @@ CONFIG_CIFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_CMDLINE_BOOL=y
arch/mips/configs/ci20_defconfig +1 -1
index b42cfa7865f9..f7fbcec8c03a 100644
@@ -147,7 +147,7 @@ CONFIG_NLS_ISO8859_15=y
 CONFIG_NLS_KOI8_R=y
 CONFIG_NLS_KOI8_U=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
arch/mips/configs/generic_defconfig +1 -1
index 91aacf2ef26d..b077a49e4a41 100644
@@ -83,7 +83,7 @@ CONFIG_NFS_V4=y
 CONFIG_NFS_V4_1=y
 CONFIG_NFS_V4_2=y
 CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_INFO_REDUCED=y
 CONFIG_DEBUG_FS=y
arch/mips/configs/lemote2f_defconfig +1 -1
index 1ec8ed8d05d1..ce702017e3d4 100644
@@ -394,7 +394,7 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_FRAME_WARN=1024
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
arch/mips/configs/loongson3_defconfig +1 -1
index 324dfee23dfb..770ba1bb6eab 100644
@@ -327,7 +327,7 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_936=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_FRAME_WARN=1024
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_MAGIC_SYSRQ=y
arch/mips/configs/nlm_xlp_defconfig +1 -1
index 5720ce23e9aa..8419baf8e993 100644
@@ -549,7 +549,7 @@ CONFIG_NLS_ISO8859_14=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_FRAME_WARN=1024
arch/mips/configs/nlm_xlr_defconfig +1 -1
index fea56c535d92..e52af0b225ec 100644
@@ -506,7 +506,7 @@ CONFIG_NLS_ISO8859_14=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_UNUSED_SYMBOLS=y
arch/mips/configs/pistachio_defconfig +1 -1
index 7d32fbbca962..03fe8e9c08bb 100644
@@ -297,7 +297,7 @@ CONFIG_NLS_DEFAULT="utf8"
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0
arch/mips/configs/qi_lb60_defconfig +1 -1
index 3f1333517405..4f1a9c550157 100644
@@ -170,7 +170,7 @@ CONFIG_NLS_ISO8859_15=y
 CONFIG_NLS_KOI8_R=y
 CONFIG_NLS_KOI8_U=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_READABLE_ASM=y
arch/mips/configs/rt305x_defconfig +1 -1
index c695b7b1c4ae..2d82dd8a0d65 100644
@@ -143,7 +143,7 @@ CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 CONFIG_SQUASHFS=y
 # CONFIG_SQUASHFS_ZLIB is not set
 CONFIG_SQUASHFS_XZ=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_STRIP_ASM_SYMS=y
arch/mips/configs/xway_defconfig +1 -1
index 4365108bef77..a8dbf51d2dd2 100644
@@ -151,7 +151,7 @@ CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 CONFIG_SQUASHFS=y
 # CONFIG_SQUASHFS_ZLIB is not set
 CONFIG_SQUASHFS_XZ=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
arch/parisc/configs/generic-64bit_defconfig +1 -1
index c564e6e1fa23..06d6c12d2bae 100644
@@ -279,7 +279,7 @@ CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_2=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_UNUSED_SYMBOLS=y
 CONFIG_DEBUG_FS=y
arch/powerpc/configs/40x/virtex_defconfig +1 -1
index 65dc084a154c..97619a504281 100644
@@ -71,7 +71,7 @@ CONFIG_CRC_CCITT=y
 CONFIG_FONTS=y
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
arch/powerpc/configs/44x/fsp2_defconfig +1 -1
index e8e6a6999852..204af7941cc9 100644
@@ -111,7 +111,7 @@ CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_DEFAULT="n"
 CONFIG_XZ_DEC=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
arch/powerpc/configs/44x/virtex5_defconfig +1 -1
index ce052064bcbb..5e843f38f170 100644
@@ -70,7 +70,7 @@ CONFIG_CRC_CCITT=y
 CONFIG_FONTS=y
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
arch/powerpc/configs/44x/warp_defconfig +1 -1
index ab932488e68b..0bc1951a2dda 100644
@@ -90,7 +90,7 @@ CONFIG_NLS_ISO8859_15=y
 CONFIG_NLS_UTF8=y
 CONFIG_CRC_CCITT=y
 CONFIG_CRC_T10DIF=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
arch/powerpc/configs/52xx/cm5200_defconfig +1 -1
index c1faac800806..87374742d175 100644
@@ -72,7 +72,7 @@ CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DETECT_HUNG_TASK=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_CRYPTO_ECB=y
arch/powerpc/configs/52xx/lite5200b_defconfig +1 -1
index 9493b02ac660..4f9a8a38c601 100644
@@ -58,7 +58,7 @@ CONFIG_TMPFS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DETECT_HUNG_TASK=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
arch/powerpc/configs/52xx/motionpro_defconfig +1 -1
index fe8126bc1655..f6ce4414e812 100644
@@ -84,7 +84,7 @@ CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DETECT_HUNG_TASK=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
arch/powerpc/configs/52xx/tqm5200_defconfig +1 -1
index b8b316b884aa..b9fa1bb55560 100644
@@ -86,7 +86,7 @@ CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DETECT_HUNG_TASK=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
arch/powerpc/configs/gamecube_defconfig +1 -1
index c0eec4a5df4e..de0c808c17c1 100644
@@ -89,7 +89,7 @@ CONFIG_CIFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_CRC_CCITT=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_SPINLOCK=y
 CONFIG_DEBUG_MUTEXES=y
 CONFIG_LATENCYTOP=y
arch/powerpc/configs/mpc5200_defconfig +1 -1
index 88336d0df0d6..bd407cc11ebd 100644
@@ -126,7 +126,7 @@ CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DETECT_HUNG_TASK=y
arch/powerpc/configs/pasemi_defconfig +1 -1
index fe43ff47bd2f..6471b5f02125 100644
@@ -166,7 +166,7 @@ CONFIG_NFSD_V4=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_CRC_CCITT=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
arch/powerpc/configs/wii_defconfig +1 -1
index dcdd51b57783..f06d394d7153 100644
@@ -110,7 +110,7 @@ CONFIG_CIFS=m
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_CRC_CCITT=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_SPINLOCK=y
 CONFIG_DEBUG_MUTEXES=y
arch/s390/configs/default_defconfig +1 -1
index 282072206df7..d60240703b87 100644
@@ -564,7 +564,7 @@ CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
 CONFIG_DLM=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_INFO_DWARF4=y
arch/s390/configs/gcov_defconfig +1 -1
index 3c6b78189fbc..f646d908cc16 100644
@@ -558,7 +558,7 @@ CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
 CONFIG_DLM=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_INFO_DWARF4=y
 CONFIG_GDB_SCRIPTS=y
arch/s390/configs/performance_defconfig +1 -1
index 653d72bcc007..bd5cd53ad6fe 100644
@@ -556,7 +556,7 @@ CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
 CONFIG_DLM=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_INFO_DWARF4=y
 CONFIG_GDB_SCRIPTS=y
arch/s390/configs/zfcpdump_defconfig +1 -1
index afa46a7406ea..64fa6b10dbc1 100644
@@ -57,7 +57,7 @@ CONFIG_RAW_DRIVER=y
 CONFIG_CONFIGFS_FS=y
 # CONFIG_MISC_FILESYSTEMS is not set
 # CONFIG_NETWORK_FILESYSTEMS is not set
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_PANIC_ON_OOPS=y
arch/sh/configs/edosk7760_defconfig +1 -1
index e1077a041ac3..e588da2ba566 100644
@@ -109,7 +109,7 @@ CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_15=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_UNUSED_SYMBOLS=y
arch/sh/configs/sdk7786_defconfig +1 -1
index 36642ec2cb97..280695c64d3e 100644
@@ -215,7 +215,7 @@ CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_MAGIC_SYSRQ=y
arch/sh/configs/se7722_defconfig +1 -1
index ae998c7e2ee0..09aac57eddb7 100644
@@ -53,7 +53,7 @@ CONFIG_EXT3_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_HUGETLBFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
arch/sh/configs/sh7785lcr_32bit_defconfig +1 -1
index 2fce54d9c388..977b6174ece0 100644
@@ -144,7 +144,7 @@ CONFIG_NFSD_V3=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_932=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
arch/sh/configs/urquell_defconfig +1 -1
index 01c9a91ee896..79723309fcfa 100644
@@ -142,7 +142,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_932=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_DEBUG_FS=y
arch/sparc/configs/sparc64_defconfig +1 -1
index b2e650d1764f..5cb77afd6d20 100644
@@ -202,7 +202,7 @@ CONFIG_EXT3_FS_SECURITY=y
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_HUGETLBFS=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
arch/x86/configs/i386_defconfig +1 -1
index 6cf79e1a6830..9752adff0949 100644
@@ -287,7 +287,7 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
arch/x86/configs/x86_64_defconfig +1 -1
index de45f57b410d..7be6f8538cbc 100644
@@ -286,7 +286,7 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
arch/xtensa/configs/audio_kc705_defconfig +1 -1
index 8d16925765cb..92eb1351e23a 100644
@@ -123,7 +123,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_SUNRPC_DEBUG=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 CONFIG_MAGIC_SYSRQ=y
arch/xtensa/configs/cadence_csp_defconfig +1 -1
index f2d3094aa1d1..69aadc4a7c11 100644
@@ -102,7 +102,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_SUNRPC_DEBUG=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 CONFIG_MAGIC_SYSRQ=y
arch/xtensa/configs/generic_kc705_defconfig +1 -1
index 744adeaf2945..1d1b4e8a2004 100644
@@ -110,7 +110,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_SUNRPC_DEBUG=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 CONFIG_MAGIC_SYSRQ=y
arch/xtensa/configs/nommu_kc705_defconfig +1 -1
index 78c2529d0459..09dfc089d7df 100644
@@ -107,7 +107,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_SUNRPC_DEBUG=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_FRAME_POINTER is not set
arch/xtensa/configs/smp_lx200_defconfig +1 -1
index 14e3ca353ac8..3b4e87f24e75 100644
@@ -114,7 +114,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_SUNRPC_DEBUG=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_INFO=y
 CONFIG_MAGIC_SYSRQ=y
kernel/printk/printk.c +34 -2
index fc47863f629c..26cf6cadd267 100644
@@ -1202,8 +1202,40 @@ static inline void boot_delay_msec(int level)
 }
 #endif
 
-static bool printk_time = IS_ENABLED(CONFIG_PRINTK_TIME);
-module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
+static int printk_time = CONFIG_PRINTK_TIME;
+
+static int printk_time_set(const char *val, const struct kernel_param *kp)
+{
+	char *param = strstrip((char *)val);
+
+	if (strlen(param) != 1)
+		return -EINVAL;
+
+	if (!strncmp("0", param, 1) || !strncmp("n", param, 1) ||
+	    !strncmp("N", param, 1)) {
+		printk_time = 0;
+	} else if (!strncmp("1", param, 1) || !strncmp("y", param, 1) ||
+		   !strncmp("Y", param, 1)) {
+		printk_time = 1;
+	} else {
+		pr_warn("printk: invalid timestamp value %s.\n", param);
+		return -EINVAL;
+	}
+
+	pr_info("printk: timestamp set to %d.\n", printk_time);
+	return 0;
+}
+
+static int printk_time_get(char *buffer, const struct kernel_param *kp)
+{
+	return scnprintf(buffer, PAGE_SIZE, "%d", printk_time);
+}
+
+static struct kernel_param_ops printk_time_ops = {
+	.set = printk_time_set,
+	.get = printk_time_get,
+};
+module_param_cb(time, &printk_time_ops, NULL, S_IRUGO | S_IWUSR);
 
 static size_t print_time(u64 ts, char *buf)
 {
lib/Kconfig.debug +5 -2
index 98fe715522e8..5b1662ec546f 100644
@@ -1,7 +1,9 @@
 menu "printk and dmesg options"
 
 config PRINTK_TIME
-	bool "Show timing information on printks"
+	int "Show timing information on printks (0-1)"
+	range 0 1
+	default "0"
 	depends on PRINTK
 	help
 	  Selecting this option causes time stamps of the printk()
@@ -10,7 +12,8 @@ config PRINTK_TIME
 
 	  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.
+	  be included, not that the timestamp is recorded. 0 disables the
+	  timestamp and 1 uses the local clock.
 
 	  The behavior is also controlled by the kernel command line
 	  parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst
tools/testing/selftests/rcutorture/configs/lock/CFcommon +1 -1
index e372dc269254..779f984fb25c 100644
@@ -1,2 +1,2 @@
 CONFIG_LOCK_TORTURE_TEST=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
tools/testing/selftests/rcutorture/configs/rcu/CFcommon +1 -1
index d2d2a86139db..784fd5d724dd 100644
@@ -1,2 +1,2 @@
 CONFIG_RCU_TORTURE_TEST=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon +1 -1
index a09816b8c0f3..edd5a7bf4b12 100644
@@ -1,2 +1,2 @@
 CONFIG_RCU_PERF_TEST=y
-CONFIG_PRINTK_TIME=y
+CONFIG_PRINTK_TIME=1
Signature · 1 line
1.8.5.5
#2 lore raw

Re: [PATCH 1/2] printk: Make CONFIG_PRINTK_TIME an int

kernel/printk/printk.c static inline void boot_delay_msec(int level) · line 1205

Quoted 11 lines · Prarit Bhargava
kernel/printk/printk.c +1 -2
index fc47863f629c..26cf6cadd267 100644
@@ -1202,8 +1202,40 @@ static inline void boot_delay_msec(int level)
 }
 #endif
 
-static bool printk_time = IS_ENABLED(CONFIG_PRINTK_TIME);
-module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
+static int printk_time = CONFIG_PRINTK_TIME;

You could just use unsigned int but is the reason you went with int to enable backward compatibility with the old bool =y or =n?

Luis

#3 lore raw

Re: [PATCH 1/2] printk: Make CONFIG_PRINTK_TIME an int

Quoted 9 lines · Luis R. Rodriguez
Quoted 8 lines · Prarit Bhargava
kernel/printk/printk.c +0 -0
index fc47863f629c..26cf6cadd267 100644
@@ -1202,8 +1202,40 @@ static inline void boot_delay_msec(int level)
 }
 #endif
 
Quoted 6 lines

kernel/printk/printk.c static inline void boot_delay_msec(int level) · line 1205

Quoted 3 lines
kernel/printk/printk.c +1 -2
-static bool printk_time = IS_ENABLED(CONFIG_PRINTK_TIME);
-module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
+static int printk_time = CONFIG_PRINTK_TIME;

You could just use unsigned int but is the reason you went with int to enable backward compatibility with the old bool =y or =n?

Yes, I wanted to preserve backwards compatibility.

P.

#4 lore raw

PATCH 2/2 printk: Add boottime and real timestamps

In reply to Prarit Bhargava

printk.time=1/CONFIG_PRINTK_TIME=Y timestamps printks with an unmodified hardware clock timestamp. This clock loses time each day making it difficult to determine when an issue has occurred in the kernel log.

Modify printk.time to output local, monotonic, or a real timestamp. Modify the output of /sys/module/printk/parameters/time to output the type of clock 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().

Cc Mark Salyzyn <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc John Stultz <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc "Paul E. McKenney" <[email protected]>
Cc Christoffer Dall <[email protected]>
Cc Deepa Dinamani <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Joel Fernandes <[email protected]>
Cc Kees Cook <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc "Luis R. Rodriguez" <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc "Jason A. Donenfeld" <[email protected]>
Cc Olof Johansson <[email protected]>
Cc "Theodore Ts'o" <[email protected]>
Cc Josh Poimboeuf <[email protected]>
---
 Documentation/admin-guide/kernel-parameters.txt |  6 +-
 include/linux/timekeeping.h                     |  1 +
 kernel/printk/printk.c                          | 77 +++++++++++++++++++++----
 kernel/time/timekeeping.c                       | 14 +++++
 lib/Kconfig.debug                               |  7 ++-
 5 files changed, 89 insertions(+), 16 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +4 -2
index c3b14abf9da4..c03240d057b1 100644
@@ -3188,8 +3188,10 @@
 			ratelimit - ratelimit the logging
 			Default: ratelimit
 
-	printk.time=	Show timing data prefixed to each printk message line
-			Format: <string>  (1/Y/y=enable, 0/N/n=disable)
+	printk.time=	Show timestamp prefixed to each printk message line
+			Format: <string>
+				(0/N/n = disable, 1/Y/y = local/unadjusted HW,
+				 2 = monotonic, 3 = real)
 
 	processor.max_cstate=	[HW,ACPI]
 			Limit processor to maximum C-state
include/linux/timekeeping.h +1 -0
index ddc229ff6d1e..adb84af42deb 100644
@@ -239,6 +239,7 @@ static inline u64 ktime_get_raw_ns(void)
 extern u64 ktime_get_mono_fast_ns(void);
 extern u64 ktime_get_raw_fast_ns(void);
 extern u64 ktime_get_boot_fast_ns(void);
+extern u64 ktime_get_log_ts(u64 *offset_real);
 
 /*
  * Timespec interfaces utilizing the ktime based ones
kernel/printk/printk.c +66 -11

124 lines not on this page · raw message

kernel/time/timekeeping.c +14 -0
index cedafa008de5..96f06a16c51f 100644
@@ -25,6 +25,7 @@
 #include <linux/stop_machine.h>
 #include <linux/pvclock_gtod.h>
 #include <linux/compiler.h>
+#include <linux/sched/clock.h>
 
 #include "tick-internal.h"
 #include "ntp_internal.h"
@@ -45,6 +46,7 @@
 
 static DEFINE_RAW_SPINLOCK(timekeeper_lock);
 static struct timekeeper shadow_timekeeper;
+static int timekeeping_active;
 
 /**
  * struct tk_fast - NMI safe timekeeper
@@ -477,6 +479,16 @@ u64 notrace ktime_get_boot_fast_ns(void)
 }
 EXPORT_SYMBOL_GPL(ktime_get_boot_fast_ns);
 
+u64 ktime_get_log_ts(u64 *offset_real)
+{
+	*offset_real = ktime_to_ns(tk_core.timekeeper.offs_real);
+
+	if (timekeeping_active)
+		return ktime_get_mono_fast_ns();
+	else
+		return local_clock();
+}
+
 /* Suspend-time cycles value for halted fast timekeeper. */
 static u64 cycles_at_suspend;
 
@@ -1530,6 +1542,8 @@ void __init timekeeping_init(void)
 
 	write_seqcount_end(&tk_core.seq);
 	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+
+	timekeeping_active = 1;
 }
 
 /* time in seconds when suspend began for persistent clock */
lib/Kconfig.debug +4 -3
index 5b1662ec546f..6cd38a25f8ea 100644
@@ -1,8 +1,8 @@
 menu "printk and dmesg options"
 
 config PRINTK_TIME
-	int "Show timing information on printks (0-1)"
-	range 0 1
+	int "Show timing information on printks (0-3)"
+	range 0 3
 	default "0"
 	depends on PRINTK
 	help
@@ -13,7 +13,8 @@ config PRINTK_TIME
 	  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. 0 disables the
-	  timestamp and 1 uses the local clock.
+	  timestamp and 1 uses the local clock, 2 uses the monotonic clock, and
+	  3 uses real clock.
 
 	  The behavior is also controlled by the kernel command line
 	  parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst
Signature · 1 line
1.8.5.5
#5 lore raw

Re: [PATCH 2/2] printk: Add boottime and real timestamps

Quoted 16 lines · Prarit Bhargava
lib/Kconfig.debug +2 -2
index 5b1662ec546f..6cd38a25f8ea 100644
@@ -1,8 +1,8 @@
 menu "printk and dmesg options"
 
 config PRINTK_TIME
-	int "Show timing information on printks (0-1)"
-	range 0 1
+	int "Show timing information on printks (0-3)"
+	range 0 3
 	default "0"
 	depends on PRINTK
 	help

lib/Kconfig.debug config PRINTK_TIME · line 20

Quoted 9 lines
lib/Kconfig.debug +2 -1
@@ -13,7 +13,8 @@ config PRINTK_TIME
 	  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. 0 disables the
-	  timestamp and 1 uses the local clock.
+	  timestamp and 1 uses the local clock, 2 uses the monotonic clock, and
+	  3 uses real clock.
 
 	  The behavior is also controlled by the kernel command line
 	  parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst

choice
prompt "printk default clock"
default PRIMTK_TIME_DISABLE
help
goes here

config PRINTK_TIME_DISABLE
bool "Disabled"
help
goes here

config PRINTK_TIME_LOCAL
bool "local clock"
help
goes here

config PRINTK_TIME_MONO
bool "CLOCK_MONOTONIC"
help
goes here

config PRINTK_TIME_REAL
bool "CLOCK_REALTIME"
help
goes here

endchoice

config PRINTK_TIME
int
default 0 if PRINTK_TIME_DISABLE
default 1 if PRINTK_TIME_LOCAL
default 2 if PRINTK_TIME_MONO
default 3 if PRINTK_TIME_REAL

Although I must strongly discourage using REALTIME, DST will make untangling your logs an absolute nightmare. I would simply not provide it.

#6 lore raw

Re: [PATCH 2/2] printk: Add boottime and real timestamps

Quoted 63 lines · Peter Zijlstra
Quoted 16 lines · Prarit Bhargava
lib/Kconfig.debug +2 -2
index 5b1662ec546f..6cd38a25f8ea 100644
@@ -1,8 +1,8 @@
  menu "printk and dmesg options"
 
  config PRINTK_TIME
-	int "Show timing information on printks (0-1)"
-	range 0 1
+	int "Show timing information on printks (0-3)"
+	range 0 3
  	default "0"
  	depends on PRINTK
  	help

lib/Kconfig.debug config PRINTK_TIME · line 20

Quoted 9 lines
lib/Kconfig.debug +2 -1
@@ -13,7 +13,8 @@ config PRINTK_TIME
  	  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. 0 disables the
-	  timestamp and 1 uses the local clock.
+	  timestamp and 1 uses the local clock, 2 uses the monotonic clock, and
+	  3 uses real clock.
 
  	  The behavior is also controlled by the kernel command line
  	  parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst

choice
prompt "printk default clock"
default PRIMTK_TIME_DISABLE
help
goes here

config PRINTK_TIME_DISABLE
bool "Disabled"
help
goes here

config PRINTK_TIME_LOCAL
bool "local clock"
help
goes here

config PRINTK_TIME_MONO
bool "CLOCK_MONOTONIC"
help
goes here

config PRINTK_TIME_REAL
bool "CLOCK_REALTIME"
help
goes here

endchoice

config PRINTK_TIME
int
default 0 if PRINTK_TIME_DISABLE
default 1 if PRINTK_TIME_LOCAL
default 2 if PRINTK_TIME_MONO
default 3 if PRINTK_TIME_REAL

Quoted 3 lines

Although I must strongly discourage using REALTIME, DST will make untangling your logs an absolute nightmare. I would simply not provide it.

I agree with using select, ensures only valid values are landed. It does mean that CONFIG_PRINTK_TIME in-effect gets deprecated.

REALTIME is always UTC in the kernel.

What about BOOTTIME?

-- Mark

#7 lore raw

Re: [PATCH 2/2] printk: Add boottime and real timestamps

In reply to Peter Zijlstra
Quoted 54 lines · Peter Zijlstra
Quoted 16 lines · Prarit Bhargava
lib/Kconfig.debug +2 -2
index 5b1662ec546f..6cd38a25f8ea 100644
@@ -1,8 +1,8 @@
 menu "printk and dmesg options"
 
 config PRINTK_TIME
-	int "Show timing information on printks (0-1)"
-	range 0 1
+	int "Show timing information on printks (0-3)"
+	range 0 3
 	default "0"
 	depends on PRINTK
 	help

lib/Kconfig.debug config PRINTK_TIME · line 20

Quoted 9 lines
lib/Kconfig.debug +2 -1
@@ -13,7 +13,8 @@ config PRINTK_TIME
 	  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. 0 disables the
-	  timestamp and 1 uses the local clock.
+	  timestamp and 1 uses the local clock, 2 uses the monotonic clock, and
+	  3 uses real clock.
 
 	  The behavior is also controlled by the kernel command line
 	  parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst

choice
prompt "printk default clock"
default PRIMTK_TIME_DISABLE
help
goes here

config PRINTK_TIME_DISABLE
bool "Disabled"
help
goes here

config PRINTK_TIME_LOCAL
bool "local clock"
help
goes here

config PRINTK_TIME_MONO
bool "CLOCK_MONOTONIC"
help
goes here

config PRINTK_TIME_REAL
bool "CLOCK_REALTIME"
help
goes here

Quoted 10 lines

endchoice

config PRINTK_TIME
int
default 0 if PRINTK_TIME_DISABLE
default 1 if PRINTK_TIME_LOCAL
default 2 if PRINTK_TIME_MONO
default 3 if PRINTK_TIME_REAL

Thanks for the above change. I can see that makes the code simpler.

Quoted 3 lines

Although I must strongly discourage using REALTIME, DST will make untangling your logs an absolute nightmare. I would simply not provide it.

I understand your concern, however, I've been in situations where REALTIME stamping has pointed me in the direction of where a bug was. Even with the complicated logs I think it is worthwhile.

P.

#8 lore raw

Re: [PATCH 2/2] printk: Add boottime and real timestamps

Quoted 10 lines · Prarit Bhargava

On 07/25/2017 09:00 AM, Peter Zijlstra wrote:
Thanks for the above change. I can see that makes the code simpler.

Quoted 3 lines

Although I must strongly discourage using REALTIME, DST will make untangling your logs an absolute nightmare. I would simply not provide it.

I understand your concern, however, I've been in situations where REALTIME stamping has pointed me in the direction of where a bug was. Even with the complicated logs I think it is worthwhile.

As Mark pointed out. ktime_get_real() and the fast variant return UTC. The timezone mess plus the DST nonsense are done in user space.

Thanks,

tglx

#9 lore raw

Re: [PATCH 2/2] printk: Add boottime and real timestamps

In reply to Prarit Bhargava
url: https://github.com/0day-ci/linux/commits/Prarit-Bhargava/printk-allow-different-timestamps-for-printk-time/20170727-104148 config: i386-tinyconfig (attached as .config) compiler: gcc-6 (Debian…

Hi Prarit,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.13-rc2]
[cannot apply to next-20170726]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Prarit-Bhargava/printk-allow-different-timestamps-for-printk-time/20170727-104148
config: i386-tinyconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:

        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

kernel/printk/printk.c: In function 'printk_late_init':

>> kernel/printk/printk.c:2746:6: error: 'printk_time_setting' undeclared (first use in this function)
     if (printk_time_setting == 0)
         ^~~~~~~~~~~~~~~~~~~
   kernel/printk/printk.c:2746:6: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/printk/printk.c:2747:25: error: 'printk_time' undeclared (first use in this function)
      printk_time_setting = printk_time;
                            ^~~~~~~~~~~

vim +/printk_time_setting +2746 kernel/printk/printk.c

2724
2725 /*
2726 * Some boot consoles access data that is in the init section and which will
2727 * be discarded after the initcalls have been run. To make sure that no code
2728 * will access this data, unregister the boot consoles in a late initcall.
2729 *
2730 * If for some reason, such as deferred probe or the driver being a loadable
2731 * module, the real console hasn't registered yet at this point, there will
2732 * be a brief interval in which no messages are logged to the console, which
2733 * makes it difficult to diagnose problems that occur during this time.
2734 *
2735 * To mitigate this problem somewhat, only unregister consoles whose memory
2736 * intersects with the init section. Note that code exists elsewhere to get
2737 * rid of the boot console as soon as the proper console shows up, so there
2738 * won't be side-effects from postponing the removal.
2739 */
2740 static int __init printk_late_init(void)
2741 {
2742 struct console *con;
2743 int ret;
2744
2745 /* initialize printk_time settings */

> 2746		if (printk_time_setting == 0)
> 2747			printk_time_setting = printk_time;

2748
2749 for_each_console(con) {
2750 if (!keep_bootcon && con->flags & CON_BOOT) {
2751 /*
2752 * Make sure to unregister boot consoles whose data
2753 * resides in the init section before the init section
2754 * is discarded. Boot consoles whose data will stick
2755 * around will automatically be unregistered when the
2756 * proper console replaces them.
2757 */
2758 if (init_section_intersects(con, sizeof(*con)))
2759 unregister_console(con);
2760 }
2761 }
2762 ret = cpuhp_setup_state_nocalls(CPUHP_PRINTK_DEAD, "printk:dead", NULL,
2763 console_cpu_notify);
2764 WARN_ON(ret < 0);
2765 ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "printk:online",
2766 console_cpu_notify, NULL);
2767 WARN_ON(ret < 0);
2768 return 0;
2769 }
2770 late_initcall(printk_late_init);
2771

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation