summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
94dab75)
Move all wait ${!} that target a single process to "wait", to minimize
the chances to forget some background process in the future.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
kill ${p}
wait ${p} 2>&1
done
kill ${p}
wait ${p} 2>&1
done
}
# Test a snapshot using a default name for the output destination.
}
# Test a snapshot using a default name for the output destination.
kill ${p}
wait ${p} 2>&1
done
kill ${p}
wait ${p} 2>&1
done
}
function snapshot_add_output ()
}
function snapshot_add_output ()
# Run 5 times with a 1 second delay
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
# 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
start_lttng_tracing $SESSION_NAME
# Wait for the applications started in background
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
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
# 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
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+
+ # Wait for the applications started in background
+ wait
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
start_lttng_tracing $SESSION_NAME
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
ok $? "Traced application stopped."
stop_lttng_tracing $SESSION_NAME
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Application started in background."
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Application started in background."
+ #FIXME: racy missing synchronization
+
start_lttng_tracing $SESSION_NAME
start_lttng_tracing $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
start_lttng_tracing $SESSION_NAME
for i in `seq 1 5`; do
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
ok $? "Start application $i for tracing"
done
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
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
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
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"
# 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
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"
ok $? "Start application to trace"
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
+ #FIXME: racy missing synchronization
+
start_lttng_tracing $SESSION_NAME
start_lttng_tracing $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
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
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"
ok $? "Start application to trace"
stop_lttng_tracing $SESSION_NAME
trace_match_only $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
stop_lttng_tracing $SESSION_NAME
trace_match_only $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
start_lttng_tracing $SESSION_NAME
for i in `seq 1 $NR_APP`; do
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"
done
diag "Waiting for applications to end"
# Run 5 times with a 1 second delay
run_app_background
# Run 5 times with a 1 second delay
run_app_background
+ #FIXME: racy missing synchronization
+
start_lttng_tracing $SESSION_NAME
# Wait for the applications started in background
start_lttng_tracing $SESSION_NAME
# Wait for the applications started in background
# Run 5 times with a 1 second delay
run_app_background
# Run 5 times with a 1 second delay
run_app_background
+ #FIXME: racy missing synchronization
+
start_lttng_tracing $SESSION_NAME
# Wait for the applications started in background
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"
./$CURDIR/gen-nevents $NR_ITER &
ok $? "Start application to generate $NR_ITER events"
pass "Wait for events to record"
for i in `seq 0 3`; do
pass "Wait for events to record"
for i in `seq 0 3`; do
APPS_PID="${APPS_PID} ${!}"
done
APPS_PID="${APPS_PID} ${!}"
done
+#FIXME: racy missing synchronization
+
diag "Waiting for applications to be registered to sessiond"
reg_app_count=0
diag "Waiting for applications to be registered to sessiond"
reg_app_count=0
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
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"
rm -rf $TRACE_PATH
diag "Stopping all spawned applications"
kill ${p}
wait ${p} 2>/dev/null
done
kill ${p}
wait ${p} 2>/dev/null
done
pass "Stopped all spawned applications"
stop_lttng_sessiond
pass "Stopped all spawned applications"
stop_lttng_sessiond
BIN_NAME="gen-nevents"
NUM_TESTS=38
APP_TMP_FILE="/tmp/lttng_test_ust.42.file"
BIN_NAME="gen-nevents"
NUM_TESTS=38
APP_TMP_FILE="/tmp/lttng_test_ust.42.file"
source $TESTDIR/utils/utils.sh
source $TESTDIR/utils/utils.sh
{
# Start application with a temporary file.
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT $APP_TMP_FILE &
{
# 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()
}
function start_check_trace_app()
+
+function wait_trace_apps()
+{
+ for p in ${APPS_PID}; do
+ wait ${p} 2>/dev/null
+ done
+ APPS_PID=
+}
+
test_after_app_pid() {
local out
test_after_app_pid() {
local out
diag "Start application AFTER tracing is started"
create_lttng_session $SESSION_NAME $TRACE_PATH
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.
# 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
# Give time to the consumer to write inflight data.
sleep 2
- 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
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
local out
local tmp_file="/tmp/lttng_test_ust.42.file"
local out
local tmp_file="/tmp/lttng_test_ust.42.file"
diag "Start application BEFORE tracing is started"
start_trace_app
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.
# 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
# Give time to the consumer to write inflight data.
sleep 2
- 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
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
test_after_app_uid() {
local out
test_after_app_uid() {
local out
diag "Start application AFTER tracing is started"
create_lttng_session $SESSION_NAME $TRACE_PATH
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.
# 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
# Give time to the consumer to write inflight data.
sleep 2
- 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
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
test_before_app_uid() {
local out
test_before_app_uid() {
local out
diag "Start application BEFORE tracing is started"
# Start application before tracing
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.
# 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
# Give time to the consumer to write inflight data.
sleep 2
- 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
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME