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)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
commit41a65f30c1a30df68ab60e3cce5772cb40337faf
tree02aeb267602633fc8035b270da34ab3e7365fd7e
parentf280892e9c882183c4af86992e41efc39a017802
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.024904 seconds and 4 git commands to generate.