sched: Fix fallback sched_clock()'s offset when using jiffies

Account for the initial offset to the jiffy count.

[ Impact: fix printk timestamps on architectures using fallback sched_clock() ]

Signed-off-by: Ron Lee <ron@debian.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Ron 2009-05-08 22:54:49 +09:30 committed by Ingo Molnar
parent 091bf7624d
commit 92d23f703c
1 changed files with 2 additions and 1 deletions

View File

@ -38,7 +38,8 @@
*/
unsigned long long __attribute__((weak)) sched_clock(void)
{
return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
return (unsigned long long)(jiffies - INITIAL_JIFFIES)
* (NSEC_PER_SEC / HZ);
}
static __read_mostly int sched_clock_running;