[PATCH] shrink printk timestamp field

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joe Korty
Date: Wednesday, August 27, 2008 - 8:17 am

Shrink the printk timestamp field.

Keep the printk timestamp from occupying more of the
scarce, 80-column console line space than it really needs.

We eliminate the excessive whitespace the field added to
the line, and reduce timestamp precision from six digits
(usecs) to three digits (msecs).  msecs seems adequate
for the purpose of tracking boot sequence timing issues.

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

Index: 2.6.27-rc4-git4/kernel/printk.c
===================================================================
--- 2.6.27-rc4-git4.orig/kernel/printk.c	2008-08-26 18:23:03.000000000 -0400
+++ 2.6.27-rc4-git4/kernel/printk.c	2008-08-26 18:23:49.000000000 -0400
@@ -739,9 +739,9 @@
 
 				t = cpu_clock(printk_cpu);
 				nanosec_rem = do_div(t, 1000000000);
-				tlen = sprintf(tbuf, "[%5lu.%06lu] ",
+				tlen = sprintf(tbuf, "[%3lu.%03lu] ",
 						(unsigned long) t,
-						nanosec_rem / 1000);
+						nanosec_rem / 1000000);
 
 				for (tp = tbuf; tp < tbuf + tlen; tp++)
 					emit_log_char(*tp);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] shrink printk timestamp field, Joe Korty, (Wed Aug 27, 8:17 am)
Re: [PATCH] shrink printk timestamp field, Ingo Molnar, (Thu Aug 28, 2:38 am)
Re: [PATCH] shrink printk timestamp field, Andrew Morton, (Fri Aug 29, 4:35 pm)
Re: [PATCH] shrink printk timestamp field, Joe Korty, (Sat Aug 30, 7:38 am)
Re: [PATCH] shrink printk timestamp field, Andrew Morton, (Sat Aug 30, 10:16 am)
Re: [PATCH] shrink printk timestamp field, Leon Woestenberg, (Sat Aug 30, 10:47 am)
Re: [PATCH] shrink printk timestamp field, Joe Korty, (Sat Aug 30, 11:57 am)
Re: [PATCH] shrink printk timestamp field, Benny Halevy, (Mon Sep 1, 1:31 am)
Re: [PATCH] shrink printk timestamp field, Ingo Molnar, (Sat Sep 6, 11:24 am)