[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1166889227.14081.13.camel@imap.mvista.com>
Date: Sat, 23 Dec 2006 07:53:47 -0800
From: Daniel Walker <dwalker@...sta.com>
To: eranian@....hp.com
Cc: linux-kernel@...r.kernel.org, venkatesh.pallipadi@...el.com,
suresh.b.siddha@...el.com, kenneth.w.chen@...el.com,
tony.luck@...el.com
Subject: Re: sched_clock() on i386
On Fri, 2006-12-22 at 02:43 -0800, Stephane Eranian wrote:
> Hello,
>
>
> The perfmon subsystems needs to compute per-CPU duration. It is using
> sched_clock() to provide this information. However, it seems they are
> big variations in the way sched_clock() is implemented for each architectures,
> especially in the accuracy of the returned value (going from TSC to jiffies).
>
The vast majority of architectures return a scaled jiffies value for
sched_clock(). MIPS, and ARM for instance are two, and i386 does
sometimes. The function isn't very predictable in terms or what you'll
get as output.
The most reliable way to get timing is to use gettimeofday() which in
turn uses a lowlevel clock. I'm not sure exactly what your application
is, but sometimes gettimeofday() can be a little complicated to use.
Which is why I create the following clocksource changes,
ftp://source.mvista.com/pub/dwalker/clocksource/
the purpose of which is to allow generic access to suitable lowlevel
clocks. It just extends the mechanism already used by gettimeofday().
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists