From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [patch 06/16] Markers auto enable tracepoints (new API : trace_mark_tp())
Date: Mon, 24 Nov 2008 03:05:11 -0500 [thread overview]
Message-ID: <20081124080511.GA8501@Krystal> (raw)
In-Reply-To: <20081123164923.GB11243@elte.hu>
* Ingo Molnar (mingo@elte.hu) wrote:
>
> * Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
>
> > > ... and in that sense i'd love to see lttng become a "super ftrace
> > > plugin", and be merged upstream ASAP.
> >
> > Hrm, a big part of LTTng is its optimized buffering mechanism, which
> > has been more tested and is more flexible than the one currently
> > found in ftrace (it has supported lockless NMI-safe tracing for over
> > 2 years). It also separates the various tracing layers in separated
> > modules, which helps not mixing the buffer management layer with the
> > timestamping layer and with the memory backend layer.. I am opened
> > to try to merge ftrace and lttng together, but I think it will be
> > more than a simple "make lttng a ftrace plugin".
>
> Sure, it will certainly be a fair bit of (interesting and useful!)
> work.
>
> But it's something we should do iteratively, instead of merging a
> parallel framework. Steve's ring-buffer should be a fair step in the
> right direction. Could we improve on that?
>
I think it's a very good thing that both Steve and me went through the
effort of creating such buffering mechanism, because it created healthy
competition and we have been able to cross-check each other code (well,
I actually pointed out some bugs he had in his tracer code just because
I ran into the same issues).
The only thing is that ftrace needs are a subset of what LTTng needs and
provides. As Steve stated very clearly in the past weeks, he doesn't
care about exporting binary data in an organized self-described manner.
This is actually a key component of LTTng. Therefore, there seems to be
no will nor need to self-describe the information in the trace buffers
from Steve's point of view.
However, even if such self-description is not used by ftrace-type
tracers within the kernel, it could just be *there* so we can support
high-throughput streaming of organized (non-opaque) binary data when
needed. A ftrace tracer could then participate to this information flow
and make the data available for high-speed extraction. I think this
would be very beneficial to the LTTng use-cases and would not hurt
ftrace tracers at all.
> i see nothing in the feature list of LTTng that we wouldnt want to
> have for ftrace, agreed?
Yes, the only thing is that LTTng might be doing a little bit more than
what ftrace needs, because it needs to export the information to
userspace.
> And we could do an ftrace tracer named
> 'LTTng' which would interact with lttng userspace in the customary
> way.
Or we could think of making ftrace be a LTTng information source, so it
would be able to export all its information to userspace through the
high-speed self-described binary trace buffers (channels) and also
manage to keep all of its current features. The way I see it, because
ftrace has simpler requirements due to the fact it does not export
binary data across the kernel boundary, ftrace buffering can be seen as
a subset of the LTTng requirements.
Besides, looking at LWN reviews of Steve's ring buffer implementation
"A casual perusal of the patch might well leave a reader confused; 2000
lines of relatively complex code to implement what is, in the end, just
a circular buffer. This circular buffer is not even suitable for use by
tracing frameworks yet; a separate "tracing" layer is to be added for
that."
I achieve all the core work of atomic-ops based buffering,
self-description of traces and all I said above with a design easier to
review in a few more lines, but distributed in smaller files :
850 ltt-marker-control.c (marker userspace control, event ID
management)
179 ltt-relay.h
701 ltt-relay-alloc.c (buffer memory backend, vmap-less,
contiguous memory range emulated by software)
1648 ltt-relay.c (atomic buffer writer/reader
synchronization)
780 ltt-tracer.h (header definitions, prototypes, inlines)
Compared to :
2241 ring_buffer.c
130 ring_buffer.h
So in the end, my argumentation is not based on a simple "I prefer my
code to someone else's code", but simply that I think it could be easier
to integrate the tracer with the fewer constraints into the tracer with
the more constraints (principally exporting data to userspace) than to
do the opposite.
And all ftrace could need that LTTng currently lacks (like in-kernel
binary-to-text converter) is currently on the LTTng roadmap.
Mathieu
>
> Ingo
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
next prev parent reply other threads:[~2008-11-24 8:05 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-14 22:47 [patch 00/16] Markers and Tracepoints Updates for -tip Mathieu Desnoyers
2008-11-14 22:47 ` [patch 01/16] RCU read sched notrace Mathieu Desnoyers
2008-11-16 4:00 ` Paul E. McKenney
2008-11-14 22:47 ` [patch 02/16] Marker fix unregister Mathieu Desnoyers
2008-11-14 22:47 ` [patch 03/16] markers: Add missing stdargs.h include, needed due to va_list usage Mathieu Desnoyers
2008-11-14 22:47 ` [patch 04/16] Markers use rcu_*_sched_notrace and notrace Mathieu Desnoyers
2008-11-14 22:47 ` [patch 05/16] Markers use module notifier Mathieu Desnoyers
2008-11-16 8:52 ` [PATCH] markers/tracpoints: fix non-modular build Ingo Molnar
2008-11-17 5:39 ` Mathieu Desnoyers
2008-11-14 22:47 ` [patch 06/16] Markers auto enable tracepoints (new API : trace_mark_tp()) Mathieu Desnoyers
2008-11-16 7:59 ` Ingo Molnar
2008-11-18 4:44 ` Mathieu Desnoyers
2008-11-18 16:30 ` Ingo Molnar
2008-11-23 16:40 ` Mathieu Desnoyers
2008-11-23 16:49 ` Ingo Molnar
2008-11-24 8:05 ` Mathieu Desnoyers [this message]
2008-11-25 12:23 ` KOSAKI Motohiro
2008-11-25 17:24 ` Frank Ch. Eigler
2008-11-14 22:47 ` [patch 07/16] Markers : create DEFINE_MARKER and GET_MARKER (new API) Mathieu Desnoyers
2008-11-14 22:47 ` [patch 08/16] Tracepoints : Samples fix teardown Mathieu Desnoyers
2008-11-14 22:47 ` [patch 09/16] Tracepoint fix disable Mathieu Desnoyers
2008-11-14 22:47 ` [patch 10/16] Tracepoints use rcu_*_sched_notrace Mathieu Desnoyers
2008-11-14 22:47 ` [patch 11/16] Tracepoint Use Unregister Return Value Mathieu Desnoyers
2008-11-14 22:47 ` [patch 12/16] Tracepoint do not put arguments in name Mathieu Desnoyers
2008-11-14 22:47 ` [patch 13/16] Tracepoints : use modules notifiers Mathieu Desnoyers
2008-11-14 22:47 ` [patch 14/16] Tracepoints : add DECLARE_TRACE() and DEFINE_TRACE() Mathieu Desnoyers
2008-11-14 22:47 ` [patch 15/16] Tracepoints : documentation fix teardown Mathieu Desnoyers
2008-11-14 22:47 ` [patch 16/16] marker_synchronize_unregister->tracepoint_synchronize_unregister Mathieu Desnoyers
2008-11-16 7:48 ` Ingo Molnar
2008-11-17 5:36 ` Mathieu Desnoyers
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=20081124080511.GA8501@Krystal \
--to=mathieu.desnoyers@polymtl.ca \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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