Commit 31f6d9d628739c097964b8dbae939ea997da94a3

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent 66dcca0628

[PATCH] Add printk_clock()

ia64's sched_clock() accesses per-cpu data which isn't set up at boot time.
Hence ia64 cannot use printk timestamping, because printk() will crash in
sched_clock().

So make printk() use printk_clock(), defaulting to sched_clock(), overrideable
by the architecture via attribute(weak).

Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 6 additions and 1 deletions Side-by-side Diff

... ... @@ -488,6 +488,11 @@
488 488  
489 489 __setup("time", printk_time_setup);
490 490  
  491 +__attribute__((weak)) unsigned long long printk_clock(void)
  492 +{
  493 + return sched_clock();
  494 +}
  495 +
491 496 /*
492 497 * This is printk. It can be called from any context. We want it to work.
493 498 *
... ... @@ -565,7 +570,7 @@
565 570 loglev_char = default_message_loglevel
566 571 + '0';
567 572 }
568   - t = sched_clock();
  573 + t = printk_clock();
569 574 nanosec_rem = do_div(t, 1000000000);
570 575 tlen = sprintf(tbuf,
571 576 "<%c>[%5lu.%06lu] ",