Index: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh =================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh (revision 326284) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh (revision 326285) @@ -1,83 +1,83 @@ #! /usr/bin/ksh # # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2013 Joyent, Inc. All rights reserved. # # # Simple test that if we manually use the userland keyword that it # works. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 t="zelda_info_t" exe="tst.chasestrings.exe" elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf' if [[ $? -ne 0 ]]; then echo "CTF does not exist in $exe, that's a bug" >&2 exit 1 fi ./$exe & pid=$! -$dtrace -32 -qs /dev/stdin <t = (userland info_t *)arg0; printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(this->t->zi_gamename), this->t->zi_ndungeons, stringof(this->t->zi_villain), this->t->zi_haszelda); next = 1; } pid$pid::has_dungeons:entry /next == 1/ { this->t = (userland info_t *)arg0; printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(this->t->zi_gamename), this->t->zi_ndungeons, stringof(this->t->zi_villain), this->t->zi_haszelda); next = 2; } pid$pid::has_villain:entry /next == 2/ { this->t = (userland info_t *)arg0; printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", stringof(this->t->zi_gamename), this->t->zi_ndungeons, stringof(this->t->zi_villain), this->t->zi_haszelda); exit(0); } EOF rc=$? kill -9 $pid exit $rc Index: head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile =================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile (revision 326284) +++ head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile (revision 326285) @@ -1,38 +1,39 @@ # $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. # PACKAGE= tests ${PACKAGE}FILES= \ err.D_PDESC_ZERO.probeqtn.d \ err.D_PDESC_ZERO.probestar.d \ err.D_PDESC_ZERO.tickstar.d \ err.D_SYNTAX.assign.d \ err.D_SYNTAX.declare.d \ err.D_SYNTAX.declarein.d \ err.D_SYNTAX.lbraces.d \ err.D_SYNTAX.probespec.d \ err.D_SYNTAX.rbraces.d \ err.D_SYNTAX.recdec.d \ tst.basic1.d \ tst.check.d \ tst.declare.d \ tst.declareafter.d \ tst.emptyprobe.d \ tst.pragma.d \ tst.pragmaaftertab.d \ tst.pragmainside.d \ tst.pragmaoutside.d \ tst.probestar.d \ TESTEXES= \ CFILES= \ tst.probestar.c \ + .include "../../dtrace.test.mk" Index: head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile =================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile (revision 326284) +++ head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile (revision 326285) @@ -1,77 +1,78 @@ # $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. # PACKAGE= tests ${PACKAGE}FILES= \ bug.1001148.SpecSizeVariations.d \ err.BufSizeVariations1.d \ err.BufSizeVariations2.d \ err.D_ACT_SPEC.SpeculateWithBreakPoint.d \ err.D_ACT_SPEC.SpeculateWithChill.d \ err.D_ACT_SPEC.SpeculateWithCopyOut.d \ err.D_ACT_SPEC.SpeculateWithCopyOutStr.d \ err.D_ACT_SPEC.SpeculateWithPanic.d \ err.D_ACT_SPEC.SpeculateWithRaise.d \ err.D_ACT_SPEC.SpeculateWithStop.d \ err.D_AGG_COMM.AggAftCommit.d \ err.D_AGG_SPEC.SpeculateWithAvg.d \ err.D_AGG_SPEC.SpeculateWithCount.d \ err.D_AGG_SPEC.SpeculateWithLquant.d \ err.D_AGG_SPEC.SpeculateWithMax.d \ err.D_AGG_SPEC.SpeculateWithMin.d \ err.D_AGG_SPEC.SpeculateWithQuant.d \ err.D_AGG_SPEC.SpeculateWithStddev.d \ err.D_AGG_SPEC.SpeculateWithSum.d \ err.D_COMM_COMM.CommitAftCommit.d \ err.D_COMM_COMM.DisjointCommit.d \ err.D_COMM_DREC.CommitAftDataRec.d \ err.D_DREC_COMM.DataRecAftCommit.d \ err.D_DREC_COMM.ExitAfterCommit.d \ err.D_EXIT_SPEC.ExitAftSpec.d \ err.D_PRAGMA_MALFORM.NspecExpr.d \ err.D_PRAGMA_OPTSET.HugeNspecValue.d \ err.D_PRAGMA_OPTSET.InvalidSpecSize.d \ err.D_PRAGMA_OPTSET.NegSpecSize.d \ err.D_PROTO_LEN.SpecNoId.d \ err.D_SPEC_COMM.SpecAftCommit.d \ err.D_SPEC_DREC.SpecAftDataRec.d \ err.D_SPEC_SPEC.SpecAftSpec.d \ err.NegativeBufSize.d \ err.NegativeNspec.d \ err.NegativeSpecSize.d \ err.SpecSizeVariations1.d \ err.SpecSizeVariations2.d \ tst.CommitAfterDiscard.d \ tst.CommitWithZero.d \ tst.DataRecAftDiscard.d \ tst.DiscardAftCommit.d \ tst.DiscardAftDataRec.d \ tst.DiscardAftDiscard.d \ tst.DiscardWithZero.d \ tst.ExitAftDiscard.d \ tst.NoSpecBuffer.d \ tst.SpecSizeVariations1.d \ tst.SpecSizeVariations2.d \ tst.SpecSizeVariations3.d \ tst.SpeculateWithRandom.d \ tst.SpeculationCommit.d \ tst.SpeculationDiscard.d \ tst.SpeculationID.d \ tst.SpeculationWithZero.d \ tst.TwoSpecBuffers.d \ tst.negcommit.d \ tst.negspec.d \ tst.zerosize.d \ TESTEXES= \ tst.NoSpecBuffer.exe \ + CFILES= \ .include "../../dtrace.test.mk" Index: head/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile =================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile (revision 326284) +++ head/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile (revision 326285) @@ -1,45 +1,43 @@ # $FreeBSD$ # # This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. # PACKAGE= tests ${PACKAGE}FILES= \ err.invalidpid.d \ err.invalidpid2.d \ err.invalidpid3.d \ err.invalidtype.ksh \ err.invalidtype2.ksh \ err.user64mode.ksh \ tst.aouttype.ksh \ tst.chasestrings.ksh \ tst.chasestrings.ksh.out \ tst.libtype.ksh \ tst.linkmap.ksh \ tst.pidprint.ksh \ tst.pidprinttarg.ksh \ tst.printtype.ksh \ tst.printtype.ksh.out \ tst.printtypetarg.ksh \ tst.userlandkey.ksh \ tst.userlandkey.ksh.out \ tst.userstrings.ksh \ tst.userstrings.ksh.out \ TESTEXES= \ CFILES= \ tst.aouttype.c \ tst.chasestrings.c \ tst.libtype.c \ tst.printtype.c \ WITH_CTF=YES -CFLAGS.tst.chasestrings.exe+= -m32 - .include "../../dtrace.test.mk" Index: head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh =================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh (revision 326284) +++ head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh (revision 326285) @@ -1,103 +1,101 @@ # $FreeBSD$ usage() { cat <<__EOF__ >&2 usage: $(basename $0) This script regenerates the DTrace test suite makefiles. It should be run whenever \$srcdir/cddl/contrib/opensolaris/cmd/dtrace/test/tst is modified. __EOF__ exit 1 } # Format a file list for use in a make(1) variable assignment: take the # basename of each input file and append " \" to it. fmtflist() { awk 'function bn(f) { sub(".*/", "", f) return f } {print " ", bn($1), " \\"}' } genmakefile() { local basedir=$1 local tdir=${CONTRIB_TESTDIR}/${basedir} local tfiles=$(find $tdir -type f -a \ \( -name \*.d -o -name \*.ksh -o -name \*.out \) | sort | fmtflist) local tcfiles=$(find $tdir -type f -a -name \*.c | sort | fmtflist) local texes=$(find $tdir -type f -a -name \*.exe | sort | fmtflist) # One-off variable definitions. local special case "$basedir" in proc) special=" LIBADD.tst.sigwait.exe+= rt " ;; raise) special=" TEST_METADATA.t_dtrace_contrib+= required_memory=\"4g\" " ;; safety) special=" TEST_METADATA.t_dtrace_contrib+= required_memory=\"4g\" " ;; uctf) special=" WITH_CTF=YES - -CFLAGS.tst.chasestrings.exe+= -m32 " ;; esac local makefile=$(mktemp) cat <<__EOF__ > $makefile # \$FreeBSD$ # # This Makefile was generated by \$srcdir${ORIGINDIR#${TOPDIR}}/genmakefiles.sh. # PACKAGE= tests \${PACKAGE}FILES= \\ $tfiles TESTEXES= \\ $texes CFILES= \\ $tcfiles $special .include "../../dtrace.test.mk" __EOF__ mv -f $makefile ${ORIGINDIR}/../common/${basedir}/Makefile } set -e if [ $# -ne 0 ]; then usage fi export LC_ALL=C readonly ORIGINDIR=$(realpath $(dirname $0)) readonly TOPDIR=$(realpath ${ORIGINDIR}/../../../../..) readonly CONTRIB_TESTDIR=${TOPDIR}/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common # Generate a Makefile for each test group under common/. for dir in $(find ${CONTRIB_TESTDIR} -mindepth 1 -maxdepth 1 -type d); do genmakefile $(basename $dir) done