gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h
gen_nevents_LDADD = -llttng-ust
-noinst_SCRIPTS = run
-EXTRA_DIST = run
+noinst_SCRIPTS = test_before_after
+EXTRA_DIST = test_before_after
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-TEST_DESC="UST tracer - Start tracing before and after execution"
-
-CURDIR=$(dirname $0)/
-TESTDIR=$CURDIR/../../..
-NR_ITER=100
-SESSION_NAME="per-session"
-EVENT_NAME="ust_gen_nevents:tptest"
-
-source $TESTDIR/utils/utils.sh
-
-print_test_banner "$TEST_DESC"
-
-if [ ! -x "$CURDIR/gen-nevents" ]; then
- echo -e "No UST nevents binary detected. Passing."
- exit 0
-fi
-
-# MUST set TESTDIR before calling those functions
-
-test_before_apps() {
- local out
-
- # BEFORE application is spawned
- create_lttng_session $SESSION_NAME $TRACE_PATH
- enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
- start_lttng_tracing $SESSION_NAME
- # Start test
- echo -n "Starting application... "
- ./$CURDIR/gen-nevents $NR_ITER
- echo -n "Ended "
- print_ok
- stop_lttng_tracing $SESSION_NAME
- destroy_lttng_session $SESSION_NAME
-
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
-
- return $?
-}
-
-test_after_apps() {
- local out
-
- echo -n "Starting application... "
- ./$CURDIR/gen-nevents 100 &
- print_ok
-
- # BEFORE application is spawned
- create_lttng_session $SESSION_NAME $TRACE_PATH
- enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
- start_lttng_tracing $SESSION_NAME
-
- # At least hit one event
- sleep 2
-
- stop_lttng_tracing $SESSION_NAME
- destroy_lttng_session $SESSION_NAME
-
- out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
- if [ $out -eq 0 ]; then
- echo -n "No event found. Suppose to have at least one... "
- print_fail
- out=1
- else
- echo -n "Found $out event(s). Coherent... "
- print_ok
- out=0
- fi
-
- return $out
-}
-
-# MUST set TESTDIR before calling those functions
-
-start_lttng_sessiond
-
-echo ""
-echo "=== Start application BEFORE tracing was started ==="
-
-TRACE_PATH=$(mktemp -d)
-
-test_before_apps
-out=$?
-if [ $out -ne 0 ]; then
- stop_lttng_sessiond
- exit $out
-fi
-
-rm -rf $TRACE_PATH
-
-echo ""
-echo "=== Start application AFTER tracing was started ==="
-
-TRACE_PATH=$(mktemp -d)
-
-test_after_apps
-out=$?
-if [ $out -ne 0 ]; then
- stop_lttng_sessiond
- exit $out
-fi
-
-stop_lttng_sessiond
-
-rm -rf $TRACE_PATH
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+TEST_DESC="UST tracer - Start tracing before and after execution"
+
+CURDIR=$(dirname $0)/
+TESTDIR=$CURDIR/../../..
+NR_ITER=100
+SESSION_NAME="per-session"
+EVENT_NAME="ust_gen_nevents:tptest"
+
+source $TESTDIR/utils/utils.sh
+
+print_test_banner "$TEST_DESC"
+
+if [ ! -x "$CURDIR/gen-nevents" ]; then
+ echo -e "No UST nevents binary detected. Passing."
+ exit 0
+fi
+
+# MUST set TESTDIR before calling those functions
+
+test_before_apps() {
+ local out
+
+ # BEFORE application is spawned
+ create_lttng_session $SESSION_NAME $TRACE_PATH
+ enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
+ start_lttng_tracing $SESSION_NAME
+ # Start test
+ echo -n "Starting application... "
+ ./$CURDIR/gen-nevents $NR_ITER
+ echo -n "Ended "
+ print_ok
+ stop_lttng_tracing $SESSION_NAME
+ destroy_lttng_session $SESSION_NAME
+
+ trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+
+ return $?
+}
+
+test_after_apps() {
+ local out
+
+ echo -n "Starting application... "
+ ./$CURDIR/gen-nevents 100 &
+ print_ok
+
+ # BEFORE application is spawned
+ create_lttng_session $SESSION_NAME $TRACE_PATH
+ enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
+ start_lttng_tracing $SESSION_NAME
+
+ # At least hit one event
+ sleep 2
+
+ stop_lttng_tracing $SESSION_NAME
+ destroy_lttng_session $SESSION_NAME
+
+ out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
+ if [ $out -eq 0 ]; then
+ echo -n "No event found. Suppose to have at least one... "
+ print_fail
+ out=1
+ else
+ echo -n "Found $out event(s). Coherent... "
+ print_ok
+ out=0
+ fi
+
+ return $out
+}
+
+# MUST set TESTDIR before calling those functions
+
+start_lttng_sessiond
+
+echo ""
+echo "=== Start application BEFORE tracing was started ==="
+
+TRACE_PATH=$(mktemp -d)
+
+test_before_apps
+out=$?
+if [ $out -ne 0 ]; then
+ stop_lttng_sessiond
+ exit $out
+fi
+
+rm -rf $TRACE_PATH
+
+echo ""
+echo "=== Start application AFTER tracing was started ==="
+
+TRACE_PATH=$(mktemp -d)
+
+test_after_apps
+out=$?
+if [ $out -ne 0 ]; then
+ stop_lttng_sessiond
+ exit $out
+fi
+
+stop_lttng_sessiond
+
+rm -rf $TRACE_PATH
gen_events_SOURCES = main.c tp.c tp.h
gen_events_LDADD = -llttng-ust
-noinst_SCRIPTS = run
-EXTRA_DIST = run
+noinst_SCRIPTS = test_high_throughput
+EXTRA_DIST = test_high_throughput
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-TEST_DESC="UST tracer - Testing high events throughput"
-
-CURDIR=$(dirname $0)/
-TESTDIR=$CURDIR/../../..
-NR_ITER=20
-BIN_NAME="gen-events"
-SESSION_NAME="high-throughput"
-EVENT_NAME="tp:tptest"
-
-source $TESTDIR/utils/utils.sh
-
-print_test_banner "$TEST_DESC"
-
-if [ ! -x "$CURDIR/$BIN_NAME" ]; then
- echo -e "No UST nevents binary detected. Passing."
- exit 0
-fi
-
-TRACE_PATH=$(mktemp -d)
-
-# MUST set TESTDIR before calling those functions
-
-start_lttng_sessiond
-
-create_lttng_session $SESSION_NAME $TRACE_PATH
-
-enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-start_lttng_tracing $SESSION_NAME
-
-for i in `seq 1 $NR_ITER`; do
- ./$CURDIR/$BIN_NAME & >/dev/null 2>&1
-done
-
-echo "Waiting for applications to end"
-while [ -n "$(pidof $BIN_NAME)" ]; do
- echo -n "."
- sleep 0.5
-done
-echo ""
-
-stop_lttng_tracing $SESSION_NAME
-destroy_lttng_session $SESSION_NAME
-
-stop_lttng_sessiond
-
-# Validate test
-
-TEMP_FILE=$(mktemp)
-TEMP_FILE_2=$(mktemp)
-
-traced=$(babeltrace $TRACE_PATH 2>/dev/null | wc -l)
-babeltrace $TRACE_PATH >/dev/null 2>$TEMP_FILE_2
-
-cat $TEMP_FILE_2 | cut -f4 -d " " >$TEMP_FILE
-
-dropped=0
-while read line;
-do
- let dropped=$dropped+$line
-done < $TEMP_FILE
-
-let total=$dropped+$traced
-let wanted=$NR_ITER*1000000
-
-if [ $wanted -ne $total ]; then
- echo -n "Expected $wanted. Dropped $dropped. Recorded $traced. Total $total... "
- print_fail
- out=1
-else
- echo -n "Expected $wanted. Dropped $dropped. Recorded $traced. Total $total... "
- print_ok
- out=0
-fi
-
-rm -rf $TRACE_PATH
-rm $TEMP_FILE $TEMP_FILE_2
-
-exit $out
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+TEST_DESC="UST tracer - Testing high events throughput"
+
+CURDIR=$(dirname $0)/
+TESTDIR=$CURDIR/../../..
+NR_ITER=20
+BIN_NAME="gen-events"
+SESSION_NAME="high-throughput"
+EVENT_NAME="tp:tptest"
+
+source $TESTDIR/utils/utils.sh
+
+print_test_banner "$TEST_DESC"
+
+if [ ! -x "$CURDIR/$BIN_NAME" ]; then
+ echo -e "No UST nevents binary detected. Passing."
+ exit 0
+fi
+
+TRACE_PATH=$(mktemp -d)
+
+# MUST set TESTDIR before calling those functions
+
+start_lttng_sessiond
+
+create_lttng_session $SESSION_NAME $TRACE_PATH
+
+enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
+start_lttng_tracing $SESSION_NAME
+
+for i in `seq 1 $NR_ITER`; do
+ ./$CURDIR/$BIN_NAME & >/dev/null 2>&1
+done
+
+echo "Waiting for applications to end"
+while [ -n "$(pidof $BIN_NAME)" ]; do
+ echo -n "."
+ sleep 0.5
+done
+echo ""
+
+stop_lttng_tracing $SESSION_NAME
+destroy_lttng_session $SESSION_NAME
+
+stop_lttng_sessiond
+
+# Validate test
+
+TEMP_FILE=$(mktemp)
+TEMP_FILE_2=$(mktemp)
+
+traced=$(babeltrace $TRACE_PATH 2>/dev/null | wc -l)
+babeltrace $TRACE_PATH >/dev/null 2>$TEMP_FILE_2
+
+cat $TEMP_FILE_2 | cut -f4 -d " " >$TEMP_FILE
+
+dropped=0
+while read line;
+do
+ let dropped=$dropped+$line
+done < $TEMP_FILE
+
+let total=$dropped+$traced
+let wanted=$NR_ITER*1000000
+
+if [ $wanted -ne $total ]; then
+ echo -n "Expected $wanted. Dropped $dropped. Recorded $traced. Total $total... "
+ print_fail
+ out=1
+else
+ echo -n "Expected $wanted. Dropped $dropped. Recorded $traced. Total $total... "
+ print_ok
+ out=0
+fi
+
+rm -rf $TRACE_PATH
+rm $TEMP_FILE $TEMP_FILE_2
+
+exit $out
gen_events_SOURCES = main.c tp.c tp.h
gen_events_LDADD = -llttng-ust -lurcu
-noinst_SCRIPTS = run
-EXTRA_DIST = run
+noinst_SCRIPTS = test_low_throughput
+EXTRA_DIST = test_low_throughput
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-TEST_DESC="UST tracer - Testing low events throughput"
-
-CURDIR=$(dirname $0)/
-TESTDIR=$CURDIR/../../..
-BIN_NAME="gen-events"
-SESSION_NAME="low-throughput"
-EVENT_NAME="tp:slow"
-
-source $TESTDIR/utils/utils.sh
-
-print_test_banner "$TEST_DESC"
-
-if [ ! -x "$CURDIR/$BIN_NAME" ]; then
- echo -e "No UST nevents binary detected. Passing."
- exit 0
-fi
-
-TRACE_PATH=$(mktemp -d)
-
-# MUST set TESTDIR before calling those functions
-
-start_lttng_sessiond
-
-create_lttng_session $SESSION_NAME $TRACE_PATH
-
-enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-start_lttng_tracing $SESSION_NAME
-
-# This is going to take 20 minutes
-./$CURDIR/$BIN_NAME >/dev/null 2>&1
-
-stop_lttng_tracing $SESSION_NAME
-destroy_lttng_session $SESSION_NAME
-
-stop_lttng_sessiond
-
-# Validate test
-
-last_val=0
-out=0
-
-babeltrace $TRACE_PATH | while read event;
-do
- val=$(echo $event | cut -f10 -d" ")
- val=${val%?}
- th=$(echo $event | cut -f13 -d " ")
-
- if [ $th = '"one"' ]; then
- ((last_val++))
- # We expect here a continous value from 1 to 20
- if [ $last_val -ne $val ]; then
- echo -n "[-] One minute event failed ($val) "
- out=1
- break
- fi
- elif [ $th = '"ten"' ]; then
- # Test 10 minutes counter
- if [ $val -ne 10 ]; then
- # Test 20 minutes counter
- if [ $val -ne 20 ]; then
- echo -n "[-] Ten minutes event failed ($val) "
- out=1
- break
- fi
- fi
- elif [ $th = '"twenty"' ]; then
- # Test 20 minutes counter
- if [ $val -ne 20 ]; then
- echo -n "[-] Twenty minutes event failed ($val) "
- out=1
- break
- fi
- fi
-done
-
-if [ $out -eq 0 ]; then
- echo -n "Trace is coherent... "
- print_ok
-else
- print_fail
-fi
-
-rm -rf $TRACE_PATH
-
-exit $out
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+TEST_DESC="UST tracer - Testing low events throughput"
+
+CURDIR=$(dirname $0)/
+TESTDIR=$CURDIR/../../..
+BIN_NAME="gen-events"
+SESSION_NAME="low-throughput"
+EVENT_NAME="tp:slow"
+
+source $TESTDIR/utils/utils.sh
+
+print_test_banner "$TEST_DESC"
+
+if [ ! -x "$CURDIR/$BIN_NAME" ]; then
+ echo -e "No UST nevents binary detected. Passing."
+ exit 0
+fi
+
+TRACE_PATH=$(mktemp -d)
+
+# MUST set TESTDIR before calling those functions
+
+start_lttng_sessiond
+
+create_lttng_session $SESSION_NAME $TRACE_PATH
+
+enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
+start_lttng_tracing $SESSION_NAME
+
+# This is going to take 20 minutes
+./$CURDIR/$BIN_NAME >/dev/null 2>&1
+
+stop_lttng_tracing $SESSION_NAME
+destroy_lttng_session $SESSION_NAME
+
+stop_lttng_sessiond
+
+# Validate test
+
+last_val=0
+out=0
+
+babeltrace $TRACE_PATH | while read event;
+do
+ val=$(echo $event | cut -f10 -d" ")
+ val=${val%?}
+ th=$(echo $event | cut -f13 -d " ")
+
+ if [ $th = '"one"' ]; then
+ ((last_val++))
+ # We expect here a continous value from 1 to 20
+ if [ $last_val -ne $val ]; then
+ echo -n "[-] One minute event failed ($val) "
+ out=1
+ break
+ fi
+ elif [ $th = '"ten"' ]; then
+ # Test 10 minutes counter
+ if [ $val -ne 10 ]; then
+ # Test 20 minutes counter
+ if [ $val -ne 20 ]; then
+ echo -n "[-] Ten minutes event failed ($val) "
+ out=1
+ break
+ fi
+ fi
+ elif [ $th = '"twenty"' ]; then
+ # Test 20 minutes counter
+ if [ $val -ne 20 ]; then
+ echo -n "[-] Twenty minutes event failed ($val) "
+ out=1
+ break
+ fi
+ fi
+done
+
+if [ $out -eq 0 ]; then
+ echo -n "Trace is coherent... "
+ print_ok
+else
+ print_fail
+fi
+
+rm -rf $TRACE_PATH
+
+exit $out
gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h
gen_nevents_LDADD = -llttng-ust
-noinst_SCRIPTS = run
-EXTRA_DIST = run
+noinst_SCRIPTS = test_multi_session
+EXTRA_DIST = test_multi_session
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-TEST_DESC="UST tracer - Multi-session"
-
-CURDIR=$(dirname $0)/
-TESTDIR=$CURDIR/../../..
-NR_ITER=100
-SESSION_NAME="multi-session"
-EVENT_NAME="ust_gen_nevents:tptest"
-
-source $TESTDIR/utils/utils.sh
-
-print_test_banner "$TEST_DESC"
-
-if [ ! -x "$CURDIR/gen-nevents" ]; then
- echo -e "No UST nevents binary detected. Passing."
- exit 0
-fi
-
-# MUST set TESTDIR before calling those functions
-
-test_multi_session() {
- local out
-
- # BEFORE application is spawned
- for i in `seq 0 3`; do
- create_lttng_session "$SESSION_NAME-$i" "$TRACE_PATH/$i"
- enable_ust_lttng_event "$SESSION_NAME-$i" "$EVENT_NAME$i"
- start_lttng_tracing "$SESSION_NAME-$i"
- done
-
- echo -n "Starting application generating $NR_ITER events... "
- ./$CURDIR/gen-nevents $NR_ITER &
- print_ok
-
- # At least hit one event
- echo -n "Waiting for events to record "
- while [ -n "$(pidof gen-nevents)" ]; do
- echo -n "."
- sleep 0.1
- done
- print_ok
-
- for i in `seq 0 3`; do
- stop_lttng_tracing "$SESSION_NAME-$i"
- destroy_lttng_session "$SESSION_NAME-$i"
- out=$(babeltrace "$TRACE_PATH/$i" | grep "$EVENT_NAMEi$i" | wc -l)
- if [ $out -ne $NR_ITER ]; then
- echo -n "No event found. Suppose to have at least one... "
- print_fail
- out=1
- else
- echo -n "Found $out event(s) for $SESSION_NAME-$i. Coherent... "
- print_ok
- out=0
- fi
- done
-
- return $out
-}
-
-# MUST set TESTDIR before calling those functions
-
-start_lttng_sessiond
-
-TRACE_PATH=$(mktemp -d)
-
-test_multi_session
-out=$?
-if [ $out -ne 0 ]; then
- stop_lttng_sessiond
- exit $out
-fi
-
-stop_lttng_sessiond
-
-rm -rf "$TRACE_PATH"
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+TEST_DESC="UST tracer - Multi-session"
+
+CURDIR=$(dirname $0)/
+TESTDIR=$CURDIR/../../..
+NR_ITER=100
+SESSION_NAME="multi-session"
+EVENT_NAME="ust_gen_nevents:tptest"
+
+source $TESTDIR/utils/utils.sh
+
+print_test_banner "$TEST_DESC"
+
+if [ ! -x "$CURDIR/gen-nevents" ]; then
+ echo -e "No UST nevents binary detected. Passing."
+ exit 0
+fi
+
+# MUST set TESTDIR before calling those functions
+
+test_multi_session() {
+ local out
+
+ # BEFORE application is spawned
+ for i in `seq 0 3`; do
+ create_lttng_session "$SESSION_NAME-$i" "$TRACE_PATH/$i"
+ enable_ust_lttng_event "$SESSION_NAME-$i" "$EVENT_NAME$i"
+ start_lttng_tracing "$SESSION_NAME-$i"
+ done
+
+ echo -n "Starting application generating $NR_ITER events... "
+ ./$CURDIR/gen-nevents $NR_ITER &
+ print_ok
+
+ # At least hit one event
+ echo -n "Waiting for events to record "
+ while [ -n "$(pidof gen-nevents)" ]; do
+ echo -n "."
+ sleep 0.1
+ done
+ print_ok
+
+ for i in `seq 0 3`; do
+ stop_lttng_tracing "$SESSION_NAME-$i"
+ destroy_lttng_session "$SESSION_NAME-$i"
+ out=$(babeltrace "$TRACE_PATH/$i" | grep "$EVENT_NAMEi$i" | wc -l)
+ if [ $out -ne $NR_ITER ]; then
+ echo -n "No event found. Suppose to have at least one... "
+ print_fail
+ out=1
+ else
+ echo -n "Found $out event(s) for $SESSION_NAME-$i. Coherent... "
+ print_ok
+ out=0
+ fi
+ done
+
+ return $out
+}
+
+# MUST set TESTDIR before calling those functions
+
+start_lttng_sessiond
+
+TRACE_PATH=$(mktemp -d)
+
+test_multi_session
+out=$?
+if [ $out -ne 0 ]; then
+ stop_lttng_sessiond
+ exit $out
+fi
+
+stop_lttng_sessiond
+
+rm -rf "$TRACE_PATH"
gen_events_time_SOURCES = gen-events-time.c tp.c ust_gen_event.h
gen_events_time_LDADD = -llttng-ust
-noinst_SCRIPTS = run ust-nprocesses
-EXTRA_DIST = run ust-nprocesses
+noinst_SCRIPTS = test_nprocesses ust-nprocesses
+EXTRA_DIST = test_nprocesses ust-nprocesses
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-NR_ITER=100
-TEST_DESC="UST tracer - Generate $NR_ITER process"
-
-CURDIR=$(dirname $0)/
-TESTDIR=$CURDIR/../../..
-TEST_BIN_NAME="gen-events-time"
-
-source $TESTDIR/utils/utils.sh
-
-print_test_banner "$TEST_DESC"
-
-if [ ! -x "$CURDIR/$TEST_BIN_NAME" ]; then
- echo -e "No UST $TEST_BIN_NAME binary detected. Passing."
- exit 0
-fi
-
-# MUST set TESTDIR before calling those functions
-
-start_lttng_sessiond
-
-./$CURDIR/ust-nprocesses $NR_ITER
-
-stop_lttng_sessiond
-
-exit 0
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+NR_ITER=100
+TEST_DESC="UST tracer - Generate $NR_ITER process"
+
+CURDIR=$(dirname $0)/
+TESTDIR=$CURDIR/../../..
+TEST_BIN_NAME="gen-events-time"
+
+source $TESTDIR/utils/utils.sh
+
+print_test_banner "$TEST_DESC"
+
+if [ ! -x "$CURDIR/$TEST_BIN_NAME" ]; then
+ echo -e "No UST $TEST_BIN_NAME binary detected. Passing."
+ exit 0
+fi
+
+# MUST set TESTDIR before calling those functions
+
+start_lttng_sessiond
+
+./$CURDIR/ust-nprocesses $NR_ITER
+
+stop_lttng_sessiond
+
+exit 0
SUBDIRS = demo
-noinst_SCRIPTS = run
-EXTRA_DIST = run overlap.sh
+noinst_SCRIPTS = test_overlap
+EXTRA_DIST = test_overlap overlap.sh
+++ /dev/null
-#!/bin/bash
-
-DIR=$(dirname $0)
-
-tests=( $DIR/overlap.sh)
-
-exit_code=0
-
-function start_tests ()
-{
- for bin in ${tests[@]};
- do
- ./$bin
- # Test must return 0 to pass.
- if [ $? -ne 0 ]; then
- exit_code=1
- break
- fi
- done
-}
-
-start_tests
-
-exit $exit_code
--- /dev/null
+#!/bin/bash
+
+DIR=$(dirname $0)
+
+tests=( $DIR/overlap.sh)
+
+exit_code=0
+
+function start_tests ()
+{
+ for bin in ${tests[@]};
+ do
+ ./$bin
+ # Test must return 0 to pass.
+ if [ $? -ne 0 ]; then
+ exit_code=1
+ break
+ fi
+ done
+}
+
+start_tests
+
+exit $exit_code
DIR=$(dirname $0)
-tests=( $DIR/run-ust-global-tests.sh $DIR/nprocesses/run \
- $DIR/high-throughput/run $DIR/before-after/run \
- $DIR/multi-session/run $DIR/overlap/run )
+tests=( $DIR/run-ust-global-tests.sh $DIR/nprocesses/test_nprocesses \
+ $DIR/high-throughput/test_high_throughput $DIR/before-after/test_before_after \
+ $DIR/multi-session/test_multi_session $DIR/overlap/test_overlap )
# $DIR/low-throughput/run --> DEACTIVATED.
# Use only for release. This test last 20 minutes