[ltt-dev] Babel Trace

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu Jun 9 11:17:51 EDT 2011

* Klein, Russell (russell_klein at mentor.com) wrote:
> Mathieu,
> I have found a need to use a very old version of LTTng, which produces
> a trace file format of 1.0.  Do you think it would be practical to use
> Babel trace to convert the file from 1.0 format to 2.6 for analysis
> and viewing?  Would you have any advice on how to approach this?

Hi Russell,

I'm taking the liberty to CC ltt-dev at lists.casi.polymtl.ca as others
will benefit from this explanation:

Sure, babeltrace could handle this. Not sure which "1.0" version you
refer to (probably a very very old LTTng) ;-). There would seem to be
more interest in converting from LTTng 0.x trace format 2.6 to the new
CTF, or in your case convert from the very old LTTng trace format to
CTF, rather than from the (very old) LTTng 1.0 to the (old) LTTng 0.x
trace format 2.6. One of the major advantage of converting to CTF is
that you only need to convert the metadata, not the whole trace streams.

Considering conversion to CTF, the way I would recommend handling this
task would be:

1) look at lttv ltt/marker.c parse_c_type() and parse_trace_type():
these parse the marker metadata.

2) You'll need to create a babeltrace input-side plugin, e.g.
"lttng-legacy-0.x", that takes the LTTng traces as input, and converts
the marker metadata into CTF metadata format. Have a look at babeltrace
converter/babeltrace-log.c to see an example of how to convert from a
format (here dmesg) to CTF. In your case though, you'll only need to
convert the LTTng 0.x "metadata_NN" files into a CTF "metadata" file (a
single file). The plugin "lttng-legacy-0.x" could detect the LTTng
major/minor trace version numbers in the input trace and handle
1.0/2.5/2.6 formats appropriately within the same plugin.

I recommend you do not even convert the LTTng 0.x trace streams per se:
you just need to create the new "metadata" file and delete the old ones
(metadata_NN). However, you'll have to generate CTF metadata that
describes the LTTng 0.x packet header (functionally equivalent to the
lttng 0.x subbuffer header) and event header, which might both differ
slightly from the LTTng 2.0 headers in terms of layout. You'll have to
add description of these headers in the metadata file you create.

Given that the plugin you'll create will be derived from LTTV marker.c,
licensed under LGPLv2.1, it would seem appropriate to keep this license
for the plugin. I would very much welcome this contribution into the
babeltrace source tree.



Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.

More information about the lttng-dev mailing list