Add an auxiliary subroutine to generate read(2) event while testing.

Reviewed by:	gnn, ngie
Differential Revision:	https://reviews.freebsd.org/D11673
This commit is contained in:
Li-Wen Hsu 2017-07-25 13:01:10 +00:00
parent d83c70758a
commit 070a148127
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=321466

View File

@ -38,6 +38,14 @@
##
reader()
{
while true
do
sleep 0.1
cat /etc/motd > /dev/null
done
}
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@ -46,6 +54,9 @@ fi
dtrace=$1
reader &
child=$!
$dtrace -qwf read'{chill(15); printf("Done chilling"); exit(0);}'
status=$?
@ -53,4 +64,6 @@ if [ "$status" -ne 0 ]; then
echo $tst: dtrace failed
fi
kill $child
exit $status