kill ${p}
wait ${p} 2>&1
done
+ APPS_PID=
}
# Test a snapshot using a default name for the output destination.
kill ${p}
wait ${p} 2>&1
done
+ APPS_PID=
}
function snapshot_add_output ()
# Run 5 times with a 1 second delay
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
+ #FIXME: racy missing synchro
+
start_lttng_tracing $SESSION_NAME
# Wait for the applications started in background
- wait ${!}
+ wait
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
# Run 5 times with a 1 second delay
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1
+ #FIXME: racy missing synchro
+
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+
+ # Wait for the applications started in background
+ wait
}
plan_tests $NUM_TESTS
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
start_lttng_tracing $SESSION_NAME
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
+ wait
ok $? "Traced application stopped."
stop_lttng_tracing $SESSION_NAME
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Application started in background."
+ #FIXME: racy missing synchronization
+
start_lttng_tracing $SESSION_NAME
- wait ${!}
+ wait
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
start_lttng_tracing $SESSION_NAME
for i in `seq 1 5`; do
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
ok $? "Start application $i for tracing"
done
+ wait
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
diag "Start multiple applications BEFORE tracing is started"
for i in `seq 1 5`; do
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & >/dev/null 2>&1
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
ok $? "Start application $i for tracing"
done
+ #FIXME: racy missing synchronization
+
# 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"
start_lttng_tracing $SESSION_NAME
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
+ wait
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
+ #FIXME: racy missing synchronization
+
start_lttng_tracing $SESSION_NAME
- wait ${!}
+ wait
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel4"
start_lttng_tracing $SESSION_NAME
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
+ wait
stop_lttng_tracing $SESSION_NAME
trace_matches $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
start_lttng_tracing $SESSION_NAME
for i in `seq 1 $NR_APP`; do
- ./$CURDIR/$BIN_NAME & >/dev/null 2>&1
+ ./$CURDIR/$BIN_NAME >/dev/null 2>&1 &
done
diag "Waiting for applications to end"
# Run 5 times with a 1 second delay
run_app
+ #FIXME: racy missing synchronization
+
start_lttng_tracing $SESSION_NAME
# Wait for the applications started in background
./$CURDIR/gen-nevents $NR_ITER &
ok $? "Start application to generate $NR_ITER events"
- wait ${!}
+ wait
pass "Wait for events to record"
for i in `seq 0 3`; do
APPS_PID="${APPS_PID} ${!}"
done
+#FIXME: racy missing synchronization
+
diag "Waiting for applications to be registered to sessiond"
reg_app_count=0
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+#FIXME/TODO: add validation after fixing racy synchroniaation
+
rm -rf $TRACE_PATH
diag "Stopping all spawned applications"
kill ${p}
wait ${p} 2>/dev/null
done
+APPS_PID=
pass "Stopped all spawned applications"
stop_lttng_sessiond
BIN_NAME="gen-nevents"
NUM_TESTS=38
APP_TMP_FILE="/tmp/lttng_test_ust.42.file"
+APPS_PID=
source $TESTDIR/utils/utils.sh
{
# Start application with a temporary file.
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT $APP_TMP_FILE &
- ok $? "Start application to trace"
+ ret=$?
+ APPS_PID="${APPS_PID} ${!}"
+ ok $ret "Start application to trace"
}
function start_check_trace_app()
check_app_tmp_file
}
+
+function wait_trace_apps()
+{
+ for p in ${APPS_PID}; do
+ wait ${p} 2>/dev/null
+ done
+ APPS_PID=
+}
+
test_after_app_pid() {
local out
+ APPS_PID=
+
diag "Start application AFTER tracing is started"
create_lttng_session $SESSION_NAME $TRACE_PATH
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -SIGSTOP -q $TESTAPP_NAME
+ for p in ${APPS_PID}; do
+ kill -s SIGSTOP ${p}
+ done
# Give time to the consumer to write inflight data.
sleep 2
validate_trace
out=$?
- killall -SIGKILL -q $TESTAPP_NAME
+ for p in ${APPS_PID}; do
+ kill -s SIGKILL ${p}
+ wait ${p} 2>/dev/null
+ done
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- wait
+ wait_trace_apps
return $out
}
local out
local tmp_file="/tmp/lttng_test_ust.42.file"
+ APPS_PID=
+
diag "Start application BEFORE tracing is started"
start_trace_app
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -SIGSTOP -q $TESTAPP_NAME
+ for p in ${APPS_PID}; do
+ kill -s SIGSTOP ${p}
+ done
# Give time to the consumer to write inflight data.
sleep 2
validate_trace
out=$?
- killall -SIGKILL -q $TESTAPP_NAME
+ for p in ${APPS_PID}; do
+ kill -s SIGKILL ${p}
+ wait ${p} 2>/dev/null
+ done
+
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- wait
+ wait_trace_apps
return $out
}
test_after_app_uid() {
local out
+ APPS_PID=
+
diag "Start application AFTER tracing is started"
create_lttng_session $SESSION_NAME $TRACE_PATH
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -SIGSTOP -q $TESTAPP_NAME
+ for p in ${APPS_PID}; do
+ kill -s SIGSTOP ${p}
+ done
+
# Give time to the consumer to write inflight data.
sleep 2
validate_trace
out=$?
- killall -SIGKILL -q $TESTAPP_NAME
+ for p in ${APPS_PID}; do
+ kill -s SIGKILL ${p}
+ wait ${p} 2>/dev/null
+ done
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- wait
+ wait_trace_apps
return $out
}
test_before_app_uid() {
local out
+ APPS_PID=
+
diag "Start application BEFORE tracing is started"
# Start application before tracing
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -SIGSTOP -q $TESTAPP_NAME
+ for p in ${APPS_PID}; do
+ kill -s SIGSTOP ${p}
+ done
# Give time to the consumer to write inflight data.
sleep 2
validate_trace
out=$?
- killall -SIGKILL -q $TESTAPP_NAME
+ for p in ${APPS_PID}; do
+ kill -s SIGKILL ${p}
+ wait ${p} 2>/dev/null
+ done
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- wait
+ wait_trace_apps
return $out
}