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 -t tmp.test_test_live_lttng_ust_trace_path.XXXXXX
)
24 DIR
=$
(readlink
-f $TESTDIR)
28 source $TESTDIR/utils
/utils.sh
30 # MUST set TESTDIR before calling those functions
33 print_test_banner
"$TEST_DESC"
35 bail_out_if_no_babeltrace
37 function test_custom_url
()
39 # Create session with custom URL
40 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$SESSION_NAME --live $DELAY_USEC \
41 -C tcp
://localhost
:1819 -D tcp
://localhost
:9187 >/dev
/null
2>&1
42 ok $?
"Create session in live mode with delay $DELAY_USEC and custom URLs"
45 function setup_live_tracing
()
47 # Create session with default path
48 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$SESSION_NAME --live $DELAY_USEC \
49 -U net
://localhost
>/dev
/null
2>&1
50 ok $?
"Create session in live mode with delay $DELAY_USEC"
52 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME
53 start_lttng_tracing_ok
$SESSION_NAME
56 function clean_live_tracing
()
58 stop_lttng_tracing_ok
$SESSION_NAME
59 destroy_lttng_session_ok
$SESSION_NAME
63 start_lttng_relayd
"-o $TRACE_PATH"
67 $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT >/dev
/null
2>&1
71 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH