[lttng-dev] Writing a babeltrace output plugin

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Apr 17 11:48:58 EDT 2012


* Alexandre Montplaisir (alexandre.montplaisir at polymtl.ca) wrote:
> On 12-04-17 11:05 AM, Mathieu Desnoyers wrote:
> > [...]
> > The ideas I pondered were either to change the grammar late in the
> > game and prefix a dot (".") before any toplevel dynamic scope, or make
> > the LTTng tracer preprend an underscore before each event field, which
> > gets removed by the trace analyzer. I'm not particularly proud of this
> > hack though. Comments are welcome. 
> 
> Matthew and I have discussed it before, and adding an underscore in
> front is fine. However, we think this should be specified in the CTF
> spec, and should not be optional. This makes writing a parser much
> easier, since you systematically remove the first character, and it
> avoids having to parse the first character for every single field name.
> 
> For example:
> developer adds a tracepoint, with a field called "field1"
> tracer adds the underscore when writing the CTF metadata, "_field1"
> when reading a trace, the parser removes the "_"
> Viewers and readers (Babeltrace, Eclipse, etc.) only see the "field1" part.
> 
> That way users never see the underscore itself.
> 
> Thoughts?

We also have to consider the case where CTF metadata is generated by
hand for DSP/bare metal tracing, and not dynamically by a tracer. It
would be cumbersome in that case to require the underscore prefix all
the time, given that the person who writes the field names can choose
them so they do not clash with event, traec, stream, env.

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list