diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b8d1df0..5fd37bb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,6 @@ tracing_enabled: image: $BASE_IMAGE_ID:$DISTRO script: - lttng --version && apt list lttng-tools liblttng-ust-dev python3-lttng python3-babeltrace - - lttng-sessiond --daemonize - colcon build --symlink-install --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST - . install/local_setup.sh - ./build/tracetools/status diff --git a/tracetools_trace/tracetools_trace/tools/lttng_impl.py b/tracetools_trace/tracetools_trace/tools/lttng_impl.py index 807f732..f859ea8 100644 --- a/tracetools_trace/tracetools_trace/tools/lttng_impl.py +++ b/tracetools_trace/tracetools_trace/tools/lttng_impl.py @@ -16,6 +16,7 @@ from distutils.version import StrictVersion import re +import subprocess from typing import List from typing import Optional from typing import Set @@ -74,6 +75,13 @@ def setup( :param channel_name_kernel: the kernel channel name :return: the full path to the trace directory """ + # Check if there is a session daemon running + if lttng.session_daemon_alive() == 0: + # Otherwise spawn one without doing any error checks + subprocess.run( + ['lttng-sessiond', '--daemonize'], + ) + # Convert lists to sets if not isinstance(ros_events, set): ros_events = set(ros_events)