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)
commit526ab5f05e2f5e78a0a8bf70da2325a1b9fe54fb
treecb46570eaf4c8e53f6547f526afbb54a35471255
parent58f62bf93c581f9b26209d1f8342fbff748e4a46
ctf: Use environment fields provided by LTTng to make output trace path

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>
plugins/ctf/fs-sink/fs-sink-trace.c
This page took 0.024113 seconds and 4 git commands to generate.