[lttng-dev] events injection / merging traces

Jonathan Rajotte-Julien jonathan.rajotte-julien at efficios.com
Thu Jul 4 10:52:26 EDT 2019


Hi Carlo,

On Wed, Jul 03, 2019 at 01:30:58PM +0100, Carlo Caione wrote:
> Hi,
> is there an easy way to "inject" new events in a LLTng trace? (you can also
> read that as: is there an easy way to merge two LLTng traces?).

Injecting would be possible using a plugin (C or python) in babeltrace 2.

> 
> I see that I can use [python] babeltrace.TraceCollection() + add_trace() to
> merge multiple traces, but it seems that I cannot output the resultant
> merged trace again as CTF.

Babelrace 2 does have a default plugin for outputting to CTF but the result
might not be the one you expect. If you have two CTF traces as sources, two CTF
traces will be outputted by the current CTF sink. This is done for multiple
reasons.

The major one is that there is multiple places where clashes (stream class,
event) can happen (IDs etc.). The easy solution would be to generate new IDs but
it might lead to confusion as to why the IDs of an input trace are not found in
a resulting merge of traces or at least not the "expected" one.

There is a special case where all input traces are chunk of the same tracing
session (lttng-tools 2.11 rotation feature) since we have a guaranteed to have
no clash.

People who are more familiar with CTF,please do not restrain yourself on correcting me
here.

>From what I understand, not much would prevent someone that knows the tradeoff
to implement such merging plugin. It simply does not exists today.

It also depends on what you mean by a single CTF trace.

This leads to, as always, whats is the end goal here?

Cheers
-- 
Jonathan Rajotte-Julien
EfficiOS


More information about the lttng-dev mailing list