rm -f $tmp_file
}
+function stop_trace_app()
+{
+ diag "Killing $TESTAPP_NAME"
+ PID_APP=`pidof $TESTAPP_NAME`
+ kill $PID_APP >/dev/null 2>&1
+ diag "Waiting on $TESTAPP_NAME"
+ wait
+}
+
# Test a snapshot using a default name for the output destination.
function test_ust_default_name_with_del()
{
echo $TRACE_PATH/$HOSTNAME/snapshot-1
validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/snapshot-1*
if [ $? -ne 0 ]; then
+ stop_trace_app
return $?
fi
# Validate test with the next ID since a del output was done prior.
validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/snapshot-2*
if [ $? -ne 0 ]; then
+ stop_trace_app
return $?
fi
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- diag "Killing $TESTAPP_NAME"
- PID_APP=`pidof $TESTAPP_NAME`
- kill $PID_APP >/dev/null 2>&1
+ stop_trace_app
return 0
}
validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/snapshot-1*
out=$?
- diag "Killing $TESTAPP_NAME"
- PID_APP=`pidof $TESTAPP_NAME`
- kill $PID_APP >/dev/null 2>&1
+ stop_trace_app
return $out
}
validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/snapshot-1*
out=$?
- diag "Killing $TESTAPP_NAME"
- PID_APP=`pidof $TESTAPP_NAME`
- kill $PID_APP >/dev/null 2>&1
+ stop_trace_app
return $out
}
out=1
fi
- diag "Killing $TESTAPP_NAME"
- PID_APP=`pidof $TESTAPP_NAME`
- kill $PID_APP >/dev/null 2>&1
+ stop_trace_app
return $out
}
rm -f $tmp_file
}
-function kill_test_app()
+function stop_test_app()
{
diag "Killing $TESTAPP_NAME"
PID_APP=`pidof $TESTAPP_NAME`
kill $PID_APP >/dev/null 2>&1
+ diag "Waiting on $TESTAPP_NAME"
+ wait
}
function snapshot_add_output ()
break
fi
- kill_test_app
+ stop_test_app
}
function test_ust_local_snapshot_max_size ()
rm -rf $TRACE_PATH
fi
- kill_test_app
+ stop_test_app
}
function test_ust_local_snapshot_large_metadata ()
break
fi
- kill_test_app
+ stop_test_app
}
function test_ust_per_uid_local_snapshot_post_mortem ()
# Returns once the application has at least fired ONE tracepoint.
start_test_app
- kill_test_app
+ stop_test_app
lttng_snapshot_record $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- kill_test_app
+ stop_test_app
}
plan_tests $NUM_TESTS
TRACE_PATH=$(mktemp -d)
-NUM_TESTS=112
+NUM_TESTS=104
source $TESTDIR/utils/utils.sh
done
}
-function wait_apps
-{
- while [ -n "$(pidof $TESTAPP_NAME)" ]; do
- sleep 1
- done
- pass "Wait for applications to end"
-}
-
function test_high_throughput
{
NETWORK_URI="net://localhost"
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
start_lttng_tracing $SESSION_NAME
run_apps
- wait_apps
+ diag "Waiting for applications to end"
+ wait
+ pass "waiting done"
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
validate_event_count
TESTAPP_NAME="gen-ust-events"
TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
EVENT_NAME="tp:tptest"
-NUM_TESTS=58
+NUM_TESTS=59
source $TESTDIR/utils/utils.sh
ok $? "Enable channel $channel_name per PID for session $sess_name"
}
-function wait_apps
-{
- diag "Waiting for applications to end..."
- while [ -n "$(pidof $TESTAPP_NAME)" ]; do
- sleep 1
- done
-}
-
test_after_multiple_apps() {
local out
local i
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME "channel0"
start_lttng_tracing $SESSION_NAME
- # At least hit one event
- sleep 2
+ diag "Waiting for applications to end"
+ wait
+ pass "Waiting done"
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
out=0
fi
- wait_apps
-
return $out
}
./$CURDIR/$BIN_NAME & >/dev/null 2>&1
done
-while [ -n "$(pidof $BIN_NAME)" ]; do
- sleep 0.5
-done
-pass "Wait for application end"
+diag "Waiting for applications to end"
+wait
+pass "Wait for applications to end"
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
rm -rf $TRACE_PATH
-while [ -n "$(pidof $TESTAPP_NAME)" ]; do
- killall -q $TESTAPP_NAME >/dev/null 2>&1
- sleep 0.5
-done
-
-
-pass "Kill all spawned applications"
+diag "Stopping all spawned applications"
+killall -q $TESTAPP_NAME >/dev/null 2>&1
+wait
+pass "Stopped all spawned applications"
stop_lttng_sessiond
ok $? "Enable channel $channel_name per PID for session $sess_name"
}
-function wait_apps
-{
- diag "Waiting for applications to end..."
- while [ -n "$(pidof $TESTAPP_NAME)" ]; do
- sleep 1
- done
-}
-
function validate_trace()
{
local out
validate_trace
out=$?
+ killall -SIGKILL -q $TESTAPP_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- killall -SIGKILL -q $TESTAPP_NAME
- wait_apps
+ wait
return $out
}
validate_trace
out=$?
+ killall -SIGKILL -q $TESTAPP_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- killall -SIGKILL -q $TESTAPP_NAME
- wait_apps
+ wait
return $out
}
validate_trace
out=$?
+ killall -SIGKILL -q $TESTAPP_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- killall -SIGKILL -q $TESTAPP_NAME
- wait_apps
+ wait
return $out
}
validate_trace
out=$?
+ killall -SIGKILL -q $TESTAPP_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- killall -SIGKILL -q $TESTAPP_NAME
- wait_apps
+ wait
return $out
}