lkml.org 
[lkml]   [2013]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf: POSIX CLOCK_PERF to report current time value

* Ingo Molnar <mingo@kernel.org> wrote:

>
> * David Ahern <dsahern@gmail.com> wrote:
>
> > From: Pawel Moll <pawel.moll@arm.com>
> >
> > To co-relate user space events with the perf events stream
> > a current (as in: "what time(stamp) is it now?") time value
> > must be made available.
>
> So I'm wondering about your earlier approach posted here:
>
> https://lkml.org/lkml/2011/6/7/636
>
> I'd modify that patch the following way: instead of tracking each
> separate reason, perhaps only track timekeeping_update().
>
> Such a tracepoint, combined with PERF_SAMPLE_TIME, would very
> accurately track external changes to GTOD (xtime).
>
> That leaves us with tracking/correlating the regular flow of time,
> which could be achieved by another tracepoint in:
>
> kernel/time/timekeeping.c::do_timer()
>
> So only two new tracepoints are needed AFAICS - and the tracepoints
> would obviously be useful for other (debugging) purposes as well.
> Would that solve the wall-clock correlation problem adequately?

I forgot to mention what data the new tracepoints would trace:

- timekeeping_update() would trace the 'before' and 'after'
(==current) GTOD values

- do_timer() would trace 'ticks' and the current GTOD value.

'GTOD value' is what gettimeofday() would return, which in the
do_timer() case ought to be something like this:

tk->xtime_sec
(tk->xtime_nsec >> tk->shift) + get_arch_timeoffset()

(Note that this is simple and fast as there's no need to read the
clock once again, it was just read.)

Thanks,

Ingo


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