3 # Copyright (C) 2013 Julien Desfossez <julien.desfossez@efficios.com>
4 # Copyright (C) 2013 David Goulet <dgoulet@efficios.com>
6 # SPDX-License-Identifier: LGPL-2.1-only
8 TEST_DESC
="Live - Kernel space tracing"
11 TESTDIR
=$CURDIR/..
/..
/..
/
17 EVENT_NAME
="lttng_test_filter_event"
19 TRACE_PATH
=$
(mktemp
--tmpdir -d tmp.test_live_kernel_trace_path.XXXXXX
)
21 DIR
=$
(readlink
-f $TESTDIR)
23 source $TESTDIR/utils
/utils.sh
25 function setup_live_tracing
()
27 # Create session with default path
28 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$SESSION_NAME --live $DELAY_USEC \
29 -U net
://localhost
>/dev
/null
2>&1
31 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$EVENT_NAME" -s $SESSION_NAME -k >/dev
/null
2>&1
32 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN start
$SESSION_NAME >/dev
/null
2>&1
35 function clean_live_tracing
()
37 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN stop
$SESSION_NAME >/dev
/null
2>&1
38 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN destroy
$SESSION_NAME >/dev
/null
2>&1
42 # Need root access for kernel tracing.
43 if [ "$(id -u)" == "0" ]; then
46 echo "Root access is needed. Skipping all tests."
52 start_lttng_sessiond_notap
53 start_lttng_relayd_notap
"-o $TRACE_PATH"
57 echo -n "1" > /proc
/lttng-test-filter-event
60 $TESTDIR/regression
/tools
/live
/live_test
64 stop_lttng_relayd_notap
65 stop_lttng_sessiond_notap
67 modprobe
--remove lttng-test