aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-25 15:08:34 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-25 15:08:34 -0500
commit19ef9309273d26cb005cb23e6a370353dca91099 (patch)
tree5ca31fef94ed523c3df867ba3472e70d215ffb84 /kernel
parent90739081ef8d5495d50abba9c5d333be9acd872a (diff)
printk: use ktime_get()
printk timestamps: use ktime_get(). Some platforms have a functioning clocksource function only after they are done with early bootup, so delay this until out of SYSTEM_BOOTING state. it's also inherently safe now, as any bugs in this area will be caught by the printk recursion checks. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 3b7c968d0ef9..423a8c765a57 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -702,7 +702,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
702 loglev_char = default_message_loglevel 702 loglev_char = default_message_loglevel
703 + '0'; 703 + '0';
704 } 704 }
705 t = cpu_clock(printk_cpu); 705 t = 0;
706 if (system_state != SYSTEM_BOOTING)
707 t = ktime_to_ns(ktime_get());
706 nanosec_rem = do_div(t, 1000000000); 708 nanosec_rem = do_div(t, 1000000000);
707 tlen = sprintf(tbuf, 709 tlen = sprintf(tbuf,
708 "<%c>[%5lu.%06lu] ", 710 "<%c>[%5lu.%06lu] ",