test_before_multiple_apps() {
local out
local i
+ local file_sync_after_first=$(mktemp -u)
+ local file_sync_before_last=$(mktemp -u)
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 ${file_sync_after_first}_${i} ${file_sync_before_last}_${i} >/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
+ for i in `seq 1 5`; do
+ touch ${file_sync_before_last}_${i}
+ done
+
diag "Waiting for applications to end"
wait
pass "Waiting done"
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ for i in `seq 1 5`; do
+ rm -f ${file_sync_after_first}_${i}
+ rm -f ${file_sync_before_last}_${i}
+ done
+
out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
if [ $out -eq 0 ]; then
fail "Trace validation"
test_before_app() {
local out
+ local file_sync_after_first=$(mktemp -u)
+ local file_sync_before_last=$(mktemp -u)
diag "Start application BEFORE tracing is started"
enable_channel_per_pid $SESSION_NAME "channel0"
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ${file_sync_after_first} ${file_sync_before_last} &
ok $? "Start application to trace"
- #FIXME: racy missing synchronization
-
start_lttng_tracing $SESSION_NAME
+ touch ${file_sync_before_last}
+
wait
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ rm -f ${file_sync_after_first}
+ rm -f ${file_sync_before_last}
+
out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
if [ $out -eq 0 ]; then
fail "Trace validation"