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
--tmpdir -d tmp.test_live_ust_trace_path.XXXXXX
)
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
--tmpdir -u tmp.test_live_ust_sync_after_first.XXXXXX
)
49 start_lttng_sessiond_notap
50 start_lttng_relayd_notap
"-o $TRACE_PATH"
54 $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event ${file_sync_after_first} >/dev
/null
2>&1
56 while [ ! -f "${file_sync_after_first}" ]; do
61 $TESTDIR/regression
/tools
/live
/live_test
65 rm -f ${file_sync_after_first}
67 stop_lttng_sessiond_notap
68 stop_lttng_relayd_notap