All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Frédéric Weisbecker" <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH 1/2] tracing/function-return-tracer: Make the function return tracer lockless
Date: Thu, 13 Nov 2008 09:55:51 +0100	[thread overview]
Message-ID: <20081113085551.GF25479@elte.hu> (raw)
In-Reply-To: <c62985530811130050q58be3f58rcef08a61b5a584a3@mail.gmail.com>


* Frédéric Weisbecker <fweisbec@gmail.com> 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

  reply	other threads:[~2008-11-13  8:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-12 21:47 [PATCH 1/2] tracing/function-return-tracer: Make the function return tracer lockless Frederic Weisbecker
2008-11-12 22:15 ` Ingo Molnar
2008-11-13  8:50   ` Frédéric Weisbecker
2008-11-13  8:55     ` Ingo Molnar [this message]
2008-11-13  9:16       ` Frédéric Weisbecker
2008-11-13  9:23         ` Ingo Molnar
2008-11-13  9:27           ` Frédéric Weisbecker
2008-11-13  9:40             ` Ingo Molnar
2008-11-13 12:36               ` Frédéric Weisbecker
2008-11-13 12:54                 ` Ingo Molnar
2008-11-13 12:59                   ` Peter Zijlstra
2008-11-13 13:02                     ` Ingo Molnar
2008-11-13 17:26                   ` Frédéric Weisbecker
2008-11-13 18:57                     ` Ingo Molnar
2008-11-13 20:06                       ` Frédéric Weisbecker
2008-11-13 14:53 ` Andi Kleen
2008-11-13 17:01   ` Frédéric Weisbecker
2008-11-13 17:12     ` Andi Kleen
2008-11-13 17:21       ` Steven Rostedt
2008-11-13 17:34         ` Andi Kleen
2008-11-13 17:32           ` Steven Rostedt
2008-11-13 17:46             ` Frédéric Weisbecker
2008-11-13 18:29             ` Andi Kleen
2008-11-13 18:35               ` Steven Rostedt
2008-11-13 18:55                 ` Andi Kleen
2008-11-13 19:03                   ` Steven Rostedt
2008-11-13 19:19                     ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081113085551.GF25479@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.