3 # Copyright (C) - 2017 Jérémie Galarneau <jeremie.galarneau@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
19 TESTDIR
=$CURDIR/..
/..
/..
/
21 TESTAPP_PATH
="$TESTDIR/utils/testapp"
22 TESTAPP_NAME
="gen-ust-events"
23 TESTAPP_BIN
="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
25 SESSION_NAME
="my_session"
27 SESSION_OUTPUT_PATH
=$TMP_DIR/output
28 EVENT_NAME
="tp:tptest"
30 PAGE_SIZE
=$
(getconf PAGE_SIZE
)
31 SUBBUF_SIZE
=$
(expr $PAGE_SIZE \
* 8)
33 FILE_SYNC_AFTER_FIRST_EVENT
=$
(mktemp
-u)
38 DIR
=$
(readlink
-f $TESTDIR)
40 source $TESTDIR/utils
/utils.sh
41 start_lttng_sessiond_notap
43 create_lttng_session_notap
$SESSION_NAME $SESSION_OUTPUT_PATH
45 enable_ust_lttng_channel_notap
$SESSION_NAME $CHANNEL_NAME --subbuf-size=$SUBBUF_SIZE
46 enable_ust_lttng_event_notap
$SESSION_NAME $EVENT_NAME $CHANNEL_NAME
48 start_lttng_tracing_notap
$SESSION_NAME
50 $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $FILE_SYNC_AFTER_FIRST_EVENT &
52 while [ ! -f "${FILE_SYNC_AFTER_FIRST_EVENT}" ]; do
56 # The rotation application handles the actual testing once the tracing session
58 $CURDIR/rotation
$SESSION_NAME $SESSION_OUTPUT_PATH
60 diag
"Failed to run rotation notification client"
63 stop_lttng_tracing_notap
$SESSION_NAME
65 stop_lttng_sessiond_notap
67 # On ungraceful kill the app is cleaned up via the full_cleanup call
68 # Suppress kill message
70 wait $APP_PID 2> /dev
/null
73 rm $FILE_SYNC_AFTER_FIRST_EVENT 2> /dev
/null