Re: [RFC] Userspace tracing memory mappings

From: Mathieu Desnoyers
Date: Wed Jan 23 2008 - 17:06:43 EST


* Dave Hansen (haveblue@xxxxxxxxxx) wrote:
> On Wed, 2008-01-23 at 11:04 -0500, Mathieu Desnoyers wrote:
> > Since memory management is not my speciality, I would like to know if
> > there are some implementation details I should be aware of for my
> > LTTng userspace tracing buffers. Here is what I want to do :
>
> Can you start with a little background by telling us what a userspace
> tracing buffer _is_? Maybe a few requirements about what you need it to
> do and why, as well?
>
> -- Dave
>

Sure,

Userspace tracing is :

- A userspace process wants to record information to a circular ring
buffer. This information has a timestamp. It should disrupt the
timings minimally. The timestamps must be synchronized with the
timestamps given to the kernel trace events so we can analyze all the
information together.

- When one subbuffer of the ring buffer is filled, the information is
ready to be read by a "trace dumping" process and sent to disk or to
the network. At this point, the traced process raises a flag that will
be checked periodically by the OS to wake up the disk/network dumper
daemon. (for future reference, I use the term "buffer writer" when I
talk about the traced process and the term "buffer reader" when
talking about the disk/network dumper daemon).

There is more information in the email I sent to Frank Eigler. Please
feel free to ask for more if I am not clear about specific points.

A lot of the background information is already explained in the kernel
tracing paper I presented at OLS2006, it might be a good start :

http://ltt.polymtl.ca/papers/desnoyers-ols2006.pdf

Another requirement I am trying to meet is protection of tracing buffers
against corruption coming from other userspace process. K42 implemented
their tracing buffers shared system-wide : with the OS too. The
processes have full access to the kernel buffers and can therefore
corrupt the whole system's trace. This is something I would like not to
allow.

Mathieu

--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
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/