[PATCH] printk timestamp post-boot suppression

From: Joe Korty
Date: Wed Aug 27 2008 - 11:16:37 EST


Suppress printk timestamping after system boot.

The timestamp printk prefix seems most useful during boot,
where it easily shows where the boot sequence is spending
its time.

Its utility after boot is questionable, since 1) the
timestamp becomes a rather large, unreadable integer,
as the hours, days and weeks go by, and 2) syslog does
a proper TOD timestamp anyways on these later messages,
as they go into /var/log/messages.

Signed-off-by: Joe Korty <joe.korty@xxxxxxxx>

Index: 2.6.27-rc4-git4/kernel/printk.c
===================================================================
--- 2.6.27-rc4-git4.orig/kernel/printk.c 2008-08-26 16:28:41.000000000 -0400
+++ 2.6.27-rc4-git4/kernel/printk.c 2008-08-26 16:53:11.000000000 -0400
@@ -730,7 +730,7 @@
printed_len += 3;
new_text_line = 0;

- if (printk_time) {
+ if (printk_time && system_state == SYSTEM_BOOTING) {
/* Follow the token with the time */
char tbuf[50], *tp;
unsigned tlen;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/