Re: [PATCH 2/2] tracing: Use sched_clock_cpu for trace_clock_global

From: Namhyung Kim
Date: Thu Dec 27 2012 - 04:51:59 EST


On Thu, 27 Dec 2012 11:49:45 +0900, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@xxxxxxx>
>
> For systems have unstable sched_clock, all cpu_clock() does is enable/
> disable local irq during call to sched_clock(). And for stable systems

Oops, I meant s/sched_clock/scheck_clock_cpu/.

Thanks,
Namhyung


> they are same.
>
> As in trace_clock_global(), we already does it for local irq, calling
> sched_clock_cpu() directly would be appropriate.
>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Cc: Fredereic Weisbecker <fweisbec@xxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> ---
> kernel/trace/trace_clock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
> index 394783531cbb..795f077978a8 100644
> --- a/kernel/trace/trace_clock.c
> +++ b/kernel/trace/trace_clock.c
> @@ -86,7 +86,7 @@ u64 notrace trace_clock_global(void)
> local_irq_save(flags);
>
> this_cpu = raw_smp_processor_id();
> - now = cpu_clock(this_cpu);
> + now = sched_clock_cpu(this_cpu);
> /*
> * If in an NMI context then dont risk lockups and return the
> * cpu_clock() time:
--
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/