From e47e3f26636479a2ca2637262ca53b67c3a8acc8 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Sat, 7 Mar 2020 16:15:13 -0500 Subject: [PATCH 1/2] Remove lttng-sessiond call from CI config Signed-off-by: Christophe Bedard --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) 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 From e2893201b0ac572fe9dcfc1c3de808267e9934e6 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Sat, 7 Mar 2020 16:04:51 -0500 Subject: [PATCH 2/2] Start a session daemon if there isn't one before setting up tracing Signed-off-by: Christophe Bedard --- tracetools_trace/tracetools_trace/tools/lttng_impl.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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)