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>
Tue, 3 Sep 2019 20:10:03 +0000 (16:10 -0400)
commit6fa5fe7cc78bea0b0bba154a0f911d3df530e18f
treeebf9764e52ca875c7b04d87728e0c73a026cb71a
parent84f3bd075b45f762b0dea5c1d48bc17a3f3c5365
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.039298 seconds and 5 git commands to generate.