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 - Kernel space tracing"
22 TESTDIR
=$CURDIR/..
/..
/..
/
28 EVENT_NAME
="sched_switch"
30 TRACE_PATH
=$
(mktemp
-d)
32 DIR
=$
(readlink
-f $TESTDIR)
34 source $TESTDIR/utils
/utils.sh
36 function setup_live_tracing
()
38 # Create session with default path
39 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$SESSION_NAME --live $DELAY_USEC \
40 -U net
://localhost
>/dev
/null
2>&1
42 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$EVENT_NAME" -s $SESSION_NAME -k >/dev
/null
2>&1
43 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN start
$SESSION_NAME >/dev
/null
2>&1
46 function clean_live_tracing
()
48 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN stop
$SESSION_NAME >/dev
/null
2>&1
49 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN destroy
$SESSION_NAME >/dev
/null
2>&1
53 # Need root access for kernel tracing.
54 if [ "$(id -u)" == "0" ]; then
57 echo "Root access is needed. Skipping all tests."
61 start_lttng_sessiond_notap
62 start_lttng_relayd_notap
"-o $TRACE_PATH"
67 $TESTDIR/regression
/tools
/live
/live_test
71 stop_lttng_relayd_notap
72 stop_lttng_sessiond_notap