plugins/ctf/fs-src: Session rotation support: merge traces with same uuid
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 16 Apr 2019 20:16:01 +0000 (16:16 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:39 +0000 (18:19 -0400)
commitadb623c27633580e01f7f7c29a1b91be762f0dd8
treebf347f4ae49ebad1ef94f8e665edca358f4de2a6
parentbf5b774868baca41556fde4897c740098a22c590
plugins/ctf/fs-src: Session rotation support: merge traces with same uuid

This patch makes the src.ctf.fs component merge traces that have the
same UUID, with the intent of supporting traces output by LTTng's
session rotation feature.

When using this feature of LTTng, the user ends up with multiple traces
that are independent (with their own metadata and data files), except
for the fact that they share the same trace uuid.  The goal of this
patch is to make Babeltrace realize this and make all those traces
appear as a single trace.

The approach taken is to scan the search paths (passed as parameter to
the component) as usual and create a ctf_fs_trace for each found trace.
We then go over the list of traces in the component and merge those
having the same UUID.

Merging traces consists of merging corresponding data stream file groups
(ctf_fs_ds_file_group structs).  Two ctf_fs_ds_file_group structs are
corresponding if they have the same stream_id (aka stream_instance_id in
CTF) and stream class id.

Merging two ctf_fs_ds_file_group structs consists of merging their list
of ctf_fs_ds_file_info structs, making sure to keep the resulting list
sorted by begin timestamp.

Since the trace-info query also uses create_ctf_fs_traces, its behavior
is updated as expected.  Doing a trace-info on a directory containing
multiple traces with the same UUID will result in a single trace with
multiple files per stream.  A little drawback/inconsistency that will be
address later is that the trace object in the output has a single
"path", which is set to the path of one of the original traces.
Ideally, it should have also have a list of paths and list all the
paths of the "physical" traces that form this "logical" trace.

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: Ib290cf08119f9be4344057b2544b4627eea3f450
plugins/ctf/fs-src/fs.c
This page took 0.024631 seconds and 4 git commands to generate.