Re: [RFC PATCH 1/3] Unified trace buffer

From: Jeremy Fitzhardinge
Date: Thu Sep 25 2008 - 21:49:22 EST


Steven Rostedt wrote:
> On Thu, 25 Sep 2008, Jeremy Fitzhardinge wrote:
>
>> No, as I said: "You just need to emit the current
>> tsc+frequency+wallclock time before you emit any more delta records
>> after the frequency change."
>>
>> When an event which affects the tsc occurs, like a frequency change or
>> pause, set a flag. When you're next about to emit a delta, check the
>> flag and emit new timing parameters (or instead).
>>
>
> This is where I get confused. When do we add this to the trace buffer?
> Every record (currently) records the delta time from the last event.
> If a frequency changes, do we need to record the tuple at that moment?
>

No, you just need to save away a consistent (tsc,freq,GTOD) triple at
some point in time; it doesn't matter when it is, so long as the tsc
frequency hasn't changed since then. Once you have that, you can insert
it into your trace buffer, and then use it as the base for subsequent
deltas.

And as I mentioned in the other mail, if you don't mind backtracking
when you process the log, you can even record (tsc,freq) (tsc,GTOD)
separately (but in that order).

> If so, we have an issue. We can be in the middle of tracing the GTOD
> and we can not recurse back into the GTOD for fear of deadlocking on
> the GTOD spinlocks.
>

Right, you don't need to read the GTOD when you actually write a record.

J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/