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 - User space tracing"
11 TESTDIR
=$CURDIR/..
/..
/..
/
15 TESTAPP_PATH
="$TESTDIR/utils/testapp"
16 TESTAPP_NAME
="gen-ust-events"
17 TESTAPP_BIN
="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
20 EVENT_NAME
="tp:tptest"
22 TRACE_PATH
=$
(mktemp
-d)
24 DIR
=$
(readlink
-f $TESTDIR)
26 source $TESTDIR/utils
/utils.sh
30 function setup_live_tracing
()
32 # Create session with default path
33 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$SESSION_NAME --live $DELAY_USEC \
34 -U net
://localhost
>/dev
/null
2>&1
36 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$EVENT_NAME" -s $SESSION_NAME -u >/dev
/null
2>&1
37 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN start
$SESSION_NAME >/dev
/null
2>&1
40 function clean_live_tracing
()
42 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN stop
$SESSION_NAME >/dev
/null
2>&1
43 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN destroy
$SESSION_NAME >/dev
/null
2>&1
47 file_sync_after_first
=$
(mktemp
-u)
49 start_lttng_sessiond_notap
50 start_lttng_relayd_notap
"-o $TRACE_PATH"
54 # Run app in background
55 $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event ${file_sync_after_first} >/dev
/null
2>&1
57 while [ ! -f "${file_sync_after_first}" ]; do
62 $TESTDIR/regression
/tools
/live
/live_test
64 # Wait for the applications started in background
69 rm -f ${file_sync_after_first}
71 stop_lttng_sessiond_notap
72 stop_lttng_relayd_notap