[lttng-dev] [PATCH lttng-tools] Fix: initialize sessions pointer to NULL

2019-10-25 Thread Jonathan Rajotte
lttng_list_sessions does not set the passed pointer to NULL on empty return. This lead to deallocation of non-allocated memory (segfault). For returns of size 0, the value of the passed argument should be considered "undefined". Refactor error handling a bit by removing the "error" jump. Always c

[lttng-dev] [PATCH lttng-tools 1/5] Fix: move set base_path of session to URI configuration

2019-10-25 Thread Jonathan Rajotte
The load code still use the "old" API to create and configure network session output (lttng_create_session followed by lttng_set_consumer_url). The session base_path is only set in the cmd_create_session_from_descriptor function. This results in invalid network output path when using a loaded sessi

[lttng-dev] [PATCH lttng-tools 4/5] Tests: base path: lttng load for session configuration

2019-10-25 Thread Jonathan Rajotte
Signed-off-by: Jonathan Rajotte --- .../base-path/load-stream-extra-path.lttng| 66 +++ tests/regression/tools/base-path/test_ust | 29 +++- 2 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 tests/regression/tools/base-path/load-stream-extra-path.l

[lttng-dev] [PATCH lttng-tools 2/5] Refactor: Move set session path to own function

2019-10-25 Thread Jonathan Rajotte
Signed-off-by: Jonathan Rajotte --- Feel free to squash this into the previous commit. --- src/bin/lttng-sessiond/cmd.c | 64 +--- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 1d

[lttng-dev] [PATCH lttng-tools 3/5] Cleanup: remove unused internal lttng_session_descriptor_get_base_path

2019-10-25 Thread Jonathan Rajotte
Signed-off-by: Jonathan Rajotte --- Feel free to squash this into the previous commits. --- include/lttng/session-descriptor-internal.h | 4 src/common/session-descriptor.c | 23 - 2 files changed, 27 deletions(-) diff --git a/include/lttng/session-descrip

[lttng-dev] [PATCH lttng-tools 5/5] Tests: fix shellcheck warning

2019-10-25 Thread Jonathan Rajotte
No need to use random string for session name here, use the test name. Signed-off-by: Jonathan Rajotte --- tests/regression/tools/base-path/test_ust | 36 ++- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/tests/regression/tools/base-path/test_ust b/tests/re