Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jul 2017 12:07:46 +0000 (UTC)
From:      Li-Wen Hsu <lwhsu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321518 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil
Message-ID:  <201707261207.v6QC7kgO057833@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lwhsu (ports committer)
Date: Wed Jul 26 12:07:46 2017
New Revision: 321518
URL: https://svnweb.freebsd.org/changeset/base/321518

Log:
  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

Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh	Wed Jul 26 11:04:30 2017	(r321517)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh	Wed Jul 26 12:07:46 2017	(r321518)
@@ -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);}'
 
@@ -54,5 +66,7 @@ status=$?
 if [ "$status" -ne 0 ]; then
 	echo $tst: dtrace failed
 fi
+
+kill $child
 
 exit $status



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707261207.v6QC7kgO057833>