setup_live_tracing
# Run app in background
-$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
-# Wait for app to complete
-while [ -n "$(pidof $TESTAPP_NAME)" ]; do
- sleep 0.5
-done
+$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1
clean_live_tracing
setup_live_tracing
# Run app in background
-$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
-# Wait for app to complete
-while [ -n "$(pidof $TESTAPP_NAME)" ]; do
- sleep 0.5
-done
+$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1
# Start the live test
$TESTDIR/regression/tools/live/live_test
setup_live_tracing
# Run app in background
-$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
-# Wait for app to complete
-while [ -n "$(pidof $TESTAPP_NAME)" ]; do
- sleep 0.5
-done
+$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1
# Start the live test
$TESTDIR/regression/tools/live/live_test
TRACE_PATH=$(mktemp -d)
-NUM_TESTS=18
+NUM_TESTS=16
source $TESTDIR/utils/utils.sh
ok $? "Create session with default path"
}
-function wait_apps
-{
- while [ -n "$(pidof $TESTAPP_NAME)" ]; do
- sleep 0.5
- done
- pass "Wait for applications to end"
-}
# MUST set TESTDIR before calling those functions
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
start_lttng_tracing $SESSION_NAME
-
- wait_apps
+ # Wait for the applications started in background
+ wait ${!}
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
start_lttng_tracing $SESSION_NAME
# Run 5 times with a 1 second delay
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
-
- wait_apps
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
SESSION_NAME="per-session"
EVENT_NAME="tp:tptest"
-NUM_TESTS=17
+NUM_TESTS=16
source $TESTDIR/utils/utils.sh
# MUST set TESTDIR before calling those functions
-function wait_app()
-{
- while [ -n "$(pidof $TESTAPP_NAME)" ]; do
- sleep 0.5
- done
- pass "Application $TESTAPP_NAME ended."
-}
-
function test_before_apps()
{
# BEFORE application is spawned
{
local out
+ create_lttng_session $SESSION_NAME $TRACE_PATH
+ enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
+
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Application started in background."
- # BEFORE application is spawned
- create_lttng_session $SESSION_NAME $TRACE_PATH
- enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
start_lttng_tracing $SESSION_NAME
- # Since the start is done after the application is started, there is a
- # bootstrap time needed between the session daemon and the UST tracer.
- # Waiting for the application to end tells us when to stop everything and
- # validate that at least one event is seen.
- wait_app
+ wait ${!}
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
diag "Start application BEFORE tracing is started"
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
- ok $? "Start application to trace"
# BEFORE application is spawned
create_lttng_session $SESSION_NAME $TRACE_PATH
enable_channel_per_pid $SESSION_NAME "channel0"
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
+
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
+ ok $? "Start application to trace"
+
start_lttng_tracing $SESSION_NAME
- # At least hit one event
- sleep 2
+ wait ${!}
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
out=0
fi
- wait_apps
-
return $out
}
./$CURDIR/gen-nevents $NR_ITER &
ok $? "Start application to generate $NR_ITER events"
- # At least hit one event
- while [ -n "$(pidof gen-nevents)" ]; do
- sleep 0.1
- done
-
+ wait ${!}
pass "Wait for events to record"
for i in `seq 0 3`; do