3 # Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
5 # SPDX-License-Identifier: LGPL-2.1-only
8 TESTDIR
=$CURDIR/..
/..
/..
/
10 TESTAPP_PATH
="$TESTDIR/utils/testapp"
11 TESTAPP_NAME
="gen-ust-events"
12 TESTAPP_BIN
="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
14 SESSION_NAME
="my_session"
15 SESSION_OUTPUT_PATH
=$
(mktemp
--tmpdir -d tmp.test_notif_rotation_trace_path.XXXXXX
)
16 EVENT_NAME
="tp:tptest"
18 PAGE_SIZE
=$
(getconf PAGE_SIZE
)
19 SUBBUF_SIZE
=$
(expr $PAGE_SIZE \
* 8)
21 FILE_SYNC_AFTER_FIRST_EVENT
=$
(mktemp
--tmpdir -u tmp.test_rotation_sync_after_first.XXXXXX
)
26 DIR
=$
(readlink
-f $TESTDIR)
28 source $TESTDIR/utils
/utils.sh
29 start_lttng_sessiond_notap
31 create_lttng_session_notap
$SESSION_NAME $SESSION_OUTPUT_PATH
33 enable_ust_lttng_channel_notap
$SESSION_NAME $CHANNEL_NAME --subbuf-size=$SUBBUF_SIZE
34 enable_ust_lttng_event_notap
$SESSION_NAME $EVENT_NAME $CHANNEL_NAME
36 start_lttng_tracing_notap
$SESSION_NAME
38 $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $FILE_SYNC_AFTER_FIRST_EVENT &
40 while [ ! -f "${FILE_SYNC_AFTER_FIRST_EVENT}" ]; do
44 # The rotation application handles the actual testing once the tracing session
46 $CURDIR/rotation
$SESSION_NAME $SESSION_OUTPUT_PATH
48 diag
"Failed to run rotation notification client"
51 stop_lttng_tracing_notap
$SESSION_NAME
53 stop_lttng_sessiond_notap
55 # On ungraceful kill the app is cleaned up via the full_cleanup call
56 # Suppress kill message
58 wait $APP_PID 2> /dev
/null
60 rm -rf $SESSION_OUTPUT_PATH
61 rm -f $FILE_SYNC_AFTER_FIRST_EVENT