3 # Copyright (C) - 2013 Julien Desfossez <julien.desfossez@efficios.com>
4 # David Goulet <dgoulet@efficios.com>
6 # This library is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU Lesser General Public License as published by the Free
8 # Software Foundation; version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with this library; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 TEST_DESC
="Live - User space tracing"
22 TESTDIR
=$CURDIR/..
/..
/..
/
26 TESTAPP_PATH
="$TESTDIR/utils/testapp"
27 TESTAPP_NAME
="gen-ust-events"
28 TESTAPP_BIN
="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
31 EVENT_NAME
="tp:tptest"
33 TRACE_PATH
=$
(mktemp
-d)
35 DIR
=$
(readlink
-f $TESTDIR)
37 source $TESTDIR/utils
/utils.sh
41 function setup_live_tracing
()
43 # Create session with default path
44 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$SESSION_NAME --live $DELAY_USEC \
45 -U net
://localhost
>/dev
/null
2>&1
47 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$EVENT_NAME" -s $SESSION_NAME -u >/dev
/null
2>&1
48 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN start
$SESSION_NAME >/dev
/null
2>&1
51 function clean_live_tracing
()
53 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN stop
$SESSION_NAME >/dev
/null
2>&1
54 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN destroy
$SESSION_NAME >/dev
/null
2>&1
58 file_sync_after_first
=$
(mktemp
-u)
60 start_lttng_sessiond_notap
61 start_lttng_relayd_notap
"-o $TRACE_PATH"
65 # Run app in background
66 $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ${file_sync_after_first} >/dev
/null
2>&1
68 while [ ! -f "${file_sync_after_first}" ]; do
73 $TESTDIR/regression
/tools
/live
/live_test
75 # Wait for the applications started in background
80 rm -f ${file_sync_after_first}
82 stop_lttng_sessiond_notap
83 stop_lttng_relayd_notap