start_lttng_tracing $SESSION_NAME
# Start application after tracing
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
# At least hit one event
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -q $TESTAPP_NAME
+ killall -SIGSTOP -q $TESTAPP_NAME
+
+ # Give time to the consumer to write inflight data.
sleep 2
validate_trace
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ killall -SIGKILL -q $TESTAPP_NAME
+ wait_apps
+
return $out
}
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -q $TESTAPP_NAME
+ killall -SIGSTOP -q $TESTAPP_NAME
+
+ # Give time to the consumer to write inflight data.
sleep 2
validate_trace
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ killall -SIGKILL -q $TESTAPP_NAME
wait_apps
return $out
start_lttng_tracing $SESSION_NAME
# Start application after tracing
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
# At least hit one event
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -q $TESTAPP_NAME
+ killall -SIGSTOP -q $TESTAPP_NAME
+
+ # Give time to the consumer to write inflight data.
sleep 2
validate_trace
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ killall -SIGKILL -q $TESTAPP_NAME
+ wait_apps
+
return $out
}
diag "Start application BEFORE tracing is started"
- # Start application after tracing
+ # Start application before tracing
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to 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 -q $TESTAPP_NAME
+ killall -SIGSTOP -q $TESTAPP_NAME
+
+ # Give time to the consumer to write inflight data.
sleep 2
validate_trace
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ killall -SIGKILL -q $TESTAPP_NAME
wait_apps
return $out