From: "Frédéric Weisbecker" <fweisbec@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>
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 13:36:17 +0100 [thread overview]
Message-ID: <c62985530811130436s160e3983nd7debbb96cc971ae@mail.gmail.com> (raw)
In-Reply-To: <20081113094027.GK25479@elte.hu>
2008/11/13 Ingo Molnar <mingo@elte.hu>:
> 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
>
Ok, so correct me if I'm wrong.
Global timestamp would be captured by using sched_clock().
That's what is done currently in ring_buffer_time_stamp()
And the global timestamp would be combination of a last global
timestamp and a relative position from now to this last at
each insertion in the ring-buffer (or tracing time capture). Am I right?
I don't really understand why you want to update with a cmpxchg loop...
And the local timestamp would be built through cpu_clock() with
absolute values at each captures? Because we can't consider
relative values since this is loosing sense between cpu. Unless we
have per_cpu relative values.....
Then, depending of the current_tracer, ring_buffer_time_stamp would
act as a wrapper:
if (current_tracer->time_flag == TIME_GLOBAL_COHERENT)
return ring_buffer_global_timestamp();
else
return ring_buffer_local_timestamp();
Or more efficient with a function pointer set at the same we change
the time flag for the current tracer.
next prev parent reply other threads:[~2008-11-13 12:36 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-12 21:47 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
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 [this message]
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=c62985530811130436s160e3983nd7debbb96cc971ae@mail.gmail.com \
--to=fweisbec@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®