lkml.org 
[lkml]   [2009]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: perf_counter: request for three more sample data options
Peter Zijlstra writes:

> What I was thinking of was re-using some of the cpu_clock()
> infrastructure. That provides us with a jiffy based GTOD sample,
> cpu_clock() then uses TSC and a few filters to compute a current
> timestamp.
>
> I was thinking about cutting back those filters and thus trusting the
> TSC more -- which on x86 can do any random odd thing. So provided the
> TSC is not doing funny the results will be ok-ish.
>
> This does mean however, that its not possible to know when its gone bad.

I would expect that perfmon would be just reading the TSC and
recording that. If you can read the TSC and do some correction then
we're ahead. :)

> The question to Paul is, does the powerpc sched_clock() call work in NMI
> -- or hard irq disable -- context?

Yes - timekeeping is one area where us powerpc guys can be smug. :)
We have a per-core, 64-bit timebase register which counts at a
constant frequency and is synchronized across all cores. So
sched_clock works in any context on powerpc - all it does is read the
timebase and do some simple integer arithmetic on it.

Paul.


\
 
 \ /
  Last update: 2009-04-03 10:53    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site