Re: [PATCH 1/2] tracing/function-return-tracer: Make the functionreturn tracer lockless
From: Ingo Molnar
Date: Thu Nov 13 2008 - 04:40:48 EST
* Frédéric Weisbecker <fweisbec@xxxxxxxxx> wrote:
> If so that would be suitable. And for his purpose, the ring-buffer
> would propose a function for time snapshot adapted to the current
> flags and that rely on sched_clock?
yeah - and it would be all means by a global entity in the beginning -
i.e. we'd just generalize the code around ring_buffer_time_stamp() to
listen to the "globally coherent" flag, and allow it to be used for
callgraph cost measurement code too.
If the "globally coherent" flag is set, then the implementation would
be something like:
A simple "last global timestamp" value combined with a "last local
timestamp" value, and the global timestamp is only ever moved forward.
It is updated via cmpxchg loop. This gives coherency and a monotonic
clock. The local timestamp would be taken from cpu_clock(cpu), and a
global timestamp would be constructed out of it. Or something like
that.
Would that work? [ Would you be interested in sending patches? :-) ]
Ingo
--
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/