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/..
/..
/..
/
23 SESSIOND_BIN
="lttng-sessiond"
24 RELAYD_BIN
="lttng-relayd"
26 BABELTRACE_BIN
="babeltrace"
32 EVENT_NAME
="sched_switch"
34 TRACE_PATH
=$
(mktemp
-d)
36 DIR
=$
(readlink
-f $TESTDIR)
38 source $TESTDIR/utils
/utils.sh
40 function setup_live_tracing
()
42 # Create session with default path
43 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$SESSION_NAME --live $DELAY_USEC \
44 -U net
://localhost
>/dev
/null
2>&1
46 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$EVENT_NAME" -s $SESSION_NAME -k >/dev
/null
2>&1
47 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN start
$SESSION_NAME >/dev
/null
2>&1
50 function clean_live_tracing
()
52 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN stop
$SESSION_NAME >/dev
/null
2>&1
53 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN destroy
$SESSION_NAME >/dev
/null
2>&1
57 # Need root access for kernel tracing.
58 if [ "$(id -u)" == "0" ]; then
61 echo "Root access is needed. Skipping all tests."
65 if [ -z $
(pidof lt-
$SESSIOND_BIN) ]; then
66 $DIR/..
/src
/bin
/lttng-sessiond
/$SESSIOND_BIN --daemonize --quiet --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
68 echo "Fail to start lttng-sessiond"
71 # Wait for sessiond to bootstrap
76 if [ -z $
(pidof lt-
$RELAYD_BIN) ]; then
77 $DIR/..
/src
/bin
/lttng-relayd
/$RELAYD_BIN $opt >/dev
/null
2>&1 &
79 echo "Fail to start lttng-relayd (opt: $opt)"
87 $TESTDIR/regression
/tools
/live
/live_test
92 PID_RELAYD
=`pidof lt-$RELAYD_BIN`
93 kill $PID_RELAYD >/dev
/null
2>&1
95 echo "Kill lttng-relayd (pid: $PID_RELAYD)"
99 while [ -n "$out" ]; do
100 out
=$
(pidof lt-
$RELAYD_BIN)
106 PID_SESSIOND
=`pidof lt-$SESSIOND_BIN`
107 kill $PID_SESSIOND >/dev
/null
2>&1
108 if [ $?
-eq 1 ]; then
109 echo "Kill sessiond daemon"
113 while [ -n "$out" ]; do
114 out
=$
(pidof lt-
$SESSIOND_BIN)
This page took 0.032952 seconds and 4 git commands to generate.