From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752737AbYKMJQ5 (ORCPT ); Thu, 13 Nov 2008 04:16:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751706AbYKMJQn (ORCPT ); Thu, 13 Nov 2008 04:16:43 -0500 Received: from qw-out-2122.google.com ([74.125.92.27]:52124 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751595AbYKMJQm convert rfc822-to-8bit (ORCPT ); Thu, 13 Nov 2008 04:16:42 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=bmytGS3sd8v2IxpXw/3AKjox1J/k4ttzs0nOyAzIXvplvDfZnqGftuhk1Sxty1xRZs YggY5SDqRSNOom8yxAWaY93C0pccPJKMK13hKRk31gCbf171XDprdqZyGGEyMqfyoBuq MlzkqGeUF4/DEvoCC60oyNc29JtlEi93XwWvw= Message-ID: Date: Thu, 13 Nov 2008 10:16:40 +0100 From: "=?ISO-8859-1?Q?Fr=E9d=E9ric_Weisbecker?=" To: "Ingo Molnar" Subject: Re: [PATCH 1/2] tracing/function-return-tracer: Make the function return tracer lockless Cc: "Steven Rostedt" , "Linux Kernel" , "Peter Zijlstra" In-Reply-To: <20081113085551.GF25479@elte.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Content-Disposition: inline References: <491B4F0A.3080901@gmail.com> <20081112221552.GA6125@elte.hu> <20081113085551.GF25479@elte.hu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2008/11/13 Ingo Molnar : > > * Frédéric Weisbecker wrote: > >> BTW I'm wondering about consistency in time capturing. When I look >> into kernel/sched_clock.c I see this in introduction: >> >> "The clock: sched_clock_cpu() is monotonic per cpu, and should be >> somewhat consistent between cpus (never more than 2 jiffies >> difference)." >> >> Two Jiffies, that could result in a lot of inconsistency in the way >> of nanosec capturing. The current task can be preempted between the >> call time and the return time and I'm doing a >> cpu_clock(raw_smp_processor_id) on these two times. Should I keep >> the same processor_id for these two captures? But what would happen >> if this cpu is shut down between these two times? One other solution >> would be to plan time capture in usec but I would mostly lose the >> interest of function cost measuring.... >> >> What do you think? > > in practice the jitter is much lower - a couple of microseconds - up > to a few dozen at most. > > But it's a possibility, and i think the best solution is something > that Steve suggested yesterday: a /debug/tracing/trace_options flag > that turns on global ordering for tracing timestamps. Something like: > > echo global_timestamps > /debug/tracing/trace_options > > tracers could also change the default of this flag. The function-cost > tracer will probably want to default to globally synchronous > timestamps, while the preempt and irqsoff tracers want to default to > local timestamps only. > > Would something like this work for you? > > Ingo > But I guess this flag would apply on the timestamp inserted by the ring-buffer. Unfortunately I can't use it since I have to capture the clock for two times and not only during insertion in the ring-buffer.