]> err.no Git - linux-2.6/commitdiff
printk: use ktime_get()
authorIngo Molnar <mingo@elte.hu>
Fri, 25 Jan 2008 20:08:34 +0000 (21:08 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 25 Jan 2008 20:08:34 +0000 (21:08 +0100)
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>
kernel/printk.c

index 3b7c968d0ef994e8be14ef780835d96634761881..423a8c765a5788fc1b422d87add42d8649ec9d31 100644 (file)
@@ -702,7 +702,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
                                        loglev_char = default_message_loglevel
                                                + '0';
                                }
-                               t = cpu_clock(printk_cpu);
+                               t = 0;
+                               if (system_state != SYSTEM_BOOTING)
+                                       t = ktime_to_ns(ktime_get());
                                nanosec_rem = do_div(t, 1000000000);
                                tlen = sprintf(tbuf,
                                                "<%c>[%5lu.%06lu] ",