Re: [PATCH 1/2] ftrace: single CPU tracers use CPU clock

From: Ingo Molnar
Date: Sat Jul 26 2008 - 08:41:38 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> The current ftrace clock uses the sched_clock.c code. This code tries
> to handle cases where the TSC is out of sync between different CPUs.
> Unfortunately, even with insync TSCs, due to drifts between the CPU
> clock and the GTOD clock, we might get some inaccuracy in a single CPU
> trace.
>
> Some tracers (irqsoff, preemptoff, preempirqsoff) only care about a
> trace on a single CPU. This patch changes the ftrace_now (the clock
> reader) from a function call to a function variable. On initialization
> of a tracer, the tracer will be allowed to choose which type of clock
> to use.
>
> Now the irqsoff, preemptoff and preemptirqs off tracers can have
> accurate traces with the local CPU clock without affecting the tracers
> that want the modified clock that tries to keep the different CPU
> clock reads in sync.

this is not a good idea. We want to fix cpu_clock(), not work around any
deficiencies it might have.

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/