Add an auxiliary subroutine to generate some events for testing

This test is also timeout on a quiet system because there is nobody triggering
read probefunc while test execution.

Reviewed by:	gnn, markj, ngie
Differential Revision:	https://reviews.freebsd.org/D11731
This commit is contained in:
Li-Wen Hsu 2017-07-26 12:07:46 +00:00
parent cea9310d4e
commit ad89d783a6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=321518

View File

@ -39,6 +39,15 @@
##
reader()
{
while true
do
sleep 0.1
cat /etc/motd > /dev/null
done
}
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
exit 2
@ -46,6 +55,9 @@ fi
dtrace=$1
reader &
child=$!
$dtrace -qZf wassup'{printf("Iamkool");}' \
-qf read'{printf("I am done"); exit(0);}'
@ -55,4 +67,6 @@ if [ "$status" -ne 0 ]; then
echo $tst: dtrace failed
fi
kill $child
exit $status