ctf: Use environment fields provided by LTTng to make output trace path
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Apr 2019 13:32:58 +0000 (09:32 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:39 +0000 (18:19 -0400)
Starting with version 2.11, the LTTng tracer includes in the trace
environment all the information necessary to rebuild the output path
that it itself uses when outputting traces.  This lets us recreate an
output path similar to what LTTng does when outputting ctf traces (with
the exception that we also add a level with the hostname, which LTTng
doesn't).

If the trace does not come from LTTng, or comes from LTTng < 2.11, we
keep using the same strategy: use a trace path based on the trace name,
which is itself based on the original directory.

This feature will especially be useful in conjunction with session
rotation: since the input trace is actually composed of multiple
traces/chunks, the trace name would otherwise be based on one particular
of these chunks.  With the environment values, we can recreate a path
that describes correctly the trace as a whole.  The output path is then
similar to what one would have been output by LTTng, if one had not used
the session rotation feature in the first place.

Change-Id: I03c0569869561ec11873b808c47d30196889cb36
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.gerrithub.io/c/eepp/babeltrace/+/451942
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: Philippe Proulx <eeppeliteloop@gmail.com>

No differences found
This page took 0.023856 seconds and 4 git commands to generate.