Re: [RFC PATCH 1/2 v2] Unified trace buffer

From: Mathieu Desnoyers
Date: Thu Sep 25 2008 - 13:35:22 EST


* Linus Torvalds (torvalds@xxxxxxxxxxxxxxxxxxxx) wrote:
[...]
> but the bigger issue is that I think the timestamp should be relative to
> the _previous_ event, not relative to the page start. IOW, you really
> should accumulate them.
>

How about keeping the timestamps absolute ? (but just keep 27 LSBs)

It would help resynchronizing the timestamps if an event is lost and
would not accumulate error over and over. It would event help detecting
bugs in the tracer by checking if timestamps go backward.

Also, it would remove inter-dependency between consecutive events; we
would not have to know "for sure" what the previous timestamp was when
we write the current event. Just knowing if we need to write the full
TSC is enough (which implies knowing an upper bound), which is a much
more relax constraint than having to know the _exact_ previous
timestamp.

Is there a reason to use delta between events rather than simply write
the 27 LSBs that I would have missed ?

Mathieu

> IOW, the base timestamp cannot be in the cpu_buffer, it needs to be in the
> iterator data structure, since it updates as you walk over it.
>
> Otherwise the extended TSC format will be _horrible_. You don't want to
> add it in front of every event in the page just because you had a pause at
> the beginning of the page. You want to have a running update, so that you
> only need to add it after there was a pause.
>
> Linus
>

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
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/