lkml.org 
[lkml]   [2013]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] perf: need to expose sched_clock to correlate user samples with kernel samples
From
Date
On Tue, 2013-02-19 at 10:25 -0800, John Stultz wrote:
> So describe how the perf time domain is different then
> CLOCK_MONOTONIC_RAW.

The primary difference is that the trace/sched/perf time domain is not
strictly monotonic, it is only locally monotonic -- that is two time
stamps taken on the same cpu are guaranteed to be monotonic.

Furthermore, to make it useful, there's an actual bound on the inter-cpu
drift (implemented by limiting the drift to CLOCK_MONOTONIC).

Additionally -- to increase use -- we also added a monotonic sync point
when cpu A queries time of cpu B.

> My concern here is that we're basically creating a kernel interface
> that
> exports implementation-defined semantics (again: whatever perf does
> right now). And I think folks want to do this, because adding
> CLOCK_PERF
> is easier then trying to:
>
> 1) Get a lock-free method for accessing CLOCK_MONOTONIC_RAW
>
> 2) Having perf interpolate its timestamps to CLOCK_MONOTONIC, or
> CLOCKMONOTONIC_RAW when it exports the data

Mostly cheaper, not easier. Given unstable TSC, MONOTONIC will have to
fall back to another clock source (hpet, acpi_pm and other assorted
crap).

In order to avoid this, we'd had to relax the requirements. Using
anything other than TSC is simply not an option.



\
 
 \ /
  Last update: 2013-02-20 12:01    [W:1.983 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site