From mboxrd@z Thu Jan 1 00:00:00 1970 From: alexandre.montplaisir@polymtl.ca (Alexandre Montplaisir) Date: Tue, 17 Apr 2012 11:30:30 -0400 Subject: [lttng-dev] Writing a babeltrace output plugin In-Reply-To: <20120417150558.GA31475@Krystal> References: <524C960C5DFC794E82BE548D825F05CF29D8A8@EU-MBX-04.mgc.mentorg.com> <524C960C5DFC794E82BE548D825F05CF29D8C6@EU-MBX-04.mgc.mentorg.com> <20120403125754.GC14534@Krystal> <524C960C5DFC794E82BE548D825F05CF29F0FE@EU-MBX-04.mgc.mentorg.com> <20120417150558.GA31475@Krystal> Message-ID: <4F8D8C96.5020301@polymtl.ca> 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