3 # Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
5 # This library is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Lesser General Public License as published by the Free
7 # Software Foundation; version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 SESSIOND_BIN
="lttng-sessiond"
20 BABELTRACE_BIN
="babeltrace"
22 function start_sessiond
()
24 if [ -z $
(pidof
$SESSIOND_BIN) ]; then
25 echo -n "Starting session daemon... "
26 $TESTDIR/..
/src
/bin
/lttng-sessiond
/$SESSIOND_BIN --daemonize --quiet
28 echo -e "\e[1;31mFAILED\e[0m"
31 echo -e "\e[1;32mOK\e[0m"
36 function stop_sessiond
()
38 PID_SESSIOND
=`pidof lt-$SESSIOND_BIN`
40 echo -e -n "Killing session daemon... "
41 kill $PID_SESSIOND >/dev
/null
2>&1
43 echo -e "\e[1;31mFAILED\e[0m"
46 echo -e "\e[1;32mOK\e[0m"
50 function create_lttng_session
()
55 echo -n "Creating lttng session $SESSION_NAME in $TRACE_PATH "
56 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$sess_name -o $trace_path >/dev
/null
2>&1
58 echo -e "\e[1;31mFAILED\e[0m"
61 echo -e "\e[1;32mOK\e[0m"
62 #echo $out | grep "written in" | cut -d' ' -f6
66 function enable_ust_lttng_event
()
71 echo -n "Enabling lttng event $event_name for session $sess_name "
72 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
$event_name -s $sess_name -u >/dev
/null
2>&1
74 echo -e '\e[1;31mFAILED\e[0m'
77 echo -e "\e[1;32mOK\e[0m"
81 function start_tracing
()
85 echo -n "Start lttng tracing for session $sess_name "
86 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN start
$sess_name >/dev
/null
2>&1
88 echo -e '\e[1;31mFAILED\e[0m'
91 echo -e "\e[1;32mOK\e[0m"
95 function stop_tracing
()
99 echo -n "Stop lttng tracing for session $sess_name "
100 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN stop
$sess_name >/dev
/null
2>&1
101 if [ $?
-eq 1 ]; then
102 echo -e '\e[1;31mFAILED\e[0m'
105 echo -e "\e[1;32mOK\e[0m"
109 function destroy_lttng_session
()
113 echo -n "Destroy lttng session $sess_name "
114 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN destroy
$sess_name >/dev
/null
2>&1
115 if [ $?
-eq 1 ]; then
116 echo -e '\e[1;31mFAILED\e[0m'
119 echo -e "\e[1;32mOK\e[0m"
123 function trace_matches
()
129 echo -n "Looking for $nr_iter $event_name in $trace_path "
131 count
=$
($BABELTRACE_BIN $trace_path |
grep $event_name |
wc -l)
132 if [ "$count" -ne "$nr_iter" ]; then
133 echo -e "$count found in trace \e[1;31mFAILED\e[0m"
136 echo -e "Trace is coherent \e[1;32mOK\e[0m"
This page took 0.033587 seconds and 4 git commands to generate.