[PATCH v2] printk: Add boottime and real timestamps

From: Prarit Bhargava
Date: Tue Aug 01 2017 - 08:55:39 EST


printk.time=1/CONFIG_PRINTK_TIME=1 adds a unmodified local hardware clock
timestamp to printk messages. The local hardware clock loses time each
day making it difficult to determine exactly when an issue has occurred in
the kernel log, and making it difficult to determine how kernel and
hardware issues relate to each other in real time.

Make printk output different timestampes by adding options for no
timestamp, the local hardware clock, the monotonic clock, and the real
clock. Allow a user to pick one of the clocks by using the printk.time
kernel parameter. Output the type of clock in
/sys/module/printk/parameters/time 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().

v2: Use peterz's suggested Kconfig options. Merge patchset together. Fix
i386 !CONFIG_PRINTK builds.

Signed-off-by: Prarit Bhargava <prarit@xxxxxxxxxx>
Cc: Mark Salyzyn <salyzyn@xxxxxxxxxxx>
Cc: Jonathan Corbet <corbet@xxxxxxx>
Cc: Petr Mladek <pmladek@xxxxxxxx>
Cc: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: John Stultz <john.stultz@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>
Cc: Christoffer Dall <cdall@xxxxxxxxxx>
Cc: Deepa Dinamani <deepa.kernel@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Joel Fernandes <joelaf@xxxxxxxxxx>
Cc: Prarit Bhargava <prarit@xxxxxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Cc: "Luis R. Rodriguez" <mcgrof@xxxxxxxxxx>
Cc: Nicholas Piggin <npiggin@xxxxxxxxx>
Cc: "Jason A. Donenfeld" <Jason@xxxxxxxxx>
Cc: Olof Johansson <olof@xxxxxxxxx>
Cc: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Cc: linux-doc@xxxxxxxxxxxxxxx
---
Documentation/admin-guide/kernel-parameters.txt | 6 +-
arch/arm/configs/aspeed_g4_defconfig | 4 +-
arch/arm/configs/aspeed_g5_defconfig | 4 +-
arch/arm/configs/axm55xx_defconfig | 4 +-
arch/arm/configs/bcm2835_defconfig | 4 +-
arch/arm/configs/colibri_pxa270_defconfig | 4 +-
arch/arm/configs/colibri_pxa300_defconfig | 4 +-
arch/arm/configs/dove_defconfig | 4 +-
arch/arm/configs/efm32_defconfig | 4 +-
arch/arm/configs/exynos_defconfig | 4 +-
arch/arm/configs/ezx_defconfig | 4 +-
arch/arm/configs/h5000_defconfig | 4 +-
arch/arm/configs/hisi_defconfig | 4 +-
arch/arm/configs/imote2_defconfig | 4 +-
arch/arm/configs/imx_v6_v7_defconfig | 4 +-
arch/arm/configs/keystone_defconfig | 4 +-
arch/arm/configs/lpc18xx_defconfig | 4 +-
arch/arm/configs/magician_defconfig | 4 +-
arch/arm/configs/mmp2_defconfig | 4 +-
arch/arm/configs/moxart_defconfig | 4 +-
arch/arm/configs/mps2_defconfig | 4 +-
arch/arm/configs/multi_v7_defconfig | 4 +-
arch/arm/configs/mvebu_v7_defconfig | 4 +-
arch/arm/configs/mxs_defconfig | 4 +-
arch/arm/configs/omap2plus_defconfig | 4 +-
arch/arm/configs/pxa168_defconfig | 4 +-
arch/arm/configs/pxa3xx_defconfig | 4 +-
arch/arm/configs/pxa910_defconfig | 4 +-
arch/arm/configs/pxa_defconfig | 4 +-
arch/arm/configs/qcom_defconfig | 4 +-
arch/arm/configs/raumfeld_defconfig | 4 +-
arch/arm/configs/shmobile_defconfig | 4 +-
arch/arm/configs/socfpga_defconfig | 4 +-
arch/arm/configs/stm32_defconfig | 4 +-
arch/arm/configs/sunxi_defconfig | 4 +-
arch/arm/configs/tango4_defconfig | 4 +-
arch/arm/configs/tegra_defconfig | 4 +-
arch/arm/configs/u300_defconfig | 4 +-
arch/arm/configs/u8500_defconfig | 4 +-
arch/arm/configs/vt8500_v6_v7_defconfig | 4 +-
arch/arm/configs/xcep_defconfig | 4 +-
arch/arm/configs/zx_defconfig | 4 +-
arch/arm64/configs/defconfig | 4 +-
arch/m68k/configs/amcore_defconfig | 4 +-
arch/mips/configs/ath25_defconfig | 4 +-
arch/mips/configs/bcm47xx_defconfig | 4 +-
arch/mips/configs/bmips_be_defconfig | 4 +-
arch/mips/configs/bmips_stb_defconfig | 4 +-
arch/mips/configs/ci20_defconfig | 4 +-
arch/mips/configs/generic_defconfig | 4 +-
arch/mips/configs/lemote2f_defconfig | 4 +-
arch/mips/configs/loongson3_defconfig | 4 +-
arch/mips/configs/nlm_xlp_defconfig | 4 +-
arch/mips/configs/nlm_xlr_defconfig | 4 +-
arch/mips/configs/pistachio_defconfig | 4 +-
arch/mips/configs/qi_lb60_defconfig | 4 +-
arch/mips/configs/rt305x_defconfig | 4 +-
arch/mips/configs/xway_defconfig | 4 +-
arch/parisc/configs/generic-64bit_defconfig | 4 +-
arch/powerpc/configs/40x/virtex_defconfig | 4 +-
arch/powerpc/configs/44x/fsp2_defconfig | 4 +-
arch/powerpc/configs/44x/virtex5_defconfig | 4 +-
arch/powerpc/configs/44x/warp_defconfig | 4 +-
arch/powerpc/configs/52xx/cm5200_defconfig | 4 +-
arch/powerpc/configs/52xx/lite5200b_defconfig | 4 +-
arch/powerpc/configs/52xx/motionpro_defconfig | 4 +-
arch/powerpc/configs/52xx/tqm5200_defconfig | 4 +-
arch/powerpc/configs/gamecube_defconfig | 4 +-
arch/powerpc/configs/mpc5200_defconfig | 4 +-
arch/powerpc/configs/pasemi_defconfig | 4 +-
arch/powerpc/configs/wii_defconfig | 4 +-
arch/s390/configs/default_defconfig | 4 +-
arch/s390/configs/gcov_defconfig | 4 +-
arch/s390/configs/performance_defconfig | 4 +-
arch/s390/configs/zfcpdump_defconfig | 4 +-
arch/sh/configs/edosk7760_defconfig | 4 +-
arch/sh/configs/sdk7786_defconfig | 4 +-
arch/sh/configs/se7722_defconfig | 4 +-
arch/sh/configs/sh7785lcr_32bit_defconfig | 4 +-
arch/sh/configs/urquell_defconfig | 4 +-
arch/sparc/configs/sparc64_defconfig | 4 +-
arch/x86/configs/i386_defconfig | 4 +-
arch/x86/configs/x86_64_defconfig | 8 +-
arch/xtensa/configs/audio_kc705_defconfig | 4 +-
arch/xtensa/configs/cadence_csp_defconfig | 4 +-
arch/xtensa/configs/generic_kc705_defconfig | 4 +-
arch/xtensa/configs/nommu_kc705_defconfig | 4 +-
arch/xtensa/configs/smp_lx200_defconfig | 4 +-
include/linux/timekeeping.h | 1 +
kernel/printk/printk.c | 97 +++++++++++++++++++++-
kernel/time/timekeeping.c | 14 ++++
lib/Kconfig.debug | 36 +++++++-
.../selftests/rcutorture/configs/lock/CFcommon | 4 +-
.../selftests/rcutorture/configs/rcu/CFcommon | 4 +-
.../selftests/rcutorture/configs/rcuperf/CFcommon | 4 +-
95 files changed, 420 insertions(+), 98 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index d9c171ce4190..c03240d057b1 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3188,8 +3188,10 @@
ratelimit - ratelimit the logging
Default: ratelimit

- printk.time= Show timing data prefixed to each printk message line
- Format: <bool> (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
diff --git a/arch/arm/configs/aspeed_g4_defconfig b/arch/arm/configs/aspeed_g4_defconfig
index cfc2465e8b77..6c73c305ad17 100644
--- a/arch/arm/configs/aspeed_g4_defconfig
+++ b/arch/arm/configs/aspeed_g4_defconfig
@@ -162,7 +162,9 @@ CONFIG_JFFS2_FS_XATTR=y
CONFIG_UBIFS_FS=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_XZ=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_STRIP_ASM_SYMS=y
CONFIG_DEBUG_FS=y
diff --git a/arch/arm/configs/aspeed_g5_defconfig b/arch/arm/configs/aspeed_g5_defconfig
index 3c20d93de389..6a5cf12eaa91 100644
--- a/arch/arm/configs/aspeed_g5_defconfig
+++ b/arch/arm/configs/aspeed_g5_defconfig
@@ -165,7 +165,9 @@ CONFIG_JFFS2_FS_XATTR=y
CONFIG_UBIFS_FS=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_XZ=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_STRIP_ASM_SYMS=y
CONFIG_DEBUG_FS=y
diff --git a/arch/arm/configs/axm55xx_defconfig b/arch/arm/configs/axm55xx_defconfig
index 8e17e7ed1f02..483e181d6be5 100644
--- a/arch/arm/configs/axm55xx_defconfig
+++ b/arch/arm/configs/axm55xx_defconfig
@@ -231,7 +231,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
index 3ee9d78c412a..098a58384e07 100644
--- a/arch/arm/configs/bcm2835_defconfig
+++ b/arch/arm/configs/bcm2835_defconfig
@@ -141,7 +141,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_BOOT_PRINTK_DELAY=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
diff --git a/arch/arm/configs/colibri_pxa270_defconfig b/arch/arm/configs/colibri_pxa270_defconfig
index 8995695fc118..a610d4183eec 100644
--- a/arch/arm/configs/colibri_pxa270_defconfig
+++ b/arch/arm/configs/colibri_pxa270_defconfig
@@ -144,7 +144,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
diff --git a/arch/arm/configs/colibri_pxa300_defconfig b/arch/arm/configs/colibri_pxa300_defconfig
index d282e8b0bf33..cf56177e674a 100644
--- a/arch/arm/configs/colibri_pxa300_defconfig
+++ b/arch/arm/configs/colibri_pxa300_defconfig
@@ -51,7 +51,9 @@ CONFIG_EXT3_FS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig
index a93cc2fcf791..ad26d0656723 100644
--- a/arch/arm/configs/dove_defconfig
+++ b/arch/arm/configs/dove_defconfig
@@ -118,7 +118,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/arm/configs/efm32_defconfig b/arch/arm/configs/efm32_defconfig
index 860d27138e6f..e230db5d83bf 100644
--- a/arch/arm/configs/efm32_defconfig
+++ b/arch/arm/configs/efm32_defconfig
@@ -92,7 +92,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
index 25325ed9319e..96e420b15983 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -253,7 +253,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FS=y
diff --git a/arch/arm/configs/ezx_defconfig b/arch/arm/configs/ezx_defconfig
index 23660f3d0f7f..23a97d604ada 100644
--- a/arch/arm/configs/ezx_defconfig
+++ b/arch/arm/configs/ezx_defconfig
@@ -363,7 +363,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/arm/configs/h5000_defconfig b/arch/arm/configs/h5000_defconfig
index e90d1dfeb188..7e8850a052b9 100644
--- a/arch/arm/configs/h5000_defconfig
+++ b/arch/arm/configs/h5000_defconfig
@@ -61,7 +61,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_KERNEL=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
diff --git a/arch/arm/configs/hisi_defconfig b/arch/arm/configs/hisi_defconfig
index b2e340b272ee..905fe5a92f35 100644
--- a/arch/arm/configs/hisi_defconfig
+++ b/arch/arm/configs/hisi_defconfig
@@ -82,7 +82,9 @@ CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_FS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
diff --git a/arch/arm/configs/imote2_defconfig b/arch/arm/configs/imote2_defconfig
index f204017c26b9..726911c0c101 100644
--- a/arch/arm/configs/imote2_defconfig
+++ b/arch/arm/configs/imote2_defconfig
@@ -336,7 +336,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index e74de69caeab..1d8692459ab2 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -382,7 +382,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig
index 1331f6dc456a..c463ca1067cd 100644
--- a/arch/arm/configs/keystone_defconfig
+++ b/arch/arm/configs/keystone_defconfig
@@ -200,7 +200,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_SHIRQ=y
CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/lpc18xx_defconfig b/arch/arm/configs/lpc18xx_defconfig
index 23df2518203d..bfa9df6e2568 100644
--- a/arch/arm/configs/lpc18xx_defconfig
+++ b/arch/arm/configs/lpc18xx_defconfig
@@ -160,7 +160,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig
index ec5674c229a3..069ac29b31d7 100644
--- a/arch/arm/configs/magician_defconfig
+++ b/arch/arm/configs/magician_defconfig
@@ -154,7 +154,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_KERNEL=y
# CONFIG_SCHED_DEBUG is not set
CONFIG_TIMER_STATS=y
diff --git a/arch/arm/configs/mmp2_defconfig b/arch/arm/configs/mmp2_defconfig
index 1eeee7f11d91..f40d89275751 100644
--- a/arch/arm/configs/mmp2_defconfig
+++ b/arch/arm/configs/mmp2_defconfig
@@ -74,7 +74,9 @@ CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
diff --git a/arch/arm/configs/moxart_defconfig b/arch/arm/configs/moxart_defconfig
index 2da0d9ee2107..b0fb2893740e 100644
--- a/arch/arm/configs/moxart_defconfig
+++ b/arch/arm/configs/moxart_defconfig
@@ -123,7 +123,9 @@ CONFIG_EXT3_FS=y
CONFIG_TMPFS=y
CONFIG_CONFIGFS_FS=y
CONFIG_JFFS2_FS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
diff --git a/arch/arm/configs/mps2_defconfig b/arch/arm/configs/mps2_defconfig
index 0bcdec7cc169..954be952e5bd 100644
--- a/arch/arm/configs/mps2_defconfig
+++ b/arch/arm/configs/mps2_defconfig
@@ -98,7 +98,9 @@ CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
CONFIG_ROOT_NFS=y
CONFIG_NLS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 4d19c1b4b8e7..5161bc074fb1 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -929,7 +929,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_LOCKUP_DETECTOR=y
diff --git a/arch/arm/configs/mvebu_v7_defconfig b/arch/arm/configs/mvebu_v7_defconfig
index 69553704f2dc..952eb28e825b 100644
--- a/arch/arm/configs/mvebu_v7_defconfig
+++ b/arch/arm/configs/mvebu_v7_defconfig
@@ -152,7 +152,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
index e5822ab01b7d..87599567caf6 100644
--- a/arch/arm/configs/mxs_defconfig
+++ b/arch/arm/configs/mxs_defconfig
@@ -167,7 +167,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_FRAME_WARN=2048
CONFIG_UNUSED_SYMBOLS=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index a120ae816260..7009dd462a30 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -493,7 +493,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_SPLIT=y
CONFIG_DEBUG_INFO_DWARF4=y
diff --git a/arch/arm/configs/pxa168_defconfig b/arch/arm/configs/pxa168_defconfig
index e7c7b91b6de2..3531ce135b4f 100644
--- a/arch/arm/configs/pxa168_defconfig
+++ b/arch/arm/configs/pxa168_defconfig
@@ -50,7 +50,9 @@ CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_PREEMPT is not set
diff --git a/arch/arm/configs/pxa3xx_defconfig b/arch/arm/configs/pxa3xx_defconfig
index bfea6874b0a1..4d66f114574c 100644
--- a/arch/arm/configs/pxa3xx_defconfig
+++ b/arch/arm/configs/pxa3xx_defconfig
@@ -109,7 +109,9 @@ CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
CONFIG_NLS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_SHIRQ=y
diff --git a/arch/arm/configs/pxa910_defconfig b/arch/arm/configs/pxa910_defconfig
index 3aff71e6dae5..6164a1d5a6e6 100644
--- a/arch/arm/configs/pxa910_defconfig
+++ b/arch/arm/configs/pxa910_defconfig
@@ -58,7 +58,9 @@ CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_PREEMPT is not set
diff --git a/arch/arm/configs/pxa_defconfig b/arch/arm/configs/pxa_defconfig
index 64e3a2a8cede..24115ea1f7ce 100644
--- a/arch/arm/configs/pxa_defconfig
+++ b/arch/arm/configs/pxa_defconfig
@@ -727,7 +727,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_FRAME_WARN=0
diff --git a/arch/arm/configs/qcom_defconfig b/arch/arm/configs/qcom_defconfig
index b02039c712c3..c60d96395bb9 100644
--- a/arch/arm/configs/qcom_defconfig
+++ b/arch/arm/configs/qcom_defconfig
@@ -231,7 +231,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/arm/configs/raumfeld_defconfig b/arch/arm/configs/raumfeld_defconfig
index e3dc80ead465..d804cf59eb97 100644
--- a/arch/arm/configs/raumfeld_defconfig
+++ b/arch/arm/configs/raumfeld_defconfig
@@ -187,7 +187,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
index 3c66a422fb4d..2b511a0f3ca7 100644
--- a/arch/arm/configs/shmobile_defconfig
+++ b/arch/arm/configs/shmobile_defconfig
@@ -218,7 +218,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=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
diff --git a/arch/arm/configs/socfpga_defconfig b/arch/arm/configs/socfpga_defconfig
index 2620ce790db0..00deb0b81b05 100644
--- a/arch/arm/configs/socfpga_defconfig
+++ b/arch/arm/configs/socfpga_defconfig
@@ -155,7 +155,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DETECT_HUNG_TASK=y
diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig
index 90e5c46913a5..1a29cc2cc8d3 100644
--- a/arch/arm/configs/stm32_defconfig
+++ b/arch/arm/configs/stm32_defconfig
@@ -74,7 +74,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig
index 0ec1d1ec130f..a06321567d38 100644
--- a/arch/arm/configs/sunxi_defconfig
+++ b/arch/arm/configs/sunxi_defconfig
@@ -151,6 +151,8 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_FS=y
CONFIG_CRYPTO_DEV_SUN4I_SS=y
diff --git a/arch/arm/configs/tango4_defconfig b/arch/arm/configs/tango4_defconfig
index 68725d4eae45..ebe215c3ef6c 100644
--- a/arch/arm/configs/tango4_defconfig
+++ b/arch/arm/configs/tango4_defconfig
@@ -90,5 +90,7 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_CRYPTO_ECHAINIV is not set
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index f0efc854b5a2..3d4f51823b5f 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -286,7 +286,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/arm/configs/u300_defconfig b/arch/arm/configs/u300_defconfig
index 36d77406e31b..5d2387ee3a3e 100644
--- a/arch/arm/configs/u300_defconfig
+++ b/arch/arm/configs/u300_defconfig
@@ -62,7 +62,9 @@ CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FS=y
# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
index e2151a7aaf49..ba9445bee454 100644
--- a/arch/arm/configs/u8500_defconfig
+++ b/arch/arm/configs/u8500_defconfig
@@ -127,7 +127,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/arm/configs/vt8500_v6_v7_defconfig b/arch/arm/configs/vt8500_v6_v7_defconfig
index 1bfaa7bfc392..964f695895f4 100644
--- a/arch/arm/configs/vt8500_v6_v7_defconfig
+++ b/arch/arm/configs/vt8500_v6_v7_defconfig
@@ -84,6 +84,8 @@ CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_KERNEL=y
CONFIG_LOCKUP_DETECTOR=y
diff --git a/arch/arm/configs/xcep_defconfig b/arch/arm/configs/xcep_defconfig
index 2eda24635e65..41fd393c4af4 100644
--- a/arch/arm/configs/xcep_defconfig
+++ b/arch/arm/configs/xcep_defconfig
@@ -79,7 +79,9 @@ CONFIG_NFS_V3=y
CONFIG_NLS=m
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_STRIP_ASM_SYMS=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_SCHED_DEBUG is not set
diff --git a/arch/arm/configs/zx_defconfig b/arch/arm/configs/zx_defconfig
index dfc061d87d2f..d10d4c3caa7a 100644
--- a/arch/arm/configs/zx_defconfig
+++ b/arch/arm/configs/zx_defconfig
@@ -95,7 +95,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO=y
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 6c7d147eed54..57212266a8d5 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -548,7 +548,9 @@ CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/m68k/configs/amcore_defconfig b/arch/m68k/configs/amcore_defconfig
index 131b4101ae5d..6b843376d3e5 100644
--- a/arch/m68k/configs/amcore_defconfig
+++ b/arch/m68k/configs/amcore_defconfig
@@ -107,7 +107,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=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
diff --git a/arch/mips/configs/ath25_defconfig b/arch/mips/configs/ath25_defconfig
index 2c829950be17..3df7c116ebba 100644
--- a/arch/mips/configs/ath25_defconfig
+++ b/arch/mips/configs/ath25_defconfig
@@ -105,7 +105,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_STRIP_ASM_SYMS=y
CONFIG_DEBUG_FS=y
diff --git a/arch/mips/configs/bcm47xx_defconfig b/arch/mips/configs/bcm47xx_defconfig
index fad8e964f14c..418d9b77e8e3 100644
--- a/arch/mips/configs/bcm47xx_defconfig
+++ b/arch/mips/configs/bcm47xx_defconfig
@@ -74,7 +74,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_REDUCED=y
CONFIG_STRIP_ASM_SYMS=y
diff --git a/arch/mips/configs/bmips_be_defconfig b/arch/mips/configs/bmips_be_defconfig
index a7072a14d396..d2adf4048dc2 100644
--- a/arch/mips/configs/bmips_be_defconfig
+++ b/arch/mips/configs/bmips_be_defconfig
@@ -32,7 +32,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_BRCMSTB_GISB_ARB=y
CONFIG_MTD=y
CONFIG_MTD_BCM63XX_PARTS=y
diff --git a/arch/mips/configs/bmips_stb_defconfig b/arch/mips/configs/bmips_stb_defconfig
index 3cefa6bc01dd..2a0828cd03d6 100644
--- a/arch/mips/configs/bmips_stb_defconfig
+++ b/arch/mips/configs/bmips_stb_defconfig
@@ -85,7 +85,9 @@ CONFIG_CIFS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_CMDLINE_BOOL=y
diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig
index b42cfa7865f9..7c0a9d04f846 100644
--- a/arch/mips/configs/ci20_defconfig
+++ b/arch/mips/configs/ci20_defconfig
@@ -147,7 +147,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_STRIP_ASM_SYMS=y
CONFIG_DEBUG_FS=y
diff --git a/arch/mips/configs/generic_defconfig b/arch/mips/configs/generic_defconfig
index 91aacf2ef26d..c2363fa3355f 100644
--- a/arch/mips/configs/generic_defconfig
+++ b/arch/mips/configs/generic_defconfig
@@ -83,7 +83,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_REDUCED=y
CONFIG_DEBUG_FS=y
diff --git a/arch/mips/configs/lemote2f_defconfig b/arch/mips/configs/lemote2f_defconfig
index 1ec8ed8d05d1..ffe330ee3676 100644
--- a/arch/mips/configs/lemote2f_defconfig
+++ b/arch/mips/configs/lemote2f_defconfig
@@ -394,7 +394,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_FRAME_WARN=1024
CONFIG_STRIP_ASM_SYMS=y
CONFIG_DEBUG_FS=y
diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig
index 324dfee23dfb..2a55d5f8fd94 100644
--- a/arch/mips/configs/loongson3_defconfig
+++ b/arch/mips/configs/loongson3_defconfig
@@ -327,7 +327,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_FRAME_WARN=1024
CONFIG_STRIP_ASM_SYMS=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/mips/configs/nlm_xlp_defconfig b/arch/mips/configs/nlm_xlp_defconfig
index 5720ce23e9aa..6e53a5895903 100644
--- a/arch/mips/configs/nlm_xlp_defconfig
+++ b/arch/mips/configs/nlm_xlp_defconfig
@@ -549,7 +549,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=1024
diff --git a/arch/mips/configs/nlm_xlr_defconfig b/arch/mips/configs/nlm_xlr_defconfig
index fea56c535d92..071876d8b708 100644
--- a/arch/mips/configs/nlm_xlr_defconfig
+++ b/arch/mips/configs/nlm_xlr_defconfig
@@ -506,7 +506,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_UNUSED_SYMBOLS=y
diff --git a/arch/mips/configs/pistachio_defconfig b/arch/mips/configs/pistachio_defconfig
index 7d32fbbca962..2747bee69d88 100644
--- a/arch/mips/configs/pistachio_defconfig
+++ b/arch/mips/configs/pistachio_defconfig
@@ -297,7 +297,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0
diff --git a/arch/mips/configs/qi_lb60_defconfig b/arch/mips/configs/qi_lb60_defconfig
index 3f1333517405..b9a330412986 100644
--- a/arch/mips/configs/qi_lb60_defconfig
+++ b/arch/mips/configs/qi_lb60_defconfig
@@ -170,7 +170,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_STRIP_ASM_SYMS=y
CONFIG_READABLE_ASM=y
diff --git a/arch/mips/configs/rt305x_defconfig b/arch/mips/configs/rt305x_defconfig
index c695b7b1c4ae..fa230e7a444a 100644
--- a/arch/mips/configs/rt305x_defconfig
+++ b/arch/mips/configs/rt305x_defconfig
@@ -143,7 +143,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_STRIP_ASM_SYMS=y
diff --git a/arch/mips/configs/xway_defconfig b/arch/mips/configs/xway_defconfig
index 4365108bef77..3b101b57edaa 100644
--- a/arch/mips/configs/xway_defconfig
+++ b/arch/mips/configs/xway_defconfig
@@ -151,7 +151,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_STRIP_ASM_SYMS=y
CONFIG_DEBUG_FS=y
diff --git a/arch/parisc/configs/generic-64bit_defconfig b/arch/parisc/configs/generic-64bit_defconfig
index d39e7f821aba..1d464bb1e22a 100644
--- a/arch/parisc/configs/generic-64bit_defconfig
+++ b/arch/parisc/configs/generic-64bit_defconfig
@@ -272,7 +272,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_STRIP_ASM_SYMS=y
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
diff --git a/arch/powerpc/configs/40x/virtex_defconfig b/arch/powerpc/configs/40x/virtex_defconfig
index 65dc084a154c..892b029009b7 100644
--- a/arch/powerpc/configs/40x/virtex_defconfig
+++ b/arch/powerpc/configs/40x/virtex_defconfig
@@ -71,7 +71,9 @@ CONFIG_CRC_CCITT=y
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/powerpc/configs/44x/fsp2_defconfig b/arch/powerpc/configs/44x/fsp2_defconfig
index e8e6a6999852..724b41148de3 100644
--- a/arch/powerpc/configs/44x/fsp2_defconfig
+++ b/arch/powerpc/configs/44x/fsp2_defconfig
@@ -111,7 +111,9 @@ CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
CONFIG_NLS_DEFAULT="n"
CONFIG_XZ_DEC=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
diff --git a/arch/powerpc/configs/44x/virtex5_defconfig b/arch/powerpc/configs/44x/virtex5_defconfig
index ce052064bcbb..f6d2ba963dcb 100644
--- a/arch/powerpc/configs/44x/virtex5_defconfig
+++ b/arch/powerpc/configs/44x/virtex5_defconfig
@@ -70,7 +70,9 @@ CONFIG_CRC_CCITT=y
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/powerpc/configs/44x/warp_defconfig b/arch/powerpc/configs/44x/warp_defconfig
index ab932488e68b..769664584301 100644
--- a/arch/powerpc/configs/44x/warp_defconfig
+++ b/arch/powerpc/configs/44x/warp_defconfig
@@ -90,7 +90,9 @@ CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_UTF8=y
CONFIG_CRC_CCITT=y
CONFIG_CRC_T10DIF=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/powerpc/configs/52xx/cm5200_defconfig b/arch/powerpc/configs/52xx/cm5200_defconfig
index c1faac800806..7e553b75bd9b 100644
--- a/arch/powerpc/configs/52xx/cm5200_defconfig
+++ b/arch/powerpc/configs/52xx/cm5200_defconfig
@@ -72,7 +72,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_DEBUG_BUGVERBOSE is not set
CONFIG_CRYPTO_ECB=y
diff --git a/arch/powerpc/configs/52xx/lite5200b_defconfig b/arch/powerpc/configs/52xx/lite5200b_defconfig
index 9493b02ac660..dc8d8f2e191f 100644
--- a/arch/powerpc/configs/52xx/lite5200b_defconfig
+++ b/arch/powerpc/configs/52xx/lite5200b_defconfig
@@ -58,7 +58,9 @@ CONFIG_TMPFS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_DEBUG_BUGVERBOSE is not set
diff --git a/arch/powerpc/configs/52xx/motionpro_defconfig b/arch/powerpc/configs/52xx/motionpro_defconfig
index fe8126bc1655..43865e4016ba 100644
--- a/arch/powerpc/configs/52xx/motionpro_defconfig
+++ b/arch/powerpc/configs/52xx/motionpro_defconfig
@@ -84,7 +84,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_DEBUG_BUGVERBOSE is not set
diff --git a/arch/powerpc/configs/52xx/tqm5200_defconfig b/arch/powerpc/configs/52xx/tqm5200_defconfig
index b8b316b884aa..918a50993449 100644
--- a/arch/powerpc/configs/52xx/tqm5200_defconfig
+++ b/arch/powerpc/configs/52xx/tqm5200_defconfig
@@ -86,7 +86,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_DEBUG_BUGVERBOSE is not set
diff --git a/arch/powerpc/configs/gamecube_defconfig b/arch/powerpc/configs/gamecube_defconfig
index c0eec4a5df4e..e874f079759d 100644
--- a/arch/powerpc/configs/gamecube_defconfig
+++ b/arch/powerpc/configs/gamecube_defconfig
@@ -89,7 +89,9 @@ CONFIG_CIFS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_CRC_CCITT=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_LATENCYTOP=y
diff --git a/arch/powerpc/configs/mpc5200_defconfig b/arch/powerpc/configs/mpc5200_defconfig
index 88336d0df0d6..6725bc235cd6 100644
--- a/arch/powerpc/configs/mpc5200_defconfig
+++ b/arch/powerpc/configs/mpc5200_defconfig
@@ -126,7 +126,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_HUNG_TASK=y
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig
index fe43ff47bd2f..adc69c5c30c7 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -166,7 +166,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_FS=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
diff --git a/arch/powerpc/configs/wii_defconfig b/arch/powerpc/configs/wii_defconfig
index dcdd51b57783..95809458d517 100644
--- a/arch/powerpc/configs/wii_defconfig
+++ b/arch/powerpc/configs/wii_defconfig
@@ -110,7 +110,9 @@ CONFIG_CIFS=m
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_CRC_CCITT=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
diff --git a/arch/s390/configs/default_defconfig b/arch/s390/configs/default_defconfig
index 282072206df7..c37b3a9261db 100644
--- a/arch/s390/configs/default_defconfig
+++ b/arch/s390/configs/default_defconfig
@@ -564,7 +564,9 @@ CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_UTF8=m
CONFIG_DLM=m
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF4=y
diff --git a/arch/s390/configs/gcov_defconfig b/arch/s390/configs/gcov_defconfig
index 3c6b78189fbc..e7270eaee6a3 100644
--- a/arch/s390/configs/gcov_defconfig
+++ b/arch/s390/configs/gcov_defconfig
@@ -558,7 +558,9 @@ CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_UTF8=m
CONFIG_DLM=m
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF4=y
CONFIG_GDB_SCRIPTS=y
diff --git a/arch/s390/configs/performance_defconfig b/arch/s390/configs/performance_defconfig
index 653d72bcc007..ae8abb09d986 100644
--- a/arch/s390/configs/performance_defconfig
+++ b/arch/s390/configs/performance_defconfig
@@ -556,7 +556,9 @@ CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_15=m
CONFIG_NLS_UTF8=m
CONFIG_DLM=m
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF4=y
CONFIG_GDB_SCRIPTS=y
diff --git a/arch/s390/configs/zfcpdump_defconfig b/arch/s390/configs/zfcpdump_defconfig
index afa46a7406ea..dc9a000615ef 100644
--- a/arch/s390/configs/zfcpdump_defconfig
+++ b/arch/s390/configs/zfcpdump_defconfig
@@ -57,7 +57,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_PANIC_ON_OOPS=y
diff --git a/arch/sh/configs/edosk7760_defconfig b/arch/sh/configs/edosk7760_defconfig
index e1077a041ac3..7fbd23e0e8f7 100644
--- a/arch/sh/configs/edosk7760_defconfig
+++ b/arch/sh/configs/edosk7760_defconfig
@@ -109,7 +109,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_UNUSED_SYMBOLS=y
diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig
index 36642ec2cb97..bb426b7db508 100644
--- a/arch/sh/configs/sdk7786_defconfig
+++ b/arch/sh/configs/sdk7786_defconfig
@@ -215,7 +215,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/sh/configs/se7722_defconfig b/arch/sh/configs/se7722_defconfig
index ae998c7e2ee0..160d3dc4c30b 100644
--- a/arch/sh/configs/se7722_defconfig
+++ b/arch/sh/configs/se7722_defconfig
@@ -53,7 +53,9 @@ CONFIG_EXT3_FS=y
CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y
CONFIG_HUGETLBFS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
diff --git a/arch/sh/configs/sh7785lcr_32bit_defconfig b/arch/sh/configs/sh7785lcr_32bit_defconfig
index 2fce54d9c388..1f0b5d43c617 100644
--- a/arch/sh/configs/sh7785lcr_32bit_defconfig
+++ b/arch/sh/configs/sh7785lcr_32bit_defconfig
@@ -144,7 +144,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
diff --git a/arch/sh/configs/urquell_defconfig b/arch/sh/configs/urquell_defconfig
index 01c9a91ee896..e1425510beac 100644
--- a/arch/sh/configs/urquell_defconfig
+++ b/arch/sh/configs/urquell_defconfig
@@ -142,7 +142,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_DEBUG_FS=y
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig
index b2e650d1764f..a5a7bb2938df 100644
--- a/arch/sparc/configs/sparc64_defconfig
+++ b/arch/sparc/configs/sparc64_defconfig
@@ -202,7 +202,9 @@ CONFIG_EXT3_FS_SECURITY=y
CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y
CONFIG_HUGETLBFS=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_WARN_DEPRECATED is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index 0eb9f92f3717..ddb8a9f3aeee 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_defconfig
@@ -284,7 +284,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_WARN_DEPRECATED is not set
CONFIG_FRAME_WARN=1024
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index 4a4b16e56d35..23da8e5297a1 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -283,7 +283,13 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
# CONFIG_ENABLE_WARN_DEPRECATED is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_UNUSED_SYMBOLS is not set
diff --git a/arch/xtensa/configs/audio_kc705_defconfig b/arch/xtensa/configs/audio_kc705_defconfig
index 8d16925765cb..c94f628cd1f1 100644
--- a/arch/xtensa/configs/audio_kc705_defconfig
+++ b/arch/xtensa/configs/audio_kc705_defconfig
@@ -123,7 +123,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/xtensa/configs/cadence_csp_defconfig b/arch/xtensa/configs/cadence_csp_defconfig
index f2d3094aa1d1..74c5dd05016d 100644
--- a/arch/xtensa/configs/cadence_csp_defconfig
+++ b/arch/xtensa/configs/cadence_csp_defconfig
@@ -102,7 +102,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/xtensa/configs/generic_kc705_defconfig b/arch/xtensa/configs/generic_kc705_defconfig
index 744adeaf2945..6c8c1e06f0a0 100644
--- a/arch/xtensa/configs/generic_kc705_defconfig
+++ b/arch/xtensa/configs/generic_kc705_defconfig
@@ -110,7 +110,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/xtensa/configs/nommu_kc705_defconfig b/arch/xtensa/configs/nommu_kc705_defconfig
index 78c2529d0459..a92b602422e5 100644
--- a/arch/xtensa/configs/nommu_kc705_defconfig
+++ b/arch/xtensa/configs/nommu_kc705_defconfig
@@ -107,7 +107,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
# CONFIG_FRAME_POINTER is not set
diff --git a/arch/xtensa/configs/smp_lx200_defconfig b/arch/xtensa/configs/smp_lx200_defconfig
index 14e3ca353ac8..94838e6d5487 100644
--- a/arch/xtensa/configs/smp_lx200_defconfig
+++ b/arch/xtensa/configs/smp_lx200_defconfig
@@ -114,7 +114,9 @@ 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_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_MAGIC_SYSRQ=y
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index ddc229ff6d1e..adb84af42deb 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -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
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index fc47863f629c..672a649b90d8 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -576,6 +576,8 @@ static u32 truncate_msg(u16 *text_len, u16 *trunc_msg_len,
return msg_used_size(*text_len + *trunc_msg_len, 0, pad_len);
}

+static u64 printk_get_ts(void);
+
/* insert record into the buffer, discard old ones, update heads */
static int log_store(int facility, int level,
enum log_flags flags, u64 ts_nsec,
@@ -624,7 +626,7 @@ static int log_store(int facility, int level,
if (ts_nsec > 0)
msg->ts_nsec = ts_nsec;
else
- msg->ts_nsec = local_clock();
+ msg->ts_nsec = printk_get_ts();
memset(log_dict(msg) + dict_len, 0, pad_len);
msg->len = size;

@@ -1202,8 +1204,89 @@ 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_setting; /* initial setting */
+
+/*
+ * 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() below.
+ */
+static int printk_time_set(const char *val, const struct kernel_param *kp)
+{
+ char *param = strstrip((char *)val);
+ int _printk_time;
+
+ if (strlen(param) != 1)
+ return -EINVAL;
+
+ switch (param[0]) {
+ case '0':
+ case 'n':
+ case 'N':
+ _printk_time = 0; /* none/disabled */
+ break;
+ case '1':
+ case 'y':
+ case 'Y':
+ _printk_time = 1; /* local unadjusted HW clock */
+ break;
+ case '2':
+ _printk_time = 2; /* monotonic */
+ break;
+ case '3':
+ _printk_time = 3; /* realtime */
+ break;
+ default:
+ pr_warn("printk: invalid timestamp value\n");
+ return -EINVAL;
+ }
+
+ /*
+ * Only allow enabling and disabling of the current printk_time
+ * setting. Changing it from one setting to another confuses
+ * userspace.
+ */
+ if (printk_time_setting == 0) {
+ printk_time_setting = _printk_time;
+ } else if ((printk_time_setting != _printk_time) &&
+ (_printk_time != 0)) {
+ pr_warn("printk: timestamp can only be set to 0 or %d ",
+ printk_time_setting);
+ return -EINVAL;
+ }
+
+ printk_time = _printk_time;
+ pr_info("printk: timestamp set to %d.", 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, 0644);
+
+static u64 printk_get_ts(void)
+{
+ u64 mono, offset_real;
+
+ if (printk_time <= 1)
+ return local_clock();
+
+ mono = ktime_get_log_ts(&offset_real);
+
+ if (printk_time == 2)
+ return mono;
+
+ return mono + offset_real;
+}

static size_t print_time(u64 ts, char *buf)
{
@@ -1643,7 +1726,7 @@ static bool cont_add(int facility, int level, enum log_flags flags, const char *
cont.facility = facility;
cont.level = level;
cont.owner = current;
- cont.ts_nsec = local_clock();
+ cont.ts_nsec = printk_get_ts();
cont.flags = flags;
}

@@ -1873,6 +1956,8 @@ static size_t msg_print_text(const struct printk_log *msg,
bool syslog, char *buf, size_t size) { return 0; }
static bool suppress_message_printing(int level) { return false; }

+static int printk_time;
+static int printk_time_setting;
#endif /* CONFIG_PRINTK */

#ifdef CONFIG_EARLY_PRINTK
@@ -2659,6 +2744,10 @@ static int __init printk_late_init(void)
struct console *con;
int ret;

+ /* initialize printk_time settings */
+ if (printk_time_setting == 0)
+ printk_time_setting = printk_time;
+
for_each_console(con) {
if (!keep_bootcon && con->flags & CON_BOOT) {
/*
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index cedafa008de5..96f06a16c51f 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -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 */
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 98fe715522e8..7a8870b4ddbb 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1,8 +1,39 @@
menu "printk and dmesg options"

+choice
+ prompt "printk default clock"
+ 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_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 time stamp information on printks"
depends on PRINTK
+ default 0 if PRINTK_TIME_DISABLE
+ default 1 if PRINTK_TIME_LOCAL
+ default 2 if PRINTK_TIME_MONO
+ default 3 if PRINTK_TIME_REAL
help
Selecting this option causes time stamps of the printk()
messages to be added to the output of the syslog() system
@@ -13,7 +44,8 @@ config PRINTK_TIME
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=[0-3]. See
+ Documentation/admin-guide/kernel-parameters.rst

config CONSOLE_LOGLEVEL_DEFAULT
int "Default console loglevel (1-15)"
diff --git a/tools/testing/selftests/rcutorture/configs/lock/CFcommon b/tools/testing/selftests/rcutorture/configs/lock/CFcommon
index e372dc269254..c22c792fe2a8 100644
--- a/tools/testing/selftests/rcutorture/configs/lock/CFcommon
+++ b/tools/testing/selftests/rcutorture/configs/lock/CFcommon
@@ -1,2 +1,4 @@
CONFIG_LOCK_TORTURE_TEST=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/CFcommon b/tools/testing/selftests/rcutorture/configs/rcu/CFcommon
index d2d2a86139db..a95316743651 100644
--- a/tools/testing/selftests/rcutorture/configs/rcu/CFcommon
+++ b/tools/testing/selftests/rcutorture/configs/rcu/CFcommon
@@ -1,2 +1,4 @@
CONFIG_RCU_TORTURE_TEST=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon b/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon
index a09816b8c0f3..713de81b2975 100644
--- a/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/CFcommon
@@ -1,2 +1,4 @@
CONFIG_RCU_PERF_TEST=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME_DISABLE is not set
+CONFIG_PRINTK_TIME_LOCAL=Y
+CONFIG_PRINTK_TIME=1
--
1.8.5.5