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
17 TEST_DESC
="UST tracer - Multi-session"
20 TESTDIR
=$CURDIR/..
/..
/..
22 SESSION_NAME
="multi-session"
23 EVENT_NAME
="ust_gen_nevents:tptest"
26 source $TESTDIR/utils
/utils.sh
28 if [ ! -x "$CURDIR/gen-nevents" ]; then
29 BAIL_OUT
"No UST nevents binary detected."
32 # MUST set TESTDIR before calling those functions
34 test_multi_session
() {
37 # BEFORE application is spawned
38 for i
in `seq 0 3`; do
39 create_lttng_session_ok
"$SESSION_NAME-$i" "$TRACE_PATH/$i"
40 enable_ust_lttng_event_ok
"$SESSION_NAME-$i" "$EVENT_NAME$i"
41 start_lttng_tracing_ok
"$SESSION_NAME-$i"
44 .
/$CURDIR/gen-nevents
$NR_ITER &
45 ok $?
"Start application to generate $NR_ITER events"
48 pass
"Wait for events to record"
50 for i
in `seq 0 3`; do
51 stop_lttng_tracing_ok
"$SESSION_NAME-$i"
52 destroy_lttng_session_ok
"$SESSION_NAME-$i"
53 out
=$
(babeltrace
"$TRACE_PATH/$i" |
grep "$EVENT_NAMEi$i" |
wc -l)
54 if [ $out -ne $NR_ITER ]; then
55 fail
"Trace validation of $SESSION_NAME-$i"
56 diag
"No events found."
60 pass
"Trace validation of $SESSION_NAME-$i"
61 diag
"Found $out event(s) for $SESSION_NAME-$i."
69 # MUST set TESTDIR before calling those functions
73 print_test_banner
"$TEST_DESC"
77 TRACE_PATH
=$
(mktemp
-d)
81 if [ $out -ne 0 ]; then