Backport: Relayd: introduce --group-output-by-session
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 19 Jun 2018 02:46:25 +0000 (22:46 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 28 Jun 2018 12:59:00 +0000 (08:59 -0400)
commit4d27e2b42ffbca109299388099b03e65b54c1ab3
tree5a4d6d7f2592306ab12687ff97970da55412b844
parente0884220df0a1e9b64fe353666216cfceb28cd22
Backport: Relayd: introduce --group-output-by-session

LTTng-relayd now support the grouping of trace data per session name.
This mode can be used via the "--group-output-per-session"

The default, and current way, of grouping is done around the hostname of
the traced system.

When grouped by host the following folder hierarchy is mostly found on the filesystem:

    <hostname>/<session_name>[-<datetime>]/<trace>

When using "--group-output-per-session", the following hierarchy is
found on the filesystem:

    <session_name>/<hostname>[-<datetime>]/<trace>

The datetime is not always present given how it is generated in certain
situations either on the client (cli) or in lttng-sessiond and specified
output type.

This commit ensure maximum compatibility with all lttng-relayd client
(lttng-consumerd) version.

Further work can be accomplished on the
client (cli), lttng-sessiond, lttng-consumerd to pass individual path
information: session name, datetime and hostname. Note that the
automatic naming can be problematic since the datetime is used inside
the session name while when using a defined session name it is not part
of the session name. Still, this would leave older lttng-relayd client
version in the dark given that such modification would require
communication API changes. The current solution ensure that even when
dealing with older client the grouping option is respected.

The received paths are tokenized in 3 tokens.

The first one is the hostname. This is respected across all
communications. Note that, the hostname is already known since the
create session command (version >= 2.4).

The second one can either be a session name, with or without a datetime,
or extra path information. The extra path information come from the URIs
set at the client level:

    lttng create --set-url=net://localhost/extra/path/information

When the second token is extra path information the session name is
never present in the path. We reuse the name passed on the create
session command (version >= 2.4).

The datetime, if present, is extracted from the session name passed by
the client or if not present from the session name passed by the create
session command. This enable the support of automatic session name.

The third one is the rest of the path. No information extraction is done
on this token.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
src/bin/lttng-relayd/cmd-2-1.c
src/bin/lttng-relayd/cmd-2-1.h
src/bin/lttng-relayd/cmd-2-2.c
src/bin/lttng-relayd/cmd-2-2.h
src/bin/lttng-relayd/lttng-relayd.h
src/bin/lttng-relayd/main.c
src/bin/lttng-relayd/utils.c
src/bin/lttng-relayd/utils.h
This page took 0.028799 seconds and 5 git commands to generate.