lkml.org 
[lkml]   [2008]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/3] Unified trace buffer
Steven Rostedt wrote:
> How do you get this GTOD read in the ring buffer? If the ring buffer does
> it without any knowledge from the tracer, it may be doing it a
> inappropriate times. This would also imply that the GTOD infrastructure
> itself is reentrent safe. Imagine tracing the GTOD code when the buffer
> decides it is about time to add the GTOD timestamp into the buffer. Can
> the GTOD handle this recursion. If the GTOD has spinlocks, probably not.
>

It doesn't need to read the GTOD synchronously when writing the trace
record. When a tsc event occurs, it needs to store the
GTOD/tsc/frequency somewhere at that point. When you next write a trace
record, if that structure has been updated, you write it into the trace
before emitting the next delta timestamp.

In fact you can read the GTOD at almost any time between tsc frequency
updates, so you can defer it to whenever is convenient. At the time the
tsc changes frequency, you emit: (tsc,frequency), and a bit later
(before it changes again) you emit (tsc,GTOD). That allows you to
retroactively compute GTODs for all timestamps. Obviously it would be
good to get them as close as possible together.

J


\
 
 \ /
  Last update: 2008-09-26 03:31    [W:0.152 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site