diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh index 696088c6d4a4..f1887ea78e99 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh @@ -1,107 +1,107 @@ #!/usr/bin/ksh # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # # This test verifies that a program that corrupts its own environment # without inducing a crash does not crash solely due to drti.o's use of # getenv(3C). # PATH=/usr/bin:/usr/sbin:$PATH if (( $# != 1 )); then print -u2 'expected one argument: ' exit 2 fi # # jdtrace does not implement the -h option that is required to generate # C header files. # if [[ "$1" == */jdtrace ]]; then exit 0 fi dtrace="$1" startdir="$PWD" dir=$(mktemp -d -t drtiXXXXXX) if (( $? != 0 )); then print -u2 'Could not create safe temporary directory' exit 2 fi cd "$dir" cat > Makefile < prov.d < main.c < #include #include "prov.h" int main(int argc, char **argv, char **envp) { envp[0] = (char*)0xff; TESTER_ENTRY(); return 0; } EOF make > /dev/null status=$? if (( $status != 0 )) ; then print -u2 "failed to build" else ./main status=$? fi cd "$startdir" rm -rf "$dir" exit $status diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh index 96b05d5cde2d..7dcfd41d807a 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh @@ -1,106 +1,106 @@ # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" # # Make sure temporary symbols generated due to DTrace probes in static # functions are removed in the final link step. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > prov.d < test.c < #include "prov.h" static void foo(void) { TEST_PROV_GO(); } int main(int argc, char **argv) { foo(); return (0); } EOF cc -c test.c if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" exit 1 fi -$dtrace -G -32 -s prov.d test.o +$dtrace -G -s prov.d test.o if [ $? -ne 0 ]; then print -u2 "failed to create DOF" exit 1 fi cc -o test test.o prov.o if [ $? -ne 0 ]; then print -u2 "failed to link final executable" exit 1 fi nm test.o | grep \$dtrace > /dev/null if [ $? -ne 0 ]; then print -u2 "no temporary symbols in the object file" exit 1 fi nm test | grep \$dtrace > /dev/null if [ $? -eq 0 ]; then print -u2 "failed to eliminate temporary symbols" exit 1 fi cd / /bin/rm -rf $DIR exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh index d0ac1864877e..2a1f9b6ed784 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh @@ -1,96 +1,96 @@ # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > prov.d < test.c < #include "prov.h" int main(int argc, char **argv) { if (TEST_PROV_GO_ENABLED()) { TEST_PROV_GO(); } } EOF cc -c test.c if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" exit 1 fi -$dtrace -G -32 -s prov.d test.o +$dtrace -G -s prov.d test.o if [ $? -ne 0 ]; then print -u2 "failed to create DOF" exit 1 fi cc -o test test.o prov.o if [ $? -ne 0 ]; then print -u2 "failed to link final executable" exit 1 fi script() { $dtrace -c ./test -qs /dev/stdin <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > prov.d < test.c < #include "prov.h" int foo(void) { return (24); } int main(int argc, char **argv) { int a = foo(); if (TEST_PROV_GO_ENABLED()) { TEST_PROV_GO(); } (void) printf("%d %d %d\n", a, a, a); return (0); } EOF cc -c -xO2 test.c if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" exit 1 fi -$dtrace -G -32 -s prov.d test.o +$dtrace -G -s prov.d test.o if [ $? -ne 0 ]; then print -u2 "failed to create DOF" exit 1 fi cc -o test test.o prov.o if [ $? -ne 0 ]; then print -u2 "failed to link final executable" exit 1 fi script() { ./test $dtrace -c ./test -qs /dev/stdin <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > test.c < int main(int argc, char **argv) { DTRACE_PROBE(test_prov, entry); DTRACE_PROBE(test_prov, __entry); DTRACE_PROBE(test_prov, foo__entry); DTRACE_PROBE(test_prov, carpentry); DTRACE_PROBE(test_prov, miniatureturn); DTRACE_PROBE(test_prov, foo__return); DTRACE_PROBE(test_prov, __return); /* * Unfortunately, a "return" probe is not currently possible due to * the conflict with a reserved word. */ DTRACE_PROBE(test_prov, done); } EOF cat > prov.d <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > prov.d < test.c < #include #include #include "prov.h" int main(int argc, char **argv) { TEST_PROV_GO(); if (fork() == 0) { TEST_PROV_GO(); return (0); } (void) wait(NULL); TEST_PROV_GO(); return (0); } EOF cc -c test.c if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" exit 1 fi -$dtrace -G -32 -s prov.d test.o +$dtrace -G -s prov.d test.o if [ $? -ne 0 ]; then print -u2 "failed to create DOF" exit 1 fi cc -o test test.o prov.o if [ $? -ne 0 ]; then print -u2 "failed to link final executable" exit 1 fi script() { $dtrace -c ./test -Zqs /dev/stdin <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > prov.d < test.c < #include "prov.h" int main(int argc, char **argv) { TEST_PROV_ZERO(); TEST_PROV_ONE(1); TEST_PROV_U_NDER("hi there"); TEST_PROV_D_ASH(argv); } EOF cc -c test.c if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" exit 1 fi -$dtrace -G -32 -s prov.d test.o +$dtrace -G -s prov.d test.o if [ $? -ne 0 ]; then print -u2 "failed to create DOF" exit 1 fi cc -o test test.o prov.o if [ $? -ne 0 ]; then print -u2 "failed to link final executable" exit 1 fi cd / /bin/rm -rf $DIR diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh index a1ef9d89c30b..4aa3f59e16f9 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh @@ -1,82 +1,82 @@ # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > test.c < int main(int argc, char **argv) { DTRACE_PROBE(test_prov, zero); DTRACE_PROBE1(test_prov, one, 1); DTRACE_PROBE2(test_prov, two, 2, 3); DTRACE_PROBE3(test_prov, three, 4, 5, 7); DTRACE_PROBE4(test_prov, four, 7, 8, 9, 10); DTRACE_PROBE5(test_prov, five, 11, 12, 13, 14, 15); } EOF cat > prov.d <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR ppriv -s A=basic $$ cat > test.c < int main(int argc, char **argv) { DTRACE_PROBE(test_prov, zero); DTRACE_PROBE1(test_prov, one, 1); DTRACE_PROBE2(test_prov, two, 2, 3); DTRACE_PROBE3(test_prov, three, 4, 5, 7); DTRACE_PROBE4(test_prov, four, 7, 8, 9, 10); DTRACE_PROBE5(test_prov, five, 11, 12, 13, 14, 15); } EOF cat > prov.d <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > prov.d < test.c < #include "prov.h" int main(int argc, char **argv) { TEST_PROV_GO(); TEST_PROV_GO(); TEST_PROV_GO(); TEST_PROV_GO(); return (0); } EOF cc -c test.c if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" exit 1 fi -$dtrace -G -32 -s prov.d test.o +$dtrace -G -s prov.d test.o if [ $? -ne 0 ]; then print -u2 "failed to create DOF" exit 1 fi cc -o test test.o prov.o if [ $? -ne 0 ]; then print -u2 "failed to link final executable" exit 1 fi script() { $dtrace -c ./test -qs /dev/stdin <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR echo '#pragma D option quiet' > test.d echo '#pragma D option aggsortkey' >> test.d cat > test.c < void main() { EOF objs= for oogle in doogle bagnoogle; do cat > $oogle.c < void $oogle() { DTRACE_PROBE($oogle, knows); } EOF cat > $oogle.d <> test.c echo $oogle'$target:::{@[probefunc] = count()}' >> test.d done echo "}" >> test.c echo 'END{printa("%-10s %@d\\n", @)}' >> test.d cc -o test test.c $objs if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" exit 1 fi $dtrace -s ./test.d -Zc ./test if [ $? -ne 0 ]; then print -u2 "failed to execute test" exit 1 fi cd / rm -rf $DIR exit 0 diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh index 2c1aedcdece4..4f3264f74a59 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh @@ -1,59 +1,59 @@ # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright (c) 2013, Joyent, Inc. All rights reserved. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > test.c < doogle.d <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > test.c < #include int main(int argc, char **argv) { DTRACE_PROBE(test_prov, probe1); } EOF cat > prov.d < 10/ { exit(0); } EOF } script 2>&1 | tee test.out # # It should be true that our probe was not reaped after the provider was made # defunct: the speculative tracing action prevents reaping of any ECB in the # enabling. # status=0 if grep D_PDESC_INVAL test.out 2> /dev/null 1>&2 ; then status=1 else grep D_PROC_GRAB test.out 2> /dev/null 1>&2 status=$? fi cd / rm -rf $DIR exit $status diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh index 2afd78165fc4..16ff34ae4217 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh @@ -1,124 +1,124 @@ # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright (c) 2011, Joyent, Inc. All rights reserved. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > test.c < #include int main(int argc, char **argv) { DTRACE_PROBE(test_prov, probe1); } EOF cat > prov.d < 10/ { exit(0); } EOF } $dtrace -x bufpolicy=ring -ZwqP test_prov\* > /dev/null 2>&1 & background=$! echo launched ring buffered enabling as pid $background script 2>&1 | tee test.out # # It should be true that our probe was not reaped after the provider was made # defunct: the active ring buffer in the earlier enabling prevents reaping of # any of the earlier enabling's ECBs. # status=0 if grep D_PDESC_INVAL test.out 2> /dev/null 1>&2 ; then status=1 else grep D_PROC_GRAB test.out 2> /dev/null 1>&2 status=$? fi kill $background cd / rm -rf $DIR exit $status diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh index 9def3c002b9a..db2771ab32c0 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh @@ -1,82 +1,82 @@ # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > prov.d < test.c < #include "prov.h" int main(int argc, char **argv) { if (TEST_PROV_GO_ENABLED()) return (2); return (0); } EOF cc -c test.c if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" exit 1 fi -$dtrace -G -32 -s prov.d test.o +$dtrace -G -s prov.d test.o if [ $? -ne 0 ]; then print -u2 "failed to create DOF" exit 1 fi cc -o test test.o prov.o if [ $? -ne 0 ]; then print -u2 "failed to link final executable" exit 1 fi cd / /bin/rm -rf $DIR diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh index 4f6c0ac87d97..8ce1dc0181d0 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh @@ -1,115 +1,115 @@ # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright (c) 2011, Joyent, Inc. All rights reserved. # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > test.c < #include int main(int argc, char **argv) { DTRACE_PROBE(test_prov, probe1); } EOF cat > prov.d < 10/ { exit(0); } EOF } script 2>&1 | tee test.out # # It should be true that our probe was reaped over the course of the enabling, # causing the embedded DTrace invocation to fail on an invalid probe (that is, # D_PDESC_INVAL) instead of an inability to grab the underlying process # (D_PROC_GRAB). # grep D_PDESC_INVAL test.out 2> /dev/null 1>&2 status=$? cd / rm -rf $DIR exit $status diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh index 4ea33f76d83c..2c6c7bc9f89a 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh @@ -1,98 +1,98 @@ # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > test.c < int main(int argc, char **argv) { DTRACE_PROBE(test_prov, zero); } EOF cat > prov.d <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > test.c < #include static void foo(void) { DTRACE_PROBE(test_prov, probe1); DTRACE_PROBE(test_prov, probe2); } int main(int argc, char **argv) { DTRACE_PROBE(test_prov, probe1); DTRACE_PROBE(test_prov, probe2); foo(); } EOF cat > prov.d <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > test.c < #include static void foo(void) { DTRACE_PROBE(test_prov, probe1); DTRACE_PROBE(test_prov, probe2); } int main(int argc, char **argv) { DTRACE_PROBE(test_prov, probe1); DTRACE_PROBE(test_prov, probe2); foo(); } EOF cat > prov.d <' exit 2 fi dtrace=$1 DIR=/var/tmp/dtest.$$ mkdir $DIR cd $DIR cat > prov.d < test.c < #include "prov.h" int main(int argc, char **argv) { TEST_PROV_GO(); return (0); } EOF cc -c test.c if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" exit 1 fi -$dtrace -G -32 -s prov.d test.o +$dtrace -G -s prov.d test.o if [ $? -ne 0 ]; then print -u2 "failed to create DOF" exit 1 fi cc -o test test.o prov.o if [ $? -ne 0 ]; then print -u2 "failed to link final executable" exit 1 fi script() { $dtrace -c 'ppriv -e -s A=basic ./test' -Zqs /dev/stdin <