Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jun 2013 11:47:43 -0700
From:      Jeff Ford <jeff.ford@gmail.com>
To:        freebsd-dtrace@freebsd.org
Subject:   Patch for the trap handler and some test list sanity
Message-ID:  <CAJ0x7rOiY_6z_1obs4N78EPh%2B_prWAVSgCSvywBZb%2BZBZ0342g@mail.gmail.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Anton Rang and I did some DTrace work for Isilon that we're trying to get
back into FreeBSD, but neither of us is a committer - here's the first one.

This moves the check for dtrace trap handlers into the low-level exception
handler to prevent recursive entry when the trap routine is instrumented.
This fixes several tests which previously panicked including
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.basename.d.
The fix is AMD64 only – neither of us has had time to make changes to i386
code as we don’t use it here.

Also this includes updates to the Makefile for the DTrace tests to
categorize which ones pass, which ones fail, which ones aren’t safe to run
at all, and which ones sometimes pass and sometimes fail. The list should
be correct for both AMD64 and i386. This makes “make”, “make ignore”, and
“make flaky” safe to run in /tools/test/dtrace.

Jeff

-- 
Jeff Ford
Redmond, WA

[-- Attachment #2 --]
Index: tools/test/dtrace/Makefile
===================================================================
--- tools/test/dtrace/Makefile	(revision 247284)
+++ tools/test/dtrace/Makefile	(working copy)
@@ -4,94 +4,36 @@
 CFLAGS+=	-w
 DTEST=		${TESTSRCDIR}/cmd/scripts/dtest.pl -n
 
-IGNORE=		\
+# Everything in the IGNORE list is safe to run but doesn't pass.
+
+IGNORE= \
+        ${TESTSRCDIR}/tst/common/aggs/tst.signature.d			\
 	${TESTSRCDIR}/tst/common/aggs/tst.subr.d			\
-	${TESTSRCDIR}/tst/common/buffering/tst.cputime.ksh		\
 	${TESTSRCDIR}/tst/common/buffering/tst.ring3.d			\
-	${TESTSRCDIR}/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d	\
-	${TESTSRCDIR}/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d\
-	${TESTSRCDIR}/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d\
-	${TESTSRCDIR}/tst/common/cpc/err.cpcvscpustatpart1.ksh		\
-	${TESTSRCDIR}/tst/common/cpc/err.cpcvscpustatpart2.ksh		\
-	${TESTSRCDIR}/tst/common/cpc/err.cputrackfailtostart.ksh	\
-	${TESTSRCDIR}/tst/common/cpc/err.cputrackterminates.ksh		\
-	${TESTSRCDIR}/tst/common/cpc/err.toomanyenablings.d		\
 	${TESTSRCDIR}/tst/common/cpc/tst.allcpus.ksh			\
 	${TESTSRCDIR}/tst/common/cpc/tst.genericevent.d			\
 	${TESTSRCDIR}/tst/common/cpc/tst.platformevent.ksh		\
-	${TESTSRCDIR}/tst/common/dtraceUtil/man.ListProbesWithFunctions	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/man.ListProbesWithModules	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/man.ListProbesWithNames	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/man.ListProbesWithProviders	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/man.TraceFunctions		\
-	${TESTSRCDIR}/tst/common/dtraceUtil/man.TraceModule		\
-	${TESTSRCDIR}/tst/common/dtraceUtil/man.TraceNames		\
-	${TESTSRCDIR}/tst/common/dtraceUtil/man.TraceProvider		\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh\
-	${TESTSRCDIR}/tst/common/funcs/tst.bcopy.d			\
+	${TESTSRCDIR}/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh	\
+	${TESTSRCDIR}/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh \
+	${TESTSRCDIR}/tst/common/fbtprovider/tst.functionentry.d	\
+	${TESTSRCDIR}/tst/common/fbtprovider/tst.functionreturnvalue.d	\
+	${TESTSRCDIR}/tst/common/fbtprovider/tst.ioctlargs.d		\
+	${TESTSRCDIR}/tst/common/fbtprovider/tst.offset.d		\
+	${TESTSRCDIR}/tst/common/fbtprovider/tst.offsetzero.d		\
+	${TESTSRCDIR}/tst/common/fbtprovider/tst.return0.d		\
+	${TESTSRCDIR}/tst/common/fbtprovider/tst.tailcall.d		\
 	${TESTSRCDIR}/tst/common/funcs/tst.copyin.d			\
 	${TESTSRCDIR}/tst/common/funcs/tst.copyinto.d			\
 	${TESTSRCDIR}/tst/common/funcs/tst.ddi_pathname.d		\
 	${TESTSRCDIR}/tst/common/funcs/tst.index.d			\
 	${TESTSRCDIR}/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d	\
-	${TESTSRCDIR}/tst/common/inline/tst.InlineTypedef.d		\
-	${TESTSRCDIR}/tst/common/io/tst.fds.c				\
-	${TESTSRCDIR}/tst/common/java_api/tst.FunctionLookup.c		\
-	${TESTSRCDIR}/tst/common/java_api/tst.ProbeData.c		\
-	${TESTSRCDIR}/common/misc/tst.include.ksh			\
-	${TESTSRCDIR}/tst/common/misc/tst.roch.d			\
-	${TESTSRCDIR}/tst/common/nfs/tst.call.c				\
-	${TESTSRCDIR}/tst/common/nfs/tst.call.d				\
-	${TESTSRCDIR}/tst/common/nfs/tst.call3.c			\
-	${TESTSRCDIR}/tst/common/nfs/tst.call3.d			\
-	${TESTSRCDIR}/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d\
-	${TESTSRCDIR}/tst/common/pointers/err.D_OP_LVAL.AddressChange.d	\
-	${TESTSRCDIR}/tst/common/pointers/tst.GlobalVar.d		\
-	${TESTSRCDIR}/tst/common/pointers/tst.basic1.d			\
-	${TESTSRCDIR}/tst/common/pointers/tst.basic2.d			\
-	${TESTSRCDIR}/tst/common/predicates/tst.argsnotcached.d		\
-	${TESTSRCDIR}/tst/common/privs/tst.func_access.ksh		\
-	${TESTSRCDIR}/tst/common/privs/tst.op_access.ksh		\
-	${TESTSRCDIR}/tst/common/proc/tst.discard.ksh			\
-	${TESTSRCDIR}/tst/common/proc/tst.signal.ksh			\
-	${TESTSRCDIR}/tst/common/proc/tst.startexit.ksh			\
-	${TESTSRCDIR}/tst/common/profile-n/tst.ufuncsort.c		\
-	${TESTSRCDIR}/tst/common/scalars/tst.misc.d			\
-	${TESTSRCDIR}/tst/common/scalars/tst.selfarray2.d		\
-	${TESTSRCDIR}/tst/common/sysevent/tst.post.c			\
-	${TESTSRCDIR}/tst/common/sysevent/tst.post.d			\
-	${TESTSRCDIR}/tst/common/sysevent/tst.post_chan.c		\
-	${TESTSRCDIR}/tst/common/sysevent/tst.post_chan.d		\
-	${TESTSRCDIR}/tst/common/trace/tst.misc.d			\
-	${TESTSRCDIR}/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d	\
-	${TESTSRCDIR}/tst/common/tracemem/tst.rootvp.d			\
-	${TESTSRCDIR}/tst/common/translators/tst.ProcModelTrans.d	\
-	${TESTSRCDIR}/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d\
-	${TESTSRCDIR}/tst/common/types/tst.ptrops.d			\
-	${TESTSRCDIR}/tst/common/types/tst.struct.d			\
-	${TESTSRCDIR}/tst/common/types/tst.typedef.d			\
-	${TESTSRCDIR}/tst/common/vars/tst.ucaller.ksh			\
-	${TESTSRCDIR}/tst/common/vars/tst.walltimestamp.d		\
-	${TESTSRCDIR}/tst/common/usdt/tst.argmap.c			\
-	${TESTSRCDIR}/tst/common/usdt/tst.args.c			\
-	${TESTSRCDIR}/tst/common/usdt/tst.forker.c			\
+	${TESTSRCDIR}/tst/common/io/tst.fds.d				\
 	${TESTSRCDIR}/tst/common/ip/tst.ipv4localtcp.ksh		\
 	${TESTSRCDIR}/tst/common/ip/tst.ipv4localudp.ksh		\
 	${TESTSRCDIR}/tst/common/ip/tst.ipv4remotetcp.ksh		\
 	${TESTSRCDIR}/tst/common/ip/tst.ipv4remoteudp.ksh		\
 	${TESTSRCDIR}/tst/common/ip/tst.localtcpstate.ksh		\
 	${TESTSRCDIR}/tst/common/ip/tst.remotetcpstate.ksh		\
-	${TESTSRCDIR}/tst/common/scripting/tst.projid.ksh		\
-	${TESTSRCDIR}/tst/common/scripting/tst.taskid.ksh
-
-
-
-NOTWORK+= \
-	${TESTSRCDIR}/tst/common/io/tst.fds.d				\
 	${TESTSRCDIR}/tst/common/java_api/tst.Abort.ksh			\
 	${TESTSRCDIR}/tst/common/java_api/tst.Bean.ksh			\
 	${TESTSRCDIR}/tst/common/java_api/tst.Close.ksh			\
@@ -105,13 +47,57 @@
 	${TESTSRCDIR}/tst/common/java_api/tst.ProbeDescription.ksh	\
 	${TESTSRCDIR}/tst/common/java_api/tst.StateMachine.ksh		\
 	${TESTSRCDIR}/tst/common/java_api/tst.StopLock.ksh 		\
-	${TESTSRCDIR}/tst/common/java_api/tst.printa.d			\
 	${TESTSRCDIR}/tst/common/lexer/err.D_CHR_NL.char.d		\
+	${TESTSRCDIR}/tst/common/lexer/err.D_CHR_NULL.char.d		\
 	${TESTSRCDIR}/tst/common/lexer/err.D_STR_NL.string.d		\
 	${TESTSRCDIR}/tst/common/mdb/tst.dtracedcmd.ksh			\
 	${TESTSRCDIR}/tst/common/mib/tst.icmp.ksh			\
 	${TESTSRCDIR}/tst/common/mib/tst.tcp.ksh			\
 	${TESTSRCDIR}/tst/common/mib/tst.udp.ksh			\
+	${TESTSRCDIR}/tst/common/misc/tst.include.ksh			\
+	${TESTSRCDIR}/tst/common/misc/tst.macroglob.ksh			\
+	${TESTSRCDIR}/tst/common/misc/tst.roch.d			\
+	${TESTSRCDIR}/tst/common/nfs/tst.call.d				\
+	${TESTSRCDIR}/tst/common/nfs/tst.call3.d			\
+	${TESTSRCDIR}/tst/common/offsetof/err.D_UNKNOWN.badmemb.d	\
+	${TESTSRCDIR}/tst/common/pid/err.D_PDESC_ZERO.badlib.d		\
+	${TESTSRCDIR}/tst/common/pid/err.D_PROC_CREATEFAIL.many.d	\
+	${TESTSRCDIR}/tst/common/pid/err.D_PROC_FUNC.badfunc.d		\
+	${TESTSRCDIR}/tst/common/pid/err.D_PROC_LIB.libdash.d		\
+	${TESTSRCDIR}/tst/common/pid/err.D_PROC_NAME.alldash.d		\
+	${TESTSRCDIR}/tst/common/pid/err.D_PROC_NAME.badname.d		\
+	${TESTSRCDIR}/tst/common/pid/err.D_PROC_NAME.globdash.d		\
+	${TESTSRCDIR}/tst/common/pid/err.D_PROC_OFF.toobig.d		\
+	${TESTSRCDIR}/tst/common/pid/tst.addprobes.ksh			\
+	${TESTSRCDIR}/tst/common/pid/tst.args1.d			\
+	${TESTSRCDIR}/tst/common/pid/tst.coverage.d			\
+	${TESTSRCDIR}/tst/common/pid/tst.emptystack.d			\
+	${TESTSRCDIR}/tst/common/pid/tst.float.d			\
+	${TESTSRCDIR}/tst/common/pid/tst.fork.d				\
+	${TESTSRCDIR}/tst/common/pid/tst.gcc.d				\
+	${TESTSRCDIR}/tst/common/pid/tst.manypids.ksh			\
+	${TESTSRCDIR}/tst/common/pid/tst.newprobes.ksh			\
+	${TESTSRCDIR}/tst/common/pid/tst.probemod.ksh			\
+	${TESTSRCDIR}/tst/common/pid/tst.provregex2.ksh			\
+	${TESTSRCDIR}/tst/common/pid/tst.provregex3.ksh			\
+	${TESTSRCDIR}/tst/common/pid/tst.provregex4.ksh			\
+	${TESTSRCDIR}/tst/common/pid/tst.ret1.d				\
+	${TESTSRCDIR}/tst/common/pid/tst.ret2.d				\
+	${TESTSRCDIR}/tst/common/pid/tst.vfork.d			\
+	${TESTSRCDIR}/tst/common/pid/tst.weak1.d			\
+	${TESTSRCDIR}/tst/common/pid/tst.weak2.d			\
+	${TESTSRCDIR}/tst/common/plockstat/tst.available.d		\
+	${TESTSRCDIR}/tst/common/plockstat/tst.libmap.d			\
+	${TESTSRCDIR}/tst/common/pragma/tst.libchain.ksh		\
+	${TESTSRCDIR}/tst/common/predicates/tst.argsnotcached.d		\
+	${TESTSRCDIR}/tst/common/printa/tst.walltimestamp.ksh		\
+	${TESTSRCDIR}/tst/common/printf/tst.basics.d			\
+	${TESTSRCDIR}/tst/common/printf/tst.str.d			\
+	${TESTSRCDIR}/tst/common/privs/tst.func_access.ksh		\
+	${TESTSRCDIR}/tst/common/privs/tst.op_access.ksh		\
+	${TESTSRCDIR}/tst/common/proc/tst.discard.ksh			\
+	${TESTSRCDIR}/tst/common/proc/tst.signal.ksh			\
+	${TESTSRCDIR}/tst/common/proc/tst.startexit.ksh			\
 	${TESTSRCDIR}/tst/common/profile-n/tst.func.ksh			\
 	${TESTSRCDIR}/tst/common/profile-n/tst.mod.ksh			\
 	${TESTSRCDIR}/tst/common/profile-n/tst.sym.ksh			\
@@ -119,62 +105,36 @@
 	${TESTSRCDIR}/tst/common/profile-n/tst.ufuncsort.ksh		\
 	${TESTSRCDIR}/tst/common/profile-n/tst.umod.ksh			\
 	${TESTSRCDIR}/tst/common/profile-n/tst.usym.ksh			\
-	${TESTSRCDIR}/tst/common/safety/tst.basename.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.caller.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.cleanpath.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.copyin.d			\
 	${TESTSRCDIR}/tst/common/safety/tst.copyin2.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.ddi_pathname.d		\
-	${TESTSRCDIR}/tst/common/safety/tst.dirname.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.errno.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.execname.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.gid.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.hton.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.index.d			\
 	${TESTSRCDIR}/tst/common/safety/tst.msgdsize.d			\
 	${TESTSRCDIR}/tst/common/safety/tst.msgsize.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.null.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.pid.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.ppid.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.progenyof.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.random.d			\
 	${TESTSRCDIR}/tst/common/safety/tst.rw.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.shortstr.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.stack.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.stackdepth.d		\
-	${TESTSRCDIR}/tst/common/safety/tst.stddev.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.strchr.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.strjoin.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.strstr.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.strtok.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.substr.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.ucaller.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.uid.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.unalign.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.ustack.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.ustackdepth.d		\
-	${TESTSRCDIR}/tst/common/safety/tst.vahole.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.violentdeath.ksh		\
 	${TESTSRCDIR}/tst/common/safety/tst.zonename.d			\
+	${TESTSRCDIR}/tst/common/scalars/tst.misc.d			\
 	${TESTSRCDIR}/tst/common/sched/tst.enqueue.d			\
-	${TESTSRCDIR}/tst/common/sched/tst.oncpu.d			\
-	${TESTSRCDIR}/tst/common/sched/tst.stackdepth.d			\
+	${TESTSRCDIR}/tst/common/scripting/tst.egid.ksh			\
+	${TESTSRCDIR}/tst/common/scripting/tst.projid.ksh		\
+	${TESTSRCDIR}/tst/common/scripting/tst.taskid.ksh		\
 	${TESTSRCDIR}/tst/common/sdt/tst.sdtargs.d			\
-	${TESTSRCDIR}/tst/common/usdt/argmap.d				\
-	${TESTSRCDIR}/tst/common/usdt/args.d				\
-	${TESTSRCDIR}/tst/common/usdt/forker.d				\
+	${TESTSRCDIR}/tst/common/syscall/tst.args.d			\
+	${TESTSRCDIR}/tst/common/sysevent/tst.post.d			\
+	${TESTSRCDIR}/tst/common/sysevent/tst.post_chan.d		\
+	${TESTSRCDIR}/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d \
+	${TESTSRCDIR}/tst/common/types/tst.struct.d			\
+	${TESTSRCDIR}/tst/common/types/tst.typedef.d			\
 	${TESTSRCDIR}/tst/common/usdt/tst.andpid.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.argmap.d			\
 	${TESTSRCDIR}/tst/common/usdt/tst.args.d			\
 	${TESTSRCDIR}/tst/common/usdt/tst.badguess.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.corruptenv.ksh		\
 	${TESTSRCDIR}/tst/common/usdt/tst.dlclose1.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.dlclose2.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.dlclose3.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.eliminate.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.enabled.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.enabled2.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.entryreturn.ksh		\
 	${TESTSRCDIR}/tst/common/usdt/tst.fork.ksh			\
-	${TESTSRCDIR}/tst/common/usdt/tst.forker.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.guess32.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.guess64.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.header.ksh			\
@@ -188,38 +148,85 @@
 	${TESTSRCDIR}/tst/common/usdt/tst.static.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.static2.ksh			\
 	${TESTSRCDIR}/tst/common/usdt/tst.user.ksh			\
-	${TESTSRCDIR}/tst/common/misc/tst.schrock.ksh 
+	${TESTSRCDIR}/tst/common/ustack/tst.bigstack.d			\
+	${TESTSRCDIR}/tst/common/ustack/tst.depth.ksh			\
+	${TESTSRCDIR}/tst/common/ustack/tst.spin.ksh			\
+	${TESTSRCDIR}/tst/common/vars/tst.ucaller.ksh
 
-# --------------------------------------------------------------------------------
+.if ${MACHINE_ARCH} == "amd64"
+IGNORE+= \
+        ${TESTSRCDIR}/tst/common/dtraceUtil/tst.DataModel32.d.ksh	\
+        ${TESTSRCDIR}/tst/common/safety/tst.vahole.d			\
+        ${TESTSRCDIR}/tst/common/trace/tst.misc.d			\
+        ${TESTSRCDIR}/tst/common/tracemem/tst.rootvp.d			\
+
+.endif
+
+.if ${MACHINE_ARCH} == "i386"
+
+IGNORE+= \
+        ${TESTSRCDIR}/tst/common/pid/tst.killonerror.ksh                \
+        ${TESTSRCDIR}/tst/common/pid/tst.main.ksh                       \
+        ${TESTSRCDIR}/tst/common/syscall/tst.openret.ksh                \
+
+.endif
+
+# Everything in the NOTWORK list either causes a panic, hangs, or does
+# some other bad thing that makes it a bad idea to run the test
+
+# These don't compile
+
+NOTWORK+= \
+	${TESTSRCDIR}/tst/common/io/tst.fds.c				\
+	${TESTSRCDIR}/tst/common/nfs/tst.call.c				\
+	${TESTSRCDIR}/tst/common/nfs/tst.call3.c			\
+	${TESTSRCDIR}/tst/common/sysevent/tst.post_chan.c		\
+	${TESTSRCDIR}/tst/common/sysevent/tst.post.c			\
+	${TESTSRCDIR}/tst/common/usdt/tst.argmap.c			\
+	${TESTSRCDIR}/tst/common/usdt/tst.forker.c
+
+# -----------------------------------------------------------------------------
 # Tests that just don't complete (even to fail) at the moment...
 
 NOTWORK+= \
 	${TESTSRCDIR}/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh	\
-	${TESTSRCDIR}/tst/common/printa/tst.many.d			\
-	${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d	\
-	${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d	\
-	${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d	\
-	${TESTSRCDIR}/tst/common/vars/tst.gid.d				\
-	${TESTSRCDIR}/tst/common/vars/tst.uid.d				\
+	${TESTSRCDIR}/tst/common/funcs/tst.chill.ksh			\
+	${TESTSRCDIR}/tst/common/misc/tst.enablerace.ksh		\
+	${TESTSRCDIR}/tst/common/misc/tst.schrock.ksh 			\
+	${TESTSRCDIR}/tst/common/proc/tst.exitkilled.ksh		\
+	${TESTSRCDIR}/tst/common/speculation/tst.NoSpecBuffer.d	
 
-# --------------------------------------------------------------------------------
-# Tests that currently hang the system:
+# -----------------------------------------------------------------------------
+# Tests that currently panic the system:
 
 NOTWORK+= \
-	${TESTSRCDIR}/tst/common/fbtprovider/tst.basic.d	\
-	${TESTSRCDIR}/tst/common/fbtprovider/tst.return.d	\
-	${TESTSRCDIR}/tst/common/grammar/tst.stmts.d		\
-	${TESTSRCDIR}/tst/common/misc/tst.enablerace.ksh	\
-	${TESTSRCDIR}/tst/common/predicates/tst.predcache.ksh	\
-	${TESTSRCDIR}/tst/common/proc/tst.exitkilled.ksh	\
+	${TESTSRCDIR}/tst/common/safety/tst.ppid.d			\
 
+# -----------------------------------------------------------------------------
+# These spawn many copies of DTrace or ksh that are left running
+
+NOTWORK+= \
+	${TESTSRCDIR}/tst/common/pid/tst.manypids.ksh			\
+	${TESTSRCDIR}/tst/common/safety/tst.violentdeath.ksh		\
+
 .if ${MACHINE_ARCH} == "i386"
 
-NOTWORK+= ${TESTSRCDIR}/tst/common/dtraceUtil/tst.DataModel64.d.ksh
+NOTWORK+= ${TESTSRCDIR}/tst/common/pid/tst.provregex1.ksh
 
 NOTWORK+= ${TESTSRCDIR}/tst/common/dtraceUtil/tst.DataModel64.d.ksh
 
-# --------------------------------------------------------------------------------
+NOTWORK+= \
+	${TESTSRCDIR}/tst/common/safety/tst.basename.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.cleanpath.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.dirname.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.index.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.strchr.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.strjoin.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.strstr.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.strtok.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.ustack.d			\
+
+# -----------------------------------------------------------------------------
 # This test causes i386 to go kaboom in a big way. There is a problem in the
 # fbt exception code which needs to be fixed.
 
@@ -245,13 +252,13 @@
 
 .endif
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # Interrupt priority isn't relevant on FreeBSD.
 
 NOTWORK+= ${TESTSRCDIR}/tst/common/builtinvar/tst.ipl.d \
 	${TESTSRCDIR}/tst/common/builtinvar/tst.ipl1.d
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # These tests relies on the Solaris ping behaviour of exiting after a number of
 # pings. On FreeBSD ping doesn't do that.
 
@@ -261,26 +268,45 @@
 	${TESTSRCDIR}/tst/common/ip/tst.ipv4localicmp.ksh 	\
 	${TESTSRCDIR}/tst/common/ip/tst.ipv4remoteicmp.ksh 
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # This test checks for a leading tab on a line before #define. That is illegal
-# on Solaris, but the gcc pre-processor on FreeBSD is happy with code like that.
+# on Solaris, but the gcc pre-processor on FreeBSD is happy with it.
 
-NOTWORK+= ${TESTSRCDIR}/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d
+IGNORE+= ${TESTSRCDIR}/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # This test is coded to use Solaris syscall names. FreeBSD has none with 'lwp"
 # in them, so the test fails because of that.
 
-NOTWORK+= ${TESTSRCDIR}/tst/common/probes/tst.probestar.d
+IGNORE+= ${TESTSRCDIR}/tst/common/probes/tst.probestar.d
 
-NOTYET=	${IGNORE} ${NOTWORK}
+# The FLAKY list is safe to run, but has race conditions and sometimes
+# pass and sometimes fail
 
-# --------------------------------------------------------------------------------
+FLAKY+= \
+	${TESTSRCDIR}/tst/common/predicates/tst.predcache.ksh		\
+	${TESTSRCDIR}/tst/common/raise/tst.raise1.d			\
+	${TESTSRCDIR}/tst/common/raise/tst.raise2.d			\
+	${TESTSRCDIR}/tst/common/raise/tst.raise3.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.copyin.d			\
+	${TESTSRCDIR}/tst/common/scalars/tst.selfarray2.d		\
+	${TESTSRCDIR}/tst/common/stop/tst.stop1.d			\
+
+.if ${MACHINE_ARCH} == "i386"
+FLAKY+= \
+        ${TESTSRCDIR}/tst/common/aggs/tst.lquantzero.d                  \
+        ${TESTSRCDIR}/tst/common/aggs/tst.negorder.d                    \
+        ${TESTSRCDIR}/tst/common/aggs/tst.quantzero.d                   \
+        ${TESTSRCDIR}/tst/common/llquantize/tst.negorder.d
+.endif
+NOTYET=	${IGNORE} ${FLAKY} ${NOTWORK}
+
+# -----------------------------------------------------------------------------
 # Only prepare the test lists if we need to:
 
 .if !make(obj) && !make(clean) && !make(cleandir) && !make(listerrors)
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # Get a list of tests, named according to the directory they are in:
 
 _COMMONDIRS!=	cd ${TESTSRCDIR}/tst/common; find . -depth 1 -type d
@@ -289,7 +315,7 @@
 listtests	:
 	@echo ${COMMONDIRS}
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # Create a test target for each directory:
 
 ALL_TESTFILES=
@@ -328,7 +354,7 @@
 	@${DTEST} ${${_d}_TFS}
 .endfor
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # 
 
 PRGS=	${ALL_TESTCFILES:T:S/c$/exe/}
@@ -336,7 +362,7 @@
 listprgs	:
 	@echo ${PRGS}
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # 
 
 .for _f in ${ALL_TESTCFILES}
@@ -347,26 +373,29 @@
 listcfiles	:
 	@echo ${ALL_TESTCFILES}
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # A target to build all tests:
 
 all	: ${PRGS}
 	@sync; sync; sync; sync; sync
 	@${DTEST} ${ALL_TESTFILES}
 
-# --------------------------------------------------------------------------------
-# A target to build the tests flagged as not working yet:
+# -----------------------------------------------------------------------------
+# Targets to build the tests flagged as not working yet:
 
 ignore	:
 	@${DTEST} ${IGNORE}
 
+flaky	:
+	@${DTEST} ${FLAKY}
+
 .endif
 
 listerrors	:
 	@find ${.OBJDIR} -name "*.err" -exec cat {} \; -print
 
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # Test failures are written to failure.N directories in the object tree.
 # Get a list of directories in the object tree for 'make clean'.
 
@@ -374,14 +403,14 @@
 CLEANDIRS!=	cd ${.OBJDIR} && ls -d *
 .endif
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # Insist on using an object directory. Things get messy otherwsie.
 
 .if ${.OBJDIR} == ${.CURDIR} && !make(obj) && !make(clean) && !make(cleandir)
 .error ERROR: You must run 'make obj' first!
 .endif
 
-# --------------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 # Load the DTrace module set if necessary.
 
 .BEGIN	:
Index: sys/amd64/amd64/exception.S
===================================================================
--- sys/amd64/amd64/exception.S	(revision 247284)
+++ sys/amd64/amd64/exception.S	(working copy)
@@ -60,6 +60,12 @@
 	.size	dtrace_invop_calltrap_addr,8
 dtrace_invop_calltrap_addr:
 	.zero	8
+         .globl  dtrace_trap_func
+ 	.align  8
+	.type   dtrace_trap_func, @object
+	.size   dtrace_trap_func, 8
+dtrace_trap_func:
+	.zero   8
 #endif
 	.text
 #ifdef HWPMC_HOOKS
@@ -224,10 +230,42 @@
 	.globl	calltrap
 	.type	calltrap,@function
 calltrap:
+	/*
+	 * If a dtrace probe is active, we don't want to call trap().  It may
+	 * have been instrumented by the fbt provider, causing recursion.  So
+	 * check that case here, by calling (*dtrace_trap_func) first.
+	 *
+	 * Note: It would be faster to test the per-CPU flag here, but that
+	 * currently lives in CDDL code, which this module doesn't have
+	 * visibility into.  This hurts us only if dtrace is loaded.
+	 */
+
+	#ifdef KDTRACE_HOOKS
+	movq	dtrace_trap_func, %rax
+	testq	%rax, %rax
+	jne	calldtrace
+	#endif
+
+	movq	%rsp, %rdi
+	call	trap
+	MEXITCOUNT
+	jmp	doreti			/* Handle any pending ASTs */
+
+	#ifdef KDTRACE_HOOKS
+
+calldtrace:
+	movq	%rsp, %rdi
+	movl	TF_TRAPNO(%rsp), %esi
+	call	*%rax
+	testl	%eax, %eax
+	jne	skiptrap
+
 	movq	%rsp,%rdi
 	call	trap
+skiptrap:	
 	MEXITCOUNT
 	jmp	doreti			/* Handle any pending ASTs */
+#endif
 
 	/*
 	 * alltraps_noen entry point.  Unlike alltraps above, we want to
Index: sys/amd64/amd64/trap.c
===================================================================
--- sys/amd64/amd64/trap.c	(revision 247284)
+++ sys/amd64/amd64/trap.c	(working copy)
@@ -102,7 +102,6 @@
  * to handle traps which might occur during DTrace probe
  * execution.
  */
-dtrace_trap_func_t	dtrace_trap_func;
 
 dtrace_doubletrap_func_t	dtrace_doubletrap_func;
 
@@ -250,10 +249,6 @@
 	 * want to fault. On returning from the probe, the no-fault
 	 * flag is cleared and finally re-scheduling is enabled.
 	 *
-	 * If the DTrace kernel module has registered a trap handler,
-	 * call it and if it returns non-zero, assume that it has
-	 * handled the trap and modified the trap frame so that this
-	 * function can return normally.
 	 */
 	if (type == T_DTRACE_PROBE || type == T_DTRACE_RET ||
 	    type == T_BPTFLT) {
@@ -273,8 +268,6 @@
 		    dtrace_return_probe_ptr(&regs) == 0)
 			goto out;
 	}
-	if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type))
-		goto out;
 #endif
 
 	if ((frame->tf_rflags & PSL_I) == 0) {

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ0x7rOiY_6z_1obs4N78EPh%2B_prWAVSgCSvywBZb%2BZBZ0342g>