[lttng-dev] Writing a babeltrace output plugin
Alexandre Montplaisir
alexandre.montplaisir at polymtl.ca
Tue Apr 17 11:30:30 EDT 2012
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?
--
Alexandre Montplaisir
DORSAL lab,
École Polytechnique de Montréal
More information about the lttng-dev
mailing list