Thread (7 messages) 7 messages, 4 authors, 2003-09-29

Re: linux-2.6.0-test6 error during linking

From: Falk Hueffner <hidden>
Date: 2003-09-29 09:02:58

Balint Cristian [off-list ref] writes:
On Sunday 28 September 2003 23:51, Falk Hueffner wrote:
quoted
sched_clock is not implemented yet for Alpha. It is supposed to
return a high resolution timer. As workaround, you could just copy
the implementation from ARM, which simply returns the value based
on jiffies.  Ideally, one would take into account the cycle
counter, but it wraps every few seconds, which has to be taken
care of.
Can post here a patch based on arm ?
Well, just copy the function:
--- arch/alpha/kernel/time.c~   2003-09-28 02:50:20.000000000 +0200
+++ arch/alpha/kernel/time.c    2003-09-28 13:39:58.000000000 +0200
@@ -570,3 +570,12 @@
 
        return retval;
 }
+
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ * Should probably take rpcc into account for improved resolution
+ */
+unsigned long long sched_clock(void)
+{
+       return (unsigned long long) jiffies * (1000000000 / HZ);
+}
I've not tested this, it should work, but probably scheduling
behaviour will not be as good as it could be, although HZ being 1000
(or larger) on Alpha should help.
Eventualy post it on linux kernel list or to Richard Henderson ?
Not without testing it, and I have no time for that currently.

-- 
	Falk
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help