Fix: honor base path for network URIs
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 14 Aug 2019 17:30:28 +0000 (13:30 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 20:39:15 +0000 (16:39 -0400)
commit6ef3645369c3916398b80b8ad10cc55cde37674e
treebc528be11c93608b52053a63197fba02742f8a4f
parent6b8f00599658b2f44e5d21b071c946294e7b5ba7
Fix: honor base path for network URIs

Starting from 2.11, the following use-case stopped working as expected:

lttng create --set-url=net://localhost/my/path/custom
lttng enable-event -u -a
lttng start
[ run app ]

The output trace is expected in the following directory on the relayd
(no timestamp suffix):

$LTTNG_HOME/lttng-traces/[hostname]/my/path/custom

Add the base_path information to the session object in the session
daemon, extracted from the network URI, and pass that information to the
relay daemon through the create session (2.11) command.

It also fixes the use-case:

lttng create --snapshot --set-url=net://localhost/my/path/custom
lttng enable-event -u -a
lttng start
[ run app ]
lttng snapshot record

which is expected to record the snapshot under:
$LTTNG_HOME/lttng-traces/[hostname]/my/path/custom/snapshot-[N]-[timestamp]

Similar situation for:

lttng create --snapshot
lttng enable-event -u -a
lttng start
[ run app ]
lttng snapshot record net://localhost/my/path/custom

which is expected to record the snapshot under:
$LTTNG_HOME/lttng-traces/[hostname]/my/path/custom/snapshot-[N]-[timestamp]

Note that specifying the base_path on the snapshot record command
overrides the base path specified at create.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
16 files changed:
include/lttng/session-descriptor-internal.h
src/bin/lttng-relayd/cmd-2-11.c
src/bin/lttng-relayd/cmd-2-11.h
src/bin/lttng-relayd/main.c
src/bin/lttng-relayd/session.c
src/bin/lttng-relayd/session.h
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/consumer.c
src/bin/lttng-sessiond/consumer.h
src/bin/lttng-sessiond/session.c
src/bin/lttng-sessiond/session.h
src/common/relayd/relayd.c
src/common/relayd/relayd.h
src/common/session-descriptor.c
src/common/sessiond-comm/relayd.h
tests/unit/test_session.c
This page took 0.026734 seconds and 4 git commands to generate.