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 with tracefile_count"
22 TESTDIR
=$CURDIR/..
/..
/..
/
23 SESSIOND_BIN
="lttng-sessiond"
24 RELAYD_BIN
="lttng-relayd"
26 BABELTRACE_BIN
="babeltrace"
30 TESTAPP_PATH
="$TESTDIR/utils/testapp"
31 TESTAPP_NAME
="gen-ust-events"
32 TESTAPP_BIN
="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
35 EVENT_NAME
="tp:tptest"
37 TRACE_PATH
=$
(mktemp
-d)
39 DIR
=$
(readlink
-f $TESTDIR)
41 source $TESTDIR/utils
/utils.sh
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
51 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-channel
--subbuf-size 16k
-C 16k
-W 10 -u chan1
52 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$EVENT_NAME" -s $SESSION_NAME -u -c chan1
>/dev
/null
2>&1
53 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN start
$SESSION_NAME >/dev
/null
2>&1
56 function clean_live_tracing
()
58 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN stop
$SESSION_NAME >/dev
/null
2>&1
59 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN destroy
$SESSION_NAME >/dev
/null
2>&1
63 file_sync_after_first
=$
(mktemp
-u)
65 start_lttng_sessiond_notap
66 start_lttng_relayd_notap
"-o $TRACE_PATH"
70 # Run app in background
71 $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ${file_sync_after_first} >/dev
/null
2>&1
73 while [ ! -f "${file_sync_after_first}" ]; do
78 $TESTDIR/regression
/tools
/live
/live_test
80 # Wait for the applications started in background
85 rm -f ${file_sync_after_first}
87 stop_lttng_relayd_notap
88 stop_lttng_sessiond_notap