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>
Fri, 21 Sep 2018 04:00:52 +0000 (00:00 -0400)
commitb4d507caca4c97965357fb3d02e60265c12c1a4e
treea3b255c2348f6ab2acb89789bfea487817b4191b
parent0c2d8bff009cde12a64d34caa3f171fae077ccf8
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.02872 seconds and 5 git commands to generate.