test: testsuite $dt_flags and linker flags problems
PATCH v2 1/1 test: testsuite $dt_flags and linker flags problems
The testsuite passes in a $dtrace environment variable: this must be an ELF executable because some tests use it in hashbang lines, so necessary flags are passed in in a $dt_flags variable which must be passed to every dtrace invocation. These flags are largely path adjustments (-I etc) pointing DTrace to the in-source-tree testsuite or the out-of-tree SDT headers and such things: as such, it's unfortunate that a great many invocations were missed and that those invocations were largely things like -G that actually *use* -I.
It also passes in a $test_cppflags variable which is meant to be used for C preprocessor invocations, but many tests which should use it don't use it, leading to the possibility (and, these days, the likelihood) of picking up SystemTap <sys/sdt.h> instead, or simply a compilation error if an installed testsuite is run.
This uncovers another bug: the -I flags passed in in all the above cases are relative paths, so they are wrong for any tests that cd, such as almost any test that does any compiles (which all cd into directories under the $tmpdir). Make them absolute.
runtest.sh also populates a test_ldflags containing -L arguments for libraries in the build tree, but this is never exported or used by any tests: pass that in too, and change linker invocations to use it instead.
--- runtest.sh | 3 ++- .../locking/tst.DestructionDoubleUnlock.sh | 12 +++++------ .../locking/tst.exit-process-kill-races.sh | 4 ++-- .../headers/tst.header-endianness.sh | 2 +- test/unittest/actions/symmod/tst.symmod.sh | 2 +- test/unittest/aggs/tst.aggmod_full2.sh | 8 ++++---- test/unittest/aggs/tst.aggpercpu.sh | 2 +- test/unittest/aggs/tst.multicpus.sh | 2 +- test/unittest/arrays/tst.uregsarray-check.sh | 10 +++++----- test/unittest/builtinvar/tst.errno3.sh | 2 +- test/unittest/cpc/err.cpcvscpustatpart1.sh | 2 +- test/unittest/cpc/err.cpcvscpustatpart2.sh | 2 +- test/unittest/cpc/err.cputrackfailtostart.sh | 2 +- test/unittest/cpc/err.cputrackterminates.sh | 2 +- test/unittest/cpc/tst.platformevent.sh | 2 +- .../dtrace-util/tst.ListProbesArgsUSDT.sh | 12 +++++------ .../dtrace-util/tst.ListProbesFuncUSDT.sh | 16 +++++++-------- .../dtrace-util/tst.ListProbesModuleSDT.sh | 2 +- .../dtrace-util/tst.ListProbesModuleUSDT.sh | 12 +++++------ .../dtrace-util/tst.ListProbesNameUSDT.sh | 16 +++++++-------- .../dtrace-util/tst.ListProbesProviderUSDT.sh | 14 ++++++------- test/unittest/dtrace-util/tst.ProcInvalid.sh | 2 +- .../fbtprovider/err.D_ARGS_IDX.void-void.x | 2 +- .../fbtprovider/err.D_ARGS_IDX.void.x | 2 +- test/unittest/ip/tst.ipv4remotetcp.sh | 2 +- test/unittest/misc/err.lockmem-pragma.sh | 2 +- test/unittest/misc/tst.include.sh | 4 ++-- test/unittest/misc/tst.lockmem-cmdline.sh | 2 +- test/unittest/misc/tst.lockmem-envvar.sh | 2 +- test/unittest/misc/tst.lockmem-x.sh | 2 +- test/unittest/misc/tst.parser1.sh | 2 +- test/unittest/misc/tst.parser2.sh | 2 +- test/unittest/misc/tst.parser4.sh | 2 +- test/unittest/options/tst.bpflog-cmdline.sh | 2 +- test/unittest/options/tst.bpflog-pragma.sh | 2 +- .../unittest/options/tst.bpflogsize-pragma.sh | 2 +- test/unittest/options/tst.iregs.sh | 2 +- test/unittest/options/tst.linktype.sh | 6 +++--- test/unittest/options/tst.modpath.x | 2 +- test/unittest/options/tst.strip.sh | 8 ++++---- test/unittest/options/tst.switchrate.sh | 2 +- test/unittest/options/tst.tregs.sh | 2 +- test/unittest/pid/tst.offsets.sh | 2 +- test/unittest/pid/tst.provregex3.sh | 4 ++-- test/unittest/pid/tst.provregex4.sh | 6 +++--- test/unittest/predicates/tst.predcache.sh | 4 ++-- test/unittest/printf/tst.wide-bug30404549.sh | 2 +- test/unittest/printf/tst.wide.sh | 2 +- .../providers/rawtp/err.lockmem-too-low.sh | 4 ++-- test/unittest/syscall/tst.openret.sh | 2 +- test/unittest/usdt/tst.allargs.sh | 7 ++++--- test/unittest/usdt/tst.andpid.ksh | 2 +- test/unittest/usdt/tst.badguess.sh | 9 +++++---- test/unittest/usdt/tst.corruptenv.sh | 8 ++++---- test/unittest/usdt/tst.dlclose1.sh | 20 +++++++++---------- test/unittest/usdt/tst.dlclose2.sh | 18 ++++++++--------- test/unittest/usdt/tst.dlclose3.sh | 18 ++++++++--------- test/unittest/usdt/tst.dlclose4.sh | 14 ++++++------- test/unittest/usdt/tst.eliminate.sh | 9 +++++---- test/unittest/usdt/tst.enable_pid.sh | 4 ++-- test/unittest/usdt/tst.enabled.sh | 11 +++++----- test/unittest/usdt/tst.enabled2.sh | 11 +++++----- test/unittest/usdt/tst.entryreturn.sh | 7 ++++--- .../unittest/usdt/tst.exec-dof-replacement.sh | 11 +++++----- test/unittest/usdt/tst.execstack.sh | 9 +++++---- test/unittest/usdt/tst.fork.sh | 11 +++++----- test/unittest/usdt/tst.forker.sh | 2 +- test/unittest/usdt/tst.guess32.sh | 11 +++++----- test/unittest/usdt/tst.guess64.sh | 11 +++++----- test/unittest/usdt/tst.header.sh | 9 +++++---- test/unittest/usdt/tst.lingering.sh | 11 +++++----- test/unittest/usdt/tst.link-idempotence.sh | 11 +++++----- test/unittest/usdt/tst.linkpriv.sh | 5 +++-- test/unittest/usdt/tst.linkunpriv.sh | 2 +- test/unittest/usdt/tst.manyprobes.sh | 7 ++++--- test/unittest/usdt/tst.manyprocs.sh | 9 +++++---- test/unittest/usdt/tst.multiple.sh | 11 +++++----- test/unittest/usdt/tst.multitrace.sh | 11 +++++----- test/unittest/usdt/tst.nusdtprobes.sh | 8 ++++---- test/unittest/usdt/tst.onlyenabled.sh | 9 +++++---- test/unittest/usdt/tst.pie.sh | 11 +++++----- test/unittest/usdt/tst.reeval.sh | 7 ++++--- test/unittest/usdt/tst.static.sh | 7 ++++--- test/unittest/usdt/tst.static2.sh | 9 +++++---- test/unittest/usdt/tst.user.sh | 11 +++++----- 85 files changed, 283 insertions(+), 257 deletions(-)
v2: one test dropped because it's now renamed and fixed up
(and otherwise modified) in the usdt typed-args series.
runtest.sh +2 -1
@@ -554,7 +554,7 @@ if [[ -z $USE_INSTALLED ]]; then dtrace="$(pwd)/build*/dtrace" test_libdir="$(pwd)/build/dlibs" test_ldflags="-L$(pwd)/build" - test_cppflags="-Iinclude -Iuts/common -Ibuild -Ilibdtrace -DARCH_$arch" + test_cppflags="-I$(pwd)/include -I$(pwd)/uts/common -I$(pwd)/build -I$(pwd)/libdtrace -DARCH_$arch" helper_device="dtrace/test-$$" # Pre-existing directories from earlier tests are just fine! # dtprobed will clean things up.
@@ -590,6 +590,7 @@ else fi fi export test_cppflags +export test_ldflags export test_libdir # Figure out if the preprocessor supports -fno-diagnostics-show-option: if it
test/expensive/locking/tst.DestructionDoubleUnlock.sh +6 -6
@@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. #
@@ -41,7 +41,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -59,17 +59,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -81,7 +81,7 @@ script() ./test & PID=$! disown %+ - if ! $dtrace -p $PID -lP test_prov$PID; then + if ! $dtrace $dt_flags -p $PID -lP test_prov$PID; then kill -9 $PID return 1 fi
test/expensive/locking/tst.exit-process-kill-races.sh +2 -2
@@ -89,10 +89,10 @@ while :; do esac if [[ $state != "POUND" ]]; then - result="$($dtrace -qc test/triggers/delaydie -n 'tick-1s { printf("timeout\n"); exit(0); }' -n 'syscall::exit_group:entry /pid == $target/ { printf("exit\n"); exit(0); }')" + result="$($dtrace $dt_flags -qc test/triggers/delaydie -n 'tick-1s { printf("timeout\n"); exit(0); }' -n 'syscall::exit_group:entry /pid == $target/ { printf("exit\n"); exit(0); }')" else set -e - $dtrace -qc test/triggers/delaydie -n 'tick-1s { printf("timeout\n"); exit(0); }' -n 'syscall::exit_group:entry /pid == $target/ { printf("exit\n"); exit(0); }' + $dtrace $dt_flags -qc test/triggers/delaydie -n 'tick-1s { printf("timeout\n"); exit(0); }' -n 'syscall::exit_group:entry /pid == $target/ { printf("exit\n"); exit(0); }' set +e fi
test/internals/headers/tst.header-endianness.sh +1 -1
@@ -26,5 +26,5 @@ for header in ${OLDDIRNAME}/include/dtrace/*.h; do #error $header: needs to include <sys/dtrace_types.h> #endif EOF - $CC -c $CFLAGS -o /dev/null test.c + $CC $test_cppflags -c $CFLAGS -o /dev/null test.c done
test/unittest/actions/symmod/tst.symmod.sh +1 -1
@@ -21,7 +21,7 @@ NAM=$MOD'`'$NAM # run DTrace to test mod() and sym() # also test func(), but it is simply an alias for sym() -read MYMOD MYNAM MYFUN <<< `$dtrace -qn 'BEGIN {mod(0x'$ADD'); sym(0x'$ADD'); func(0x'$ADD'); exit(0) }'` +read MYMOD MYNAM MYFUN <<< `$dtrace $dt_flags -qn 'BEGIN {mod(0x'$ADD'); sym(0x'$ADD'); func(0x'$ADD'); exit(0) }'` if [ $? -ne 0 ]; then exit 1 fi
test/unittest/aggs/tst.aggmod_full2.sh +4 -4
@@ -124,25 +124,25 @@ EOF # build # ================================================== -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1 fi -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} prov.o test.o +${CC} ${test_ldflags} ${CFLAGS} prov.o test.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
test/unittest/aggs/tst.aggpercpu.sh +1 -1
@@ -17,7 +17,7 @@ cd $DIRNAME # forcing DTrace to aggregate results over all CPUs. # -$dtrace -xaggpercpu -qn ' +$dtrace $dt_flags -xaggpercpu -qn ' profile-600ms { printf("cpu %d\n", cpu);
test/unittest/aggs/tst.multicpus.sh +1 -1
@@ -17,7 +17,7 @@ cd $DIRNAME # forcing DTrace to aggregate results over all CPUs. # -$dtrace -qn ' +$dtrace $dt_flags -qn ' profile-600ms { printf("cpu %d\n", cpu);
test/unittest/arrays/tst.uregsarray-check.sh +5 -5
@@ -22,7 +22,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -46,17 +46,17 @@ int main(int c, char **v) { } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -64,7 +64,7 @@ fi # run DTrace -$dtrace -c ./test -qn ' +$dtrace $dt_flags -c ./test -qn ' test_prov$target::: { printf("DTrace has PC %x and SP %x\n", uregs[R_PC], uregs[R_SP]);
test/unittest/builtinvar/tst.errno3.sh +1 -1
@@ -35,7 +35,7 @@ int main(int c, char **v) { } EOF -$CC main.c +$CC $test_cppflags main.c if [ $? -ne 0 ]; then echo compilation failed exit 1
test/unittest/cpc/err.cpcvscpustatpart1.sh +1 -1
@@ -17,7 +17,7 @@ script() { - $dtrace -o $dtraceout -s /dev/stdin <<EOF + $dtrace $dt_flags -o $dtraceout -s /dev/stdin <<EOF #pragma D option bufsize=128k cpc:::PAPI_tot_ins-all-10000
test/unittest/cpc/err.cpcvscpustatpart2.sh +1 -1
@@ -17,7 +17,7 @@ script() { - $dtrace -s /dev/stdin <<EOF + $dtrace $dt_flags -s /dev/stdin <<EOF #pragma D option bufsize=128k BEGIN
test/unittest/cpc/err.cputrackfailtostart.sh +1 -1
@@ -16,7 +16,7 @@ script() { - $dtrace -o $dtraceout -s /dev/stdin <<EOF + $dtrace $dt_flags -o $dtraceout -s /dev/stdin <<EOF #pragma D option bufsize=128k cpc:::PAPI_tot_ins-all-10000
test/unittest/cpc/err.cputrackterminates.sh +1 -1
@@ -16,7 +16,7 @@ script() { - $dtrace -s /dev/stdin <<EOF + $dtrace $dt_flags -s /dev/stdin <<EOF #pragma D option bufsize=128k cpc:::PAPI_tot_ins-all-10000
test/unittest/cpc/tst.platformevent.sh +1 -1
@@ -38,7 +38,7 @@ EOF script() { - $dtrace -s /dev/stdin << EOD + $dtrace $dt_flags -s /dev/stdin << EOD #pragma D option quiet #pragma D option bufsize=128k
test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh +6 -6
@@ -33,7 +33,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -51,17 +51,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -69,11 +69,11 @@ fi script() { - $dtrace -c ./test -lvn 'test_prov$target:::go' + $dtrace $dt_flags -c ./test -lvn 'test_prov$target:::go' ./test & PID=$! disown %+ - $dtrace -p $PID -lvn 'test_prov$target:::go' + $dtrace $dt_flags -p $PID -lvn 'test_prov$target:::go' kill -9 $PID }
test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh +8 -8
@@ -35,7 +35,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -53,17 +53,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -71,13 +71,13 @@ fi script() { - $dtrace -c ./test -lf main - $dtrace -c ./test -lf 'main*' + $dtrace $dt_flags -c ./test -lf main + $dtrace $dt_flags -c ./test -lf 'main*' ./test & PID=$! disown %+ - $dtrace -p $PID -lf main - $dtrace -p $PID -lf 'main*' + $dtrace $dt_flags -p $PID -lf main + $dtrace $dt_flags -p $PID -lf 'main*' kill -9 $PID }
test/unittest/dtrace-util/tst.ListProbesModuleSDT.sh +1 -1
@@ -24,7 +24,7 @@ fi dtrace=$1 -$dtrace -lm dt_test && $dtrace -lm 'dt_t*' +$dtrace $dt_flags -lm dt_test && $dtrace $dt_flags -lm 'dt_t*' status=$? exit $status
test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh +6 -6
@@ -35,7 +35,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -58,7 +58,7 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1
@@ -71,13 +71,13 @@ fi script() { - $dtrace -c ./test -lm test - $dtrace -c ./test -lm 'tes*' + $dtrace $dt_flags -c ./test -lm test + $dtrace $dt_flags -c ./test -lm 'tes*' ./test & PID=$! disown %+ - $dtrace -p $PID -lm test - $dtrace -p $PID -lm 'tes*' + $dtrace $dt_flags -p $PID -lm test + $dtrace $dt_flags -p $PID -lm 'tes*' kill -9 $PID }
test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh +8 -8
@@ -35,7 +35,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -53,17 +53,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -71,13 +71,13 @@ fi script() { - $dtrace -c ./test -ln 'test_prov*:::go' - $dtrace -c ./test -ln 'test_prov*:::g*' + $dtrace $dt_flags -c ./test -ln 'test_prov*:::go' + $dtrace $dt_flags -c ./test -ln 'test_prov*:::g*' ./test & PID=$! disown %+ - $dtrace -p $PID -ln 'test_prov*:::go' - $dtrace -p $PID -ln 'test_prov*:::g*' + $dtrace $dt_flags -p $PID -ln 'test_prov*:::go' + $dtrace $dt_flags -p $PID -ln 'test_prov*:::g*' kill -9 $PID }
test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh +7 -7
@@ -35,7 +35,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -53,17 +53,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -71,12 +71,12 @@ fi script() { - $dtrace -c ./test -lP 'test*' + $dtrace $dt_flags -c ./test -lP 'test*' ./test & PID=$! disown %+ - $dtrace -p $PID -lP test_prov$PID - $dtrace -p $PID -lP 'test*' + $dtrace $dt_flags -p $PID -lP test_prov$PID + $dtrace $dt_flags -p $PID -lP 'test*' kill -9 $PID }
test/unittest/dtrace-util/tst.ProcInvalid.sh +1 -1
@@ -22,4 +22,4 @@ fi dtrace=$1 -$dtrace -p 484837947 -n 'BEGIN { exit(0); }' || true +$dtrace $dt_flags -p 484837947 -n 'BEGIN { exit(0); }' || true
test/unittest/fbtprovider/err.D_ARGS_IDX.void-void.x +1 -1
@@ -1,7 +1,7 @@ #!/bin/bash # Skip test if FBT probes do not provide argument datatype info. -types=`$dtrace -lvn fbt::oops_enter:return | gawk '/^[ ]*args\[/ { $1 = ""; print }' | sort -u` +types=`$dtrace $dt_flags -lvn fbt::oops_enter:return | gawk '/^[ ]*args\[/ { $1 = ""; print }' | sort -u` if [[ -z "$types" ]]; then echo "FBT probes without args[] type info"
test/unittest/fbtprovider/err.D_ARGS_IDX.void.x +1 -1
@@ -1,7 +1,7 @@ #!/bin/bash # Skip test if FBT probes do not provide argument datatype info. -types=`$dtrace -lvn fbt::exit_creds:return | gawk '/^[ ]*args\[/ { $1 = ""; print }' | sort -u` +types=`$dtrace $dt_flags -lvn fbt::exit_creds:return | gawk '/^[ ]*args\[/ { $1 = ""; print }' | sort -u` if [[ -z "$types" ]]; then echo "FBT probes without args[] type info"
test/unittest/ip/tst.ipv4remotetcp.sh +1 -1
@@ -69,7 +69,7 @@ cat > $tmpdir/tst.ipv4remotetcp.test.pl <<-EOPERL } EOPERL -$dtrace -c "/usr/bin/perl $tmpdir/tst.ipv4remotetcp.test.pl" -qs /dev/stdin <<EODTRACE +$dtrace $dt_flags -c "/usr/bin/perl $tmpdir/tst.ipv4remotetcp.test.pl" -qs /dev/stdin <<EODTRACE BEGIN { send = receive = 0;
test/unittest/misc/err.lockmem-pragma.sh +1 -1
@@ -9,7 +9,7 @@ dtrace=$1 -$dtrace -qs /dev/stdin << EOF +$dtrace $dt_flags -qs /dev/stdin << EOF #pragma D option lockmem=1 BEGIN
test/unittest/misc/tst.include.sh +2 -2
@@ -32,8 +32,8 @@ void main() {} EOF - if $CC $CFLAGS -o $cofile $cfile >/dev/null 2>&1; then - $dtrace -xerrtags -C -s /dev/stdin \ + if $CC $test_cppflags $CFLAGS -o $cofile $cfile >/dev/null 2>&1; then + $dtrace $dt_flags -xerrtags -C -s /dev/stdin \ >/dev/null 2>$errfile <<EOF #include <sys/$file> BEGIN
test/unittest/misc/tst.lockmem-cmdline.sh +1 -1
@@ -12,7 +12,7 @@ dtrace=$1 for val in 1 268435456 unlimited; do ulimit -l $val - $dtrace -qn 'BEGIN { @ = avg(1234); exit(0); }' + $dtrace $dt_flags -qn 'BEGIN { @ = avg(1234); exit(0); }' echo $? done
test/unittest/misc/tst.lockmem-envvar.sh +1 -1
@@ -12,7 +12,7 @@ dtrace=$1 ulimit -l 1 for val in 16 1K 268435456K 262144M 256G unlimited; do - DTRACE_OPT_LOCKMEM=$val $dtrace -qn 'BEGIN { @ = avg(1234); exit(0); }' + DTRACE_OPT_LOCKMEM=$val $dtrace $dt_flags -qn 'BEGIN { @ = avg(1234); exit(0); }' echo $? done
test/unittest/misc/tst.lockmem-x.sh +1 -1
@@ -12,7 +12,7 @@ dtrace=$1 ulimit -l 1 for val in 16 1K 268435456K 262144M 256G unlimited; do - $dtrace -xlockmem=$val -qn 'BEGIN { @ = avg(1234); exit(0); }' + $dtrace $dt_flags -xlockmem=$val -qn 'BEGIN { @ = avg(1234); exit(0); }' echo $? done
test/unittest/misc/tst.parser1.sh +1 -1
@@ -17,7 +17,7 @@ chkfile=$tmpfile.check # Run DTrace. -$dtrace -xtree=1 -e -n ' +$dtrace $dt_flags -xtree=1 -e -n ' BEGIN { x = 1234;
test/unittest/misc/tst.parser2.sh +1 -1
@@ -17,7 +17,7 @@ chkfile=$tmpfile.check # Run DTrace. -$dtrace -xtree=2 -e -n ' +$dtrace $dt_flags -xtree=2 -e -n ' BEGIN { x = 1234;
test/unittest/misc/tst.parser4.sh +1 -1
@@ -17,7 +17,7 @@ chkfile=$tmpfile.check # Run DTrace. -$dtrace -xtree=4 -e -n ' +$dtrace $dt_flags -xtree=4 -e -n ' BEGIN { x = 1234;
test/unittest/options/tst.bpflog-cmdline.sh +1 -1
@@ -8,6 +8,6 @@ dtrace=$1 -$dtrace -xbpflog -qn 'BEGIN { exit(0); }' |& grep '^BPF: ' > /dev/null +$dtrace $dt_flags -xbpflog -qn 'BEGIN { exit(0); }' |& grep '^BPF: ' > /dev/null exit $?
test/unittest/options/tst.bpflog-pragma.sh +1 -1
@@ -8,7 +8,7 @@ dtrace=$1 -$dtrace -qs /dev/stdin << EOT |& grep '^BPF: ' > /dev/null +$dtrace $dt_flags -qs /dev/stdin << EOT |& grep '^BPF: ' > /dev/null #pragma D option bpflog BEGIN
test/unittest/options/tst.bpflogsize-pragma.sh +1 -1
@@ -67,7 +67,7 @@ cursiz=$((16 * 1024 * 1024 - 1)) # default size from dt_bpf_load_prog() while [ $cursiz -lt $((1024 * 1024 * 1024)) ]; do # dtrace should not pass - $dtrace -qs D.d >& tmp.out + $dtrace $dt_flags -qs D.d >& tmp.out if [ $? -eq 0 ]; then echo unexpected pass dump_files
test/unittest/options/tst.iregs.sh +1 -1
@@ -13,7 +13,7 @@ dtrace=$1 # once n becomes too small, there are insufficient registers for n in 8 7 6 5 4 3; do - $dtrace -xiregs=$n -qn 'BEGIN { + $dtrace $dt_flags -xiregs=$n -qn 'BEGIN { a = b = c = d = e = f = g = h = i = j = k = l = 1; trace(a + b * (c + d * (e + f * (g + h * (i + j * (k + l)))))); exit(0);
test/unittest/options/tst.linktype.sh +3 -3
@@ -24,7 +24,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -42,7 +42,7 @@ int main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${test_ldflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1
@@ -51,7 +51,7 @@ fi # link with different -xlinktype values function mytest() { - $dtrace -G $1 -s prov.d test.o + $dtrace $dt_flags -G $1 -s prov.d test.o # report whether the link succeeded if [ $? -ne 0 ]; then
test/unittest/options/tst.modpath.x +1 -1
@@ -9,7 +9,7 @@ fi # Skip test if CTF info is not used for rawtp args[] types. (If all rawtp # args[] types are "uint64_t", this is a symptom of our using the back-up # trial-and-error method.) -types=`$dtrace -lvP rawtp | gawk '/^[ ]*args/ { $1 = ""; print }' | sort -u` +types=`$dtrace $dt_flags -lvP rawtp | gawk '/^[ ]*args/ { $1 = ""; print }' | sort -u` if [ "$types" == " uint64_t" ]; then echo "not using CTF for rawtp args types" exit 2
test/unittest/options/tst.strip.sh +4 -4
@@ -22,7 +22,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -40,7 +40,7 @@ int main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${test_ldflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1
@@ -50,14 +50,14 @@ fi objdump="objdump --full-contents --section=.SUNW_dof prov.o" -$dtrace -G -xstrip -s prov.d test.o +$dtrace $dt_flags -G -xstrip -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF (stripped)" >& 2 exit 1 fi $objdump >& out.stripped.txt -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1
test/unittest/options/tst.switchrate.sh +1 -1
@@ -20,7 +20,7 @@ for nexpect in 1 16; do # Run the "instantaneous" D script with the prescribed switchrate. # Time it. Round to the nearest number of seconds with int(t+0.5). nactual=`/usr/bin/time -f "%e" \ - $dtrace -xswitchrate=${nexpect}sec -qn 'BEGIN { exit(0) }' \ + $dtrace $dt_flags -xswitchrate=${nexpect}sec -qn 'BEGIN { exit(0) }' \ |& gawk 'NF != 0 {print int($1 + 0.5)}'` # Check the actual number of seconds to the expected value.
test/unittest/options/tst.tregs.sh +1 -1
@@ -9,6 +9,6 @@ dtrace=$1 for x in 3 5 9 11; do - $dtrace -xtregs=$x -qn 'BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }' + $dtrace $dt_flags -xtregs=$x -qn 'BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }' echo "tregs $x gives $?" done
test/unittest/pid/tst.offsets.sh +1 -1
@@ -65,7 +65,7 @@ fi # We are testing a glob in the pid$target:a.out:loopfunc: probe name. # -$dtrace -xstrsize=16 -qn ' +$dtrace $dt_flags -xstrsize=16 -qn ' pid$target:a.out:coldfunc:entry, pid$target:a.out:loopfunc:, pid$target:a.out:leaffunc:entry
test/unittest/pid/tst.provregex3.sh +2 -2
@@ -29,10 +29,10 @@ main.o: main.c prov.h cc $test_cppflags -c main.c prov.h: prov.d - $dtrace -h -s prov.d + $dtrace $dt_flags -h -s prov.d prov.o: prov.d main.o - $dtrace -G -64 -s prov.d main.o + $dtrace $dt_flags -G -64 -s prov.d main.o EOF cat > $DIR/prov.d <<EOF
test/unittest/pid/tst.provregex4.sh +3 -3
@@ -31,10 +31,10 @@ main.o: main.c prov.h cc $test_cppflags -c main.c prov.h: prov.d - $dtrace -h -s prov.d + $dtrace $dt_flags -h -s prov.d provmain.o: prov.d main.o - $dtrace -G -o provmain.o -s prov.d main.o + $dtrace $dt_flags -G -o provmain.o -s prov.d main.o altlib.so: altlib.o provalt.o cc $test_cppflags -z defs --shared -o altlib.so altlib.o provalt.o
@@ -43,7 +43,7 @@ altlib.o: altlib.c prov.h cc $test_cppflags -c altlib.c provalt.o: prov.d altlib.o - $dtrace -G -o provalt.o -s prov.d altlib.o + $dtrace $dt_flags -G -o provalt.o -s prov.d altlib.o EOF cat > $DIR/prov.d <<EOF
test/unittest/predicates/tst.predcache.sh +2 -2
@@ -78,7 +78,7 @@ unload() script1() { - $dtrace -s /dev/stdin <<EOF + $dtrace $dt_flags -s /dev/stdin <<EOF syscall:::entry /pid != $ppid/ {
@@ -95,7 +95,7 @@ EOF script2() { - $dtrace -s /dev/stdin <<EOF + $dtrace $dt_flags -s /dev/stdin <<EOF #pragma D option statusrate=1ms
test/unittest/printf/tst.wide-bug30404549.sh +1 -1
@@ -17,7 +17,7 @@ fi dtrace=$1 # abbreviate output to a simple statement of length. raw output is big (29M) -$dtrace -qs /dev/stdin << EOF | gawk '{ print length($0); }' +$dtrace $dt_flags -qs /dev/stdin << EOF | gawk '{ print length($0); }' BEGIN { printf("%10000000d\n", 1);
test/unittest/printf/tst.wide.sh +1 -1
@@ -17,7 +17,7 @@ fi dtrace=$1 # abbreviate output, where the raw output of prints is big (29M) -$dtrace -qs /dev/stdin << EOF | gawk '{ +$dtrace $dt_flags -qs /dev/stdin << EOF | gawk '{ if (match($0, " +")) printf("%s{%d* }%s\n", substr($0, 1, RSTART - 1), RLENGTH, substr($0, RSTART + RLENGTH));
test/unittest/providers/rawtp/err.lockmem-too-low.sh +2 -2
@@ -23,11 +23,11 @@ dtrace=$1 # Determine whether the system respects setting the lockmem limit as root. # Some systems ignore lowering the limit, which means we cannot make it fail. # In that case, we report XFAIL. -if $dtrace -xlockmem=1 -n 'BEGIN { exit(0); }' &> /dev/null; then +if $dtrace $dt_flags -xlockmem=1 -n 'BEGIN { exit(0); }' &> /dev/null; then exit 67 fi -$dtrace -xlockmem=1 -lvn rawtp:::sched_process_fork |& \ +$dtrace $dt_flags -xlockmem=1 -lvn rawtp:::sched_process_fork |& \ gawk 'BEGIN { err = 0; # lockmem error messages CTF = 0; # arg types indicating CTF info
test/unittest/syscall/tst.openret.sh +1 -1
@@ -6,7 +6,7 @@ # http://oss.oracle.com/licenses/upl. script() { - $dtrace -c 'cat shajirosan' -qs /dev/stdin <<EOF + $dtrace $dt_flags -c 'cat shajirosan' -qs /dev/stdin <<EOF syscall::open*:entry /pid == \$target/ {
test/unittest/usdt/tst.allargs.sh +4 -3
@@ -17,6 +17,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="-std=gnu89 $test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-allargs.$$.$RANDOM" mkdir -p $DIRNAME
@@ -73,18 +74,18 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1 fi -$dtrace -c ./test -qs /dev/stdin <<EOF +$dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target:::zero { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.andpid.ksh +1 -1
@@ -11,7 +11,7 @@ fi dtrace=$1 -$dtrace -c date -s /dev/stdin <<EOF +$dtrace $dt_flags -c date -s /dev/stdin <<EOF plockstat\$target::mutex_lock_impl:, pid\$target::mutex_lock_impl: {}
test/unittest/usdt/tst.badguess.sh +5 -4
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-badguess.$$.$RANDOM" mkdir -p $DIRNAME
@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -48,13 +49,13 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c 64-bit" >& 2 exit 1 fi -$CC $CFLAGS -m32 -c -o test32.o test.c +$CC $LDFLAGS -m32 -c -o test32.o test.c if [ $? -ne 0 ]; then echo "failed to compile test.c 32-bit" >& 2 exit 1 fi -$dtrace -G -s prov.d test32.o test64.o +$dtrace $dt_flags -G -s prov.d test32.o test64.o if [ $? -eq 0 ]; then echo "DOF generation failed to generate a warning" >& 2 exit 1
test/unittest/usdt/tst.corruptenv.sh +4 -4
@@ -29,16 +29,16 @@ cat > Makefile <<EOF all: main main: main.o prov.o - \$(CC) -o main main.o prov.o + \$(CC) \$(test_ldflags) -o main main.o prov.o main.o: main.c prov.h - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c prov.h: prov.d - $dtrace -h -s prov.d + $dtrace $dt_flags -h -s prov.d prov.o: prov.d main.o - $dtrace -G -s prov.d main.o + $dtrace $dt_flags -G -s prov.d main.o EOF cat > prov.d <<EOF
test/unittest/usdt/tst.dlclose1.sh +10 -10
@@ -44,30 +44,30 @@ cat > Makefile <<EOF all: main livelib.so deadlib.so main: main.o prov.o - \$(CC) -o main main.o -ldl + \$(CC) \$(test_ldflags) -o main main.o -ldl main.o: main.c - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c livelib.so: livelib.o prov.o - \$(CC) -shared -o livelib.so livelib.o prov.o -lc + \$(CC) \$(test_ldflags) -shared -o livelib.so livelib.o prov.o -lc livelib.o: livelib.c prov.h - \$(CC) -c livelib.c + \$(CC) \$(test_cppflags) -c livelib.c prov.o: livelib.o prov.d - $dtrace -G -s prov.d livelib.o + $dtrace \$(dt_flags) -G -s prov.d livelib.o prov.h: prov.d - $dtrace -h -s prov.d + $dtrace \$(dt_flags) -h -s prov.d deadlib.so: deadlib.o - \$(CC) -shared -o deadlib.so deadlib.o -lc + \$(CC) \$(test_ldflags) -shared -o deadlib.so deadlib.o -lc deadlib.o: deadlib.c - \$(CC) -c deadlib.c + \$(CC) \$(test_cppflags) -c deadlib.c clean: rm -f main.o livelib.o prov.o prov.h deadlib.o
@@ -203,11 +203,11 @@ pid=$! echo started pid $pid mywait 6 "started" myfile.txt # wait for process to start -$dtrace -lP test_prov$pid # check USDT probes +$dtrace $dt_flags -lP test_prov$pid # check USDT probes kill -s USR1 $pid # signal process mywait 6 "dlclosed" myfile.txt # wait for process to dlclose -$dtrace -lP test_prov$pid # check USDT probes +$dtrace $dt_flags -lP test_prov$pid # check USDT probes kill -s KILL $pid # kill process exit 0
test/unittest/usdt/tst.dlclose2.sh +9 -9
@@ -26,30 +26,30 @@ cat > Makefile <<EOF all: main livelib.so deadlib.so main: main.o prov.o - \$(CC) -o main main.o -ldl + \$(CC) \$(test_ldflags) -o main main.o -ldl main.o: main.c - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c livelib.so: livelib.o prov.o - \$(CC) -shared -o livelib.so livelib.o prov.o -lc + \$(CC) \$(test_ldflags) -shared -o livelib.so livelib.o prov.o -lc livelib.o: livelib.c prov.h - \$(CC) -c livelib.c + \$(CC) \$(test_cppflags) -c livelib.c prov.o: livelib.o prov.d - $dtrace -G -s prov.d livelib.o + $dtrace \$(dt_flags) -G -s prov.d livelib.o prov.h: prov.d - $dtrace -h -s prov.d + $dtrace \$(dt_flags) -h -s prov.d deadlib.so: deadlib.o - \$(CC) -shared -o deadlib.so deadlib.o -lc + \$(CC) \$(test_ldflags) -shared -o deadlib.so deadlib.o -lc deadlib.o: deadlib.c - \$(CC) -c deadlib.c + \$(CC) \$(test_cppflags) -c deadlib.c clean: rm -f main.o livelib.o prov.o prov.h deadlib.o
@@ -128,7 +128,7 @@ if [ $? -ne 0 ]; then fi script() { - $dtrace -c ./main -Zqs /dev/stdin <<EOF + $dtrace $dt_flags -c ./main -Zqs /dev/stdin <<EOF test_prov*::: { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.dlclose3.sh +9 -9
@@ -32,28 +32,28 @@ cat > Makefile <<EOF all: main livelib.so deadlib.so main: main.o prov.o - \$(CC) -o main main.o -ldl + \$(CC) \$(test_ldflags) -o main main.o -ldl main.o: main.c - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c livelib.so: livelib.o prov.o - \$(CC) -shared -o livelib.so livelib.o prov.o -lc + \$(CC) \$(test_ldflags) -shared -o livelib.so livelib.o prov.o -lc livelib.o: livelib.c prov.h - \$(CC) -c livelib.c + \$(CC) \$(test_cppflags) -c livelib.c prov.o: livelib.o prov.d - $dtrace -G -s prov.d livelib.o + $dtrace \$(dt_flags) -G -s prov.d livelib.o prov.h: prov.d - $dtrace -h -s prov.d + $dtrace \$(dt_flags) -h -s prov.d deadlib.so: deadlib.o - \$(CC) -shared -o deadlib.so deadlib.o -lc + \$(CC) \$(test_ldflags) -shared -o deadlib.so deadlib.o -lc deadlib.o: deadlib.c - \$(CC) -c deadlib.c + \$(CC) \$(test_cppflags) -c deadlib.c clean: rm -f main.o livelib.o prov.o prov.h deadlib.o
@@ -122,7 +122,7 @@ if [ $? -ne 0 ]; then fi script() { - $dtrace -c ./main -s /dev/stdin <<EOF + $dtrace $dt_flags -c ./main -s /dev/stdin <<EOF pid\$target:a.out:foo:entry { gotit = 1;
test/unittest/usdt/tst.dlclose4.sh +7 -7
@@ -30,22 +30,22 @@ cat > Makefile <<EOF all: main livelib.so main: main.o prov.o - \$(CC) -o main main.o -ldl + \$(CC) \$(test_ldflags) -o main main.o -ldl main.o: main.c - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c livelib.so: livelib.o prov.o - \$(CC) -shared -o livelib.so livelib.o prov.o -lc + \$(CC) \$(test_ldflags) -shared -o livelib.so livelib.o prov.o -lc livelib.o: livelib.c prov.h - \$(CC) -c livelib.c + \$(CC) \$(test_cppflags) -c livelib.c prov.o: livelib.o prov.d - $dtrace -G -s prov.d livelib.o + $dtrace \$(dt_flags) -G -s prov.d livelib.o prov.h: prov.d - $dtrace -h -s prov.d + $dtrace \$(dt_flags) -h -s prov.d clean: rm -f main.o livelib.o prov.o prov.h
@@ -141,7 +141,7 @@ fi # ls /run/dtrace/stash/dof-pid/$pid/*/parsed/test_prov:livelib.so:go:go function check_USDT_probes() { - $dtrace -lP test_prov$pid |& awk ' + $dtrace $dt_flags -lP test_prov$pid |& awk ' /ID *PROVIDER *MODULE *FUNCTION *NAME/ { next } /test_prov'$pid' *livelib\.so *go *go/ { exit(0) } /No probe matches description/ { exit(1) }'
test/unittest/usdt/tst.eliminate.sh +5 -4
@@ -17,7 +17,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-eliminate.$$.$RANDOM" mkdir -p $DIRNAME
@@ -29,7 +30,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -59,12 +60,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
test/unittest/usdt/tst.enable_pid.sh +2 -2
@@ -115,7 +115,7 @@ EOF # Build the test program. # -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >&2 exit 1
@@ -125,7 +125,7 @@ if [ $? -ne 0 ]; then echo "failed to compile test" >&2 exit 1 fi -$dtrace -G -64 -s prov.d main.o +$dtrace $dt_flags -G -64 -s prov.d main.o if [ $? -ne 0 ]; then echo "failed to create DOF" >&2 exit 1
test/unittest/usdt/tst.enabled.sh +6 -5
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-enabled.$$.$RANDOM" mkdir -p $DIRNAME
@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -48,12 +49,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -61,7 +62,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.enabled2.sh +6 -5
@@ -16,7 +16,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-enabled2.$$.$RANDOM" mkdir -p $DIRNAME
@@ -28,7 +29,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -62,12 +63,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -77,7 +78,7 @@ script() { ./test - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { }
test/unittest/usdt/tst.entryreturn.sh +4 -3
@@ -15,6 +15,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-entryreturn.$$.$RANDOM" mkdir -p $DIRNAME
@@ -59,12 +60,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -72,7 +73,7 @@ fi script() { - $dtrace -wqZFs /dev/stdin <<EOF + $dtrace $dt_flags -wqZFs /dev/stdin <<EOF BEGIN { system("$DIRNAME/test");
test/unittest/usdt/tst.exec-dof-replacement.sh +6 -5
@@ -15,7 +15,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-exec-dof-replacement.$$.$RANDOM" mkdir -p $DIRNAME
@@ -33,7 +34,7 @@ provider test_prov { }; EOF -if ! { $dtrace -h -s prov1.d && dtrace -h -s prov2.d; } then +if ! { $dtrace $dt_flags -h -s prov1.d && dtrace -h -s prov2.d; } then echo "failed to generate header files" >&2 exit 1 fi
@@ -70,11 +71,11 @@ if ! { ${CC} ${CFLAGS} -c test1.c && ${CC} ${CFLAGS} -c test2.c; } then echo "failed to compile test programs" >&2 exit 1 fi -if ! { $dtrace -G -s prov1.d test1.o && $dtrace -G -s prov2.d test2.o; } then +if ! { $dtrace $dt_flags -G -s prov1.d test1.o && $dtrace $dt_flags -G -s prov2.d test2.o; } then echo "failed to create DOF" >& 2 exit 1 fi -if ! { ${CC} ${CFLAGS} -o test1 test1.o prov1.o && ${CC} ${CFLAGS} -o test2 test2.o prov2.o; } then +if ! { ${CC} ${LDFLAGS} -o test1 test1.o prov1.o && ${CC} ${LDFLAGS} -o test2 test2.o prov2.o; } then echo "failed to link final executables" >& 2 exit 1 fi
@@ -89,7 +90,7 @@ PROC=$! while [[ -d /proc/$PROC ]] && [[ "$(readlink /proc/$PROC/exe)" =~ test1$ ]]; do sleep 1 done -$dtrace -p $PROC '-Ptest_prov$target' -l +$dtrace $dt_flags -p $PROC '-Ptest_prov$target' -l status2=$? kill $PROC
test/unittest/usdt/tst.execstack.sh +5 -4
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" OBJDUMP=/usr/bin/objdump READELF=/usr/bin/readelf
@@ -29,7 +30,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -54,7 +55,7 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1
@@ -64,7 +65,7 @@ if [ $? -eq 0 ]; then echo "EXEC flag on .note.GNU-stack" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${lDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
test/unittest/usdt/tst.fork.sh +6 -5
@@ -13,7 +13,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-fork.$$.$RANDOM" mkdir -p $DIRNAME
@@ -25,7 +26,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -58,19 +59,19 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1 fi script() { - $dtrace -c ./test -Zqs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -Zqs /dev/stdin <<EOF test_prov*::: { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.forker.sh +1 -1
@@ -25,7 +25,7 @@ id=$! disown %+ while kill -0 $id >/dev/null 2>&1; do - $dtrace -p $id -s /dev/stdin <<-EOF + $dtrace $dt_flags -p $id -s /dev/stdin <<-EOF forker*:::fire /i++ == 4/ {
test/unittest/usdt/tst.guess32.sh +6 -5
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-guess32.$$.$RANDOM" mkdir -p $DIRNAME
@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -48,12 +49,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -m32 -o test test.o prov.o +${CC} ${LDFLAGS} -m32 -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -61,7 +62,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.guess64.sh +6 -5
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-guess64.$$.$RANDOM" mkdir -p $DIRNAME
@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -48,12 +49,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -61,7 +62,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.header.sh +5 -4
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-header.$$.$RANDOM" mkdir -p $DIRNAME
@@ -27,7 +28,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -52,12 +53,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
test/unittest/usdt/tst.lingering.sh +6 -5
@@ -15,7 +15,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-lingering.$$.$RANDOM" mkdir -p $DIRNAME
@@ -28,7 +29,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -57,12 +58,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -74,7 +75,7 @@ TRIGPID=$! trap 'kill -9 $TRIGPID' ERR EXIT script() { - $dtrace -p $TRIGPID -qs /dev/stdin <<EOF + $dtrace $dt_flags -p $TRIGPID -qs /dev/stdin <<EOF test_prov\$target:::$1 { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.link-idempotence.sh +6 -5
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-link-idempotence.$$.$RANDOM" mkdir -p $DIRNAME
@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -48,13 +49,13 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o -$dtrace -G -s prov.d test.o +${CC} ${LDFLAGS} -o test test.o prov.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to regenerate DOF" >& 2 exit 1
test/unittest/usdt/tst.linkpriv.sh +3 -2
@@ -13,6 +13,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="-std=gnu99 $test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-linkpriv.$$.$RANDOM" mkdir -p $DIRNAME
@@ -49,12 +50,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
test/unittest/usdt/tst.linkunpriv.sh +1 -1
@@ -53,7 +53,7 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1
test/unittest/usdt/tst.manyprobes.sh +4 -3
@@ -13,6 +13,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-manyprobes.$$.$RANDOM" mkdir -p $DIRNAME cd $DIRNAME
@@ -47,12 +48,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s manyprobes.d test.o +$dtrace $dt_flags -G -s manyprobes.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o manyprobes.o +${CC} ${LDFLAGS} -o test test.o manyprobes.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -60,7 +61,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF manyprobes\$target:::test1, manyprobes\$target:::test750, manyprobes\$target:::test1999 { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.manyprocs.sh +5 -4
@@ -15,7 +15,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-manyprocs.$$.$RANDOM" mkdir -p $DIRNAME
@@ -27,7 +28,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -63,12 +64,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
test/unittest/usdt/tst.multiple.sh +6 -5
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-multiple.$$.$RANDOM" mkdir -p $DIRNAME
@@ -26,7 +27,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -58,12 +59,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -74,7 +75,7 @@ script() { # rtld activity monitoring from triggering repeated # probe scans (checking for problems doing one-off scans of # already-running processes while probing multiple probes). - ./test & { WAIT=$!; sleep 1; $dtrace -qs /dev/stdin $WAIT <<EOF; } + ./test & { WAIT=$!; sleep 1; $dtrace $dt_flags -qs /dev/stdin $WAIT <<EOF; } test_prov\$1:::go { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.multitrace.sh +6 -5
@@ -15,7 +15,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-multitrace.$$.$RANDOM" mkdir -p $DIRNAME
@@ -28,7 +29,7 @@ provider test_multitrace { }; EOF -$dtrace -h -s multitrace.d +$dtrace $dt_flags -h -s multitrace.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -60,19 +61,19 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s multitrace.d test.o +$dtrace $dt_flags -G -s multitrace.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o multitrace.o +${CC} ${LDFLAGS} -o test test.o multitrace.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1 fi script() { - exec $dtrace -qws /dev/stdin $1 $2 $3 <<'EOF' + exec $dtrace $dt_flags -qws /dev/stdin $1 $2 $3 <<'EOF' int fired[pid_t]; int exited[pid_t];
test/unittest/usdt/tst.nusdtprobes.sh +4 -4
@@ -61,22 +61,22 @@ EOF # Build the trigger. -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >&2 exit 1 fi -cc $test_cppflags -c main.c +gcc $test_cppflags -c main.c if [ $? -ne 0 ]; then echo "failed to compile test" >&2 exit 1 fi -$dtrace -G -64 -s prov.d main.o +$dtrace $dt_flags -G -64 -s prov.d main.o if [ $? -ne 0 ]; then echo "failed to create DOF" >&2 exit 1 fi -cc $test_cppflags -o main main.o prov.o +gcc $test_ldflags -o main main.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >&2 exit 1
test/unittest/usdt/tst.onlyenabled.sh +5 -4
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-onlyenabled.$$.$RANDOM" mkdir -p $DIRNAME
@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -49,12 +50,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
test/unittest/usdt/tst.pie.sh +6 -5
@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS="-fno-inline -pie" +CFLAGS="-fno-inline -pie $test_cppflags" +LDFLAGS="-pie $test_ldflags" DIRNAME="$tmpdir/usdt-pie.$$.$RANDOM" mkdir -p $DIRNAME
@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -52,12 +53,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -65,7 +66,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.reeval.sh +4 -3
@@ -14,6 +14,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-reeval.$$.$RANDOM" mkdir -p $DIRNAME
@@ -40,12 +41,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -53,7 +54,7 @@ fi script() { - $dtrace -wZs /dev/stdin <<EOF + $dtrace $dt_flags -wZs /dev/stdin <<EOF BEGIN { system("$DIRNAME/test");
test/unittest/usdt/tst.static.sh +4 -3
@@ -13,6 +13,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-static.$$.$RANDOM" mkdir -p $DIRNAME
@@ -50,12 +51,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -63,7 +64,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.static2.sh +5 -4
@@ -17,6 +17,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-static2.$$.$RANDOM" mkdir -p $DIRNAME
@@ -54,18 +55,18 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create initial DOF" >& 2 exit 1 fi rm -f prov.o -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create final DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1
@@ -73,7 +74,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);
test/unittest/usdt/tst.user.sh +6 -5
@@ -14,7 +14,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-user.$$.$RANDOM" mkdir -p $DIRNAME
@@ -26,7 +27,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1
@@ -50,19 +51,19 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1 fi script() { - $dtrace -c 'ppriv -e -s A=basic ./test' -Zqs /dev/stdin <<EOF + $dtrace $dt_flags -c 'ppriv -e -s A=basic ./test' -Zqs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);
Signature · 1 line
2.46.0.278.g36e3a12567
Quoted 20 lines · Nick Alcock
The testsuite passes in a $dtrace environment variable: this must be an ELF executable because some tests use it in hashbang lines, so necessary flags are passed in in a $dt_flags variable which must be passed to every dtrace invocation. These flags are largely path adjustments (-I etc) pointing DTrace to the in-source-tree testsuite or the out-of-tree SDT headers and such things: as such, it's unfortunate that a great many invocations were missed and that those invocations were largely things like -G that actually *use* -I.
It also passes in a $test_cppflags variable which is meant to be used for C preprocessor invocations, but many tests which should use it don't use it, leading to the possibility (and, these days, the likelihood) of picking up SystemTap <
sys/sdt.h> instead, or simply a compilation error if an installed testsuite is run.This uncovers another bug: the -I flags passed in in all the above cases are relative paths, so they are wrong for any tests that cd, such as almost any test that does any compiles (which all cd into directories under the $tmpdir). Make them absolute.
Quoted 6 lines
runtest.shalso populates atest_ldflagscontaining -L arguments for libraries in the build tree, but this is never exported or used by any tests: pass that in too, and change linker invocations to use it instead.Signed-off-by Nick Alcock <[email protected]>
Quoted 2,444 lines
--- runtest.sh | 3 ++- .../locking/tst.DestructionDoubleUnlock.sh | 12 +++++------ .../locking/tst.exit-process-kill-races.sh | 4 ++-- .../headers/tst.header-endianness.sh | 2 +- test/unittest/actions/symmod/tst.symmod.sh | 2 +- test/unittest/aggs/tst.aggmod_full2.sh | 8 ++++---- test/unittest/aggs/tst.aggpercpu.sh | 2 +- test/unittest/aggs/tst.multicpus.sh | 2 +- test/unittest/arrays/tst.uregsarray-check.sh | 10 +++++----- test/unittest/builtinvar/tst.errno3.sh | 2 +- test/unittest/cpc/err.cpcvscpustatpart1.sh | 2 +- test/unittest/cpc/err.cpcvscpustatpart2.sh | 2 +- test/unittest/cpc/err.cputrackfailtostart.sh | 2 +- test/unittest/cpc/err.cputrackterminates.sh | 2 +- test/unittest/cpc/tst.platformevent.sh | 2 +- .../dtrace-util/tst.ListProbesArgsUSDT.sh | 12 +++++------ .../dtrace-util/tst.ListProbesFuncUSDT.sh | 16 +++++++-------- .../dtrace-util/tst.ListProbesModuleSDT.sh | 2 +- .../dtrace-util/tst.ListProbesModuleUSDT.sh | 12 +++++------ .../dtrace-util/tst.ListProbesNameUSDT.sh | 16 +++++++-------- .../dtrace-util/tst.ListProbesProviderUSDT.sh | 14 ++++++------- test/unittest/dtrace-util/tst.ProcInvalid.sh | 2 +- .../fbtprovider/err.D_ARGS_IDX.void-void.x | 2 +- .../fbtprovider/err.D_ARGS_IDX.void.x | 2 +- test/unittest/ip/tst.ipv4remotetcp.sh | 2 +- test/unittest/misc/err.lockmem-pragma.sh | 2 +- test/unittest/misc/tst.include.sh | 4 ++-- test/unittest/misc/tst.lockmem-cmdline.sh | 2 +- test/unittest/misc/tst.lockmem-envvar.sh | 2 +- test/unittest/misc/tst.lockmem-x.sh | 2 +- test/unittest/misc/tst.parser1.sh | 2 +- test/unittest/misc/tst.parser2.sh | 2 +- test/unittest/misc/tst.parser4.sh | 2 +- test/unittest/options/tst.bpflog-cmdline.sh | 2 +- test/unittest/options/tst.bpflog-pragma.sh | 2 +- .../unittest/options/tst.bpflogsize-pragma.sh | 2 +- test/unittest/options/tst.iregs.sh | 2 +- test/unittest/options/tst.linktype.sh | 6 +++--- test/unittest/options/tst.modpath.x | 2 +- test/unittest/options/tst.strip.sh | 8 ++++---- test/unittest/options/tst.switchrate.sh | 2 +- test/unittest/options/tst.tregs.sh | 2 +- test/unittest/pid/tst.offsets.sh | 2 +- test/unittest/pid/tst.provregex3.sh | 4 ++-- test/unittest/pid/tst.provregex4.sh | 6 +++--- test/unittest/predicates/tst.predcache.sh | 4 ++-- test/unittest/printf/tst.wide-bug30404549.sh | 2 +- test/unittest/printf/tst.wide.sh | 2 +- .../providers/rawtp/err.lockmem-too-low.sh | 4 ++-- test/unittest/syscall/tst.openret.sh | 2 +- test/unittest/usdt/tst.allargs.sh | 7 ++++--- test/unittest/usdt/tst.andpid.ksh | 2 +- test/unittest/usdt/tst.badguess.sh | 9 +++++---- test/unittest/usdt/tst.corruptenv.sh | 8 ++++---- test/unittest/usdt/tst.dlclose1.sh | 20 +++++++++---------- test/unittest/usdt/tst.dlclose2.sh | 18 ++++++++--------- test/unittest/usdt/tst.dlclose3.sh | 18 ++++++++--------- test/unittest/usdt/tst.dlclose4.sh | 14 ++++++------- test/unittest/usdt/tst.eliminate.sh | 9 +++++---- test/unittest/usdt/tst.enable_pid.sh | 4 ++-- test/unittest/usdt/tst.enabled.sh | 11 +++++----- test/unittest/usdt/tst.enabled2.sh | 11 +++++----- test/unittest/usdt/tst.entryreturn.sh | 7 ++++--- .../unittest/usdt/tst.exec-dof-replacement.sh | 11 +++++----- test/unittest/usdt/tst.execstack.sh | 9 +++++---- test/unittest/usdt/tst.fork.sh | 11 +++++----- test/unittest/usdt/tst.forker.sh | 2 +- test/unittest/usdt/tst.guess32.sh | 11 +++++----- test/unittest/usdt/tst.guess64.sh | 11 +++++----- test/unittest/usdt/tst.header.sh | 9 +++++---- test/unittest/usdt/tst.lingering.sh | 11 +++++----- test/unittest/usdt/tst.link-idempotence.sh | 11 +++++----- test/unittest/usdt/tst.linkpriv.sh | 5 +++-- test/unittest/usdt/tst.linkunpriv.sh | 2 +- test/unittest/usdt/tst.manyprobes.sh | 7 ++++--- test/unittest/usdt/tst.manyprocs.sh | 9 +++++---- test/unittest/usdt/tst.multiple.sh | 11 +++++----- test/unittest/usdt/tst.multitrace.sh | 11 +++++----- test/unittest/usdt/tst.nusdtprobes.sh | 8 ++++---- test/unittest/usdt/tst.onlyenabled.sh | 9 +++++---- test/unittest/usdt/tst.pie.sh | 11 +++++----- test/unittest/usdt/tst.reeval.sh | 7 ++++--- test/unittest/usdt/tst.static.sh | 7 ++++--- test/unittest/usdt/tst.static2.sh | 9 +++++---- test/unittest/usdt/tst.user.sh | 11 +++++----- 85 files changed, 283 insertions(+), 257 deletions(-)v2: one test dropped because it's now renamed and fixed up
(and otherwise modified) in the usdt typed-args series.runtest.sh +2
-1@@ -554,7 +554,7 @@ if [[ -z $USE_INSTALLED ]]; then dtrace="$(pwd)/build*/dtrace" test_libdir="$(pwd)/build/dlibs" test_ldflags="-L$(pwd)/build" - test_cppflags="-Iinclude -Iuts/common -Ibuild -Ilibdtrace -DARCH_$arch" + test_cppflags="-I$(pwd)/include -I$(pwd)/uts/common -I$(pwd)/build -I$(pwd)/libdtrace -DARCH_$arch" helper_device="dtrace/test-$$" # Pre-existing directories from earlier tests are just fine! # dtprobed will clean things up.@@ -590,6 +590,7 @@ else fi fi export test_cppflags +export test_ldflags export test_libdir # Figure out if the preprocessor supports -fno-diagnostics-show-option: if ittest/expensive/locking/tst.DestructionDoubleUnlock.sh +6
-6@@ -1,7 +1,7 @@ #!/bin/bash # # Oracle Linux DTrace. -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. #@@ -41,7 +41,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -59,17 +59,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -81,7 +81,7 @@ script() ./test & PID=$! disown %+ - if ! $dtrace -p $PID -lP test_prov$PID; then + if ! $dtrace $dt_flags -p $PID -lP test_prov$PID; then kill -9 $PID return 1 fitest/expensive/locking/tst.exit-process-kill-races.sh +2
-2@@ -89,10 +89,10 @@ while :; do esac if [[ $state != "POUND" ]]; then - result="$($dtrace -qc test/triggers/delaydie -n 'tick-1s { printf("timeout\n"); exit(0); }' -n 'syscall::exit_group:entry /pid == $target/ { printf("exit\n"); exit(0); }')" + result="$($dtrace $dt_flags -qc test/triggers/delaydie -n 'tick-1s { printf("timeout\n"); exit(0); }' -n 'syscall::exit_group:entry /pid == $target/ { printf("exit\n"); exit(0); }')" else set -e - $dtrace -qc test/triggers/delaydie -n 'tick-1s { printf("timeout\n"); exit(0); }' -n 'syscall::exit_group:entry /pid == $target/ { printf("exit\n"); exit(0); }' + $dtrace $dt_flags -qc test/triggers/delaydie -n 'tick-1s { printf("timeout\n"); exit(0); }' -n 'syscall::exit_group:entry /pid == $target/ { printf("exit\n"); exit(0); }' set +e fitest/internals/headers/tst.header-endianness.sh +1
-1@@ -26,5 +26,5 @@ for header in ${OLDDIRNAME}/include/dtrace/*.h; do #error $header: needs to include <sys/dtrace_types.h> #endif EOF - $CC -c $CFLAGS -o /dev/null test.c + $CC $test_cppflags -c $CFLAGS -o /dev/null test.c donetest/unittest/actions/symmod/tst.symmod.sh +1
-1@@ -21,7 +21,7 @@ NAM=$MOD'`'$NAM # run DTrace to test mod() and sym() # also test func(), but it is simply an alias for sym() -read MYMOD MYNAM MYFUN <<< `$dtrace -qn 'BEGIN {mod(0x'$ADD'); sym(0x'$ADD'); func(0x'$ADD'); exit(0) }'` +read MYMOD MYNAM MYFUN <<< `$dtrace $dt_flags -qn 'BEGIN {mod(0x'$ADD'); sym(0x'$ADD'); func(0x'$ADD'); exit(0) }'` if [ $? -ne 0 ]; then exit 1 fitest/unittest/aggs/tst.aggmod_full2.sh +4
-4@@ -124,25 +124,25 @@ EOF # build # ================================================== -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1 fi -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} prov.o test.o +${CC} ${test_ldflags} ${CFLAGS} prov.o test.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1test/unittest/aggs/tst.aggpercpu.sh +1
-1@@ -17,7 +17,7 @@ cd $DIRNAME # forcing DTrace to aggregate results over all CPUs. # -$dtrace -xaggpercpu -qn ' +$dtrace $dt_flags -xaggpercpu -qn ' profile-600ms { printf("cpu %d\n", cpu);test/unittest/aggs/tst.multicpus.sh +1
-1@@ -17,7 +17,7 @@ cd $DIRNAME # forcing DTrace to aggregate results over all CPUs. # -$dtrace -qn ' +$dtrace $dt_flags -qn ' profile-600ms { printf("cpu %d\n", cpu);test/unittest/arrays/tst.uregsarray-check.sh +5
-5@@ -22,7 +22,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -46,17 +46,17 @@ int main(int c, char **v) { } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -64,7 +64,7 @@ fi # run DTrace -$dtrace -c ./test -qn ' +$dtrace $dt_flags -c ./test -qn ' test_prov$target::: { printf("DTrace has PC %x and SP %x\n", uregs[R_PC], uregs[R_SP]);test/unittest/builtinvar/tst.errno3.sh +1
-1@@ -35,7 +35,7 @@ int main(int c, char **v) { } EOF -$CC main.c +$CC $test_cppflags main.c if [ $? -ne 0 ]; then echo compilation failed exit 1test/unittest/cpc/err.cpcvscpustatpart1.sh +1
-1@@ -17,7 +17,7 @@ script() { - $dtrace -o $dtraceout -s /dev/stdin <<EOF + $dtrace $dt_flags -o $dtraceout -s /dev/stdin <<EOF #pragma D option bufsize=128k cpc:::PAPI_tot_ins-all-10000test/unittest/cpc/err.cpcvscpustatpart2.sh +1
-1@@ -17,7 +17,7 @@ script() { - $dtrace -s /dev/stdin <<EOF + $dtrace $dt_flags -s /dev/stdin <<EOF #pragma D option bufsize=128k BEGINtest/unittest/cpc/err.cputrackfailtostart.sh +1
-1@@ -16,7 +16,7 @@ script() { - $dtrace -o $dtraceout -s /dev/stdin <<EOF + $dtrace $dt_flags -o $dtraceout -s /dev/stdin <<EOF #pragma D option bufsize=128k cpc:::PAPI_tot_ins-all-10000test/unittest/cpc/err.cputrackterminates.sh +1
-1@@ -16,7 +16,7 @@ script() { - $dtrace -s /dev/stdin <<EOF + $dtrace $dt_flags -s /dev/stdin <<EOF #pragma D option bufsize=128k cpc:::PAPI_tot_ins-all-10000test/unittest/cpc/tst.platformevent.sh +1
-1@@ -38,7 +38,7 @@ EOF script() { - $dtrace -s /dev/stdin << EOD + $dtrace $dt_flags -s /dev/stdin << EOD #pragma D option quiet #pragma D option bufsize=128ktest/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh +6
-6@@ -33,7 +33,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -51,17 +51,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -69,11 +69,11 @@ fi script() { - $dtrace -c ./test -lvn 'test_prov$target:::go' + $dtrace $dt_flags -c ./test -lvn 'test_prov$target:::go' ./test & PID=$! disown %+ - $dtrace -p $PID -lvn 'test_prov$target:::go' + $dtrace $dt_flags -p $PID -lvn 'test_prov$target:::go' kill -9 $PID }test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh +8
-8@@ -35,7 +35,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -53,17 +53,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -71,13 +71,13 @@ fi script() { - $dtrace -c ./test -lf main - $dtrace -c ./test -lf 'main*' + $dtrace $dt_flags -c ./test -lf main + $dtrace $dt_flags -c ./test -lf 'main*' ./test & PID=$! disown %+ - $dtrace -p $PID -lf main - $dtrace -p $PID -lf 'main*' + $dtrace $dt_flags -p $PID -lf main + $dtrace $dt_flags -p $PID -lf 'main*' kill -9 $PID }test/unittest/dtrace-util/tst.ListProbesModuleSDT.sh +1
-1@@ -24,7 +24,7 @@ fi dtrace=$1 -$dtrace -lm dt_test && $dtrace -lm 'dt_t*' +$dtrace $dt_flags -lm dt_test && $dtrace $dt_flags -lm 'dt_t*' status=$? exit $statustest/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh +6
-6@@ -35,7 +35,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -58,7 +58,7 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1@@ -71,13 +71,13 @@ fi script() { - $dtrace -c ./test -lm test - $dtrace -c ./test -lm 'tes*' + $dtrace $dt_flags -c ./test -lm test + $dtrace $dt_flags -c ./test -lm 'tes*' ./test & PID=$! disown %+ - $dtrace -p $PID -lm test - $dtrace -p $PID -lm 'tes*' + $dtrace $dt_flags -p $PID -lm test + $dtrace $dt_flags -p $PID -lm 'tes*' kill -9 $PID }test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh +8
-8@@ -35,7 +35,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -53,17 +53,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -71,13 +71,13 @@ fi script() { - $dtrace -c ./test -ln 'test_prov*:::go' - $dtrace -c ./test -ln 'test_prov*:::g*' + $dtrace $dt_flags -c ./test -ln 'test_prov*:::go' + $dtrace $dt_flags -c ./test -ln 'test_prov*:::g*' ./test & PID=$! disown %+ - $dtrace -p $PID -ln 'test_prov*:::go' - $dtrace -p $PID -ln 'test_prov*:::g*' + $dtrace $dt_flags -p $PID -ln 'test_prov*:::go' + $dtrace $dt_flags -p $PID -ln 'test_prov*:::g*' kill -9 $PID }test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh +7
-7@@ -35,7 +35,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -53,17 +53,17 @@ main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${test_ldflags} ${CFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -71,12 +71,12 @@ fi script() { - $dtrace -c ./test -lP 'test*' + $dtrace $dt_flags -c ./test -lP 'test*' ./test & PID=$! disown %+ - $dtrace -p $PID -lP test_prov$PID - $dtrace -p $PID -lP 'test*' + $dtrace $dt_flags -p $PID -lP test_prov$PID + $dtrace $dt_flags -p $PID -lP 'test*' kill -9 $PID }test/unittest/dtrace-util/tst.ProcInvalid.sh +1
-1@@ -22,4 +22,4 @@ fi dtrace=$1 -$dtrace -p 484837947 -n 'BEGIN { exit(0); }' || true +$dtrace $dt_flags -p 484837947 -n 'BEGIN { exit(0); }' || truetest/unittest/fbtprovider/err.D_ARGS_IDX.void-void.x +1
-1@@ -1,7 +1,7 @@ #!/bin/bash # Skip test if FBT probes do not provide argument datatype info. -types=`$dtrace -lvn fbt::oops_enter:return | gawk '/^[ ]*args\[/ { $1 = ""; print }' | sort -u` +types=`$dtrace $dt_flags -lvn fbt::oops_enter:return | gawk '/^[ ]*args\[/ { $1 = ""; print }' | sort -u` if [[ -z "$types" ]]; then echo "FBT probes without args[] type info"test/unittest/fbtprovider/err.D_ARGS_IDX.void.x +1
-1@@ -1,7 +1,7 @@ #!/bin/bash # Skip test if FBT probes do not provide argument datatype info. -types=`$dtrace -lvn fbt::exit_creds:return | gawk '/^[ ]*args\[/ { $1 = ""; print }' | sort -u` +types=`$dtrace $dt_flags -lvn fbt::exit_creds:return | gawk '/^[ ]*args\[/ { $1 = ""; print }' | sort -u` if [[ -z "$types" ]]; then echo "FBT probes without args[] type info"test/unittest/ip/tst.ipv4remotetcp.sh +1
-1@@ -69,7 +69,7 @@ cat > $tmpdir/tst.ipv4remotetcp.test.pl <<-EOPERL } EOPERL -$dtrace -c "/usr/bin/perl $tmpdir/tst.ipv4remotetcp.test.pl" -qs /dev/stdin <<EODTRACE +$dtrace $dt_flags -c "/usr/bin/perl $tmpdir/tst.ipv4remotetcp.test.pl" -qs /dev/stdin <<EODTRACE BEGIN { send = receive = 0;test/unittest/misc/err.lockmem-pragma.sh +1
-1@@ -9,7 +9,7 @@ dtrace=$1 -$dtrace -qs /dev/stdin << EOF +$dtrace $dt_flags -qs /dev/stdin << EOF #pragma D option lockmem=1 BEGINtest/unittest/misc/tst.include.sh +2
-2@@ -32,8 +32,8 @@ void main() {} EOF - if $CC $CFLAGS -o $cofile $cfile >/dev/null 2>&1; then - $dtrace -xerrtags -C -s /dev/stdin \ + if $CC $test_cppflags $CFLAGS -o $cofile $cfile >/dev/null 2>&1; then + $dtrace $dt_flags -xerrtags -C -s /dev/stdin \ >/dev/null 2>$errfile <<EOF #include <sys/$file> BEGINtest/unittest/misc/tst.lockmem-cmdline.sh +1
-1@@ -12,7 +12,7 @@ dtrace=$1 for val in 1 268435456 unlimited; do ulimit -l $val - $dtrace -qn 'BEGIN { @ = avg(1234); exit(0); }' + $dtrace $dt_flags -qn 'BEGIN { @ = avg(1234); exit(0); }' echo $? donetest/unittest/misc/tst.lockmem-envvar.sh +1
-1@@ -12,7 +12,7 @@ dtrace=$1 ulimit -l 1 for val in 16 1K 268435456K 262144M 256G unlimited; do - DTRACE_OPT_LOCKMEM=$val $dtrace -qn 'BEGIN { @ = avg(1234); exit(0); }' + DTRACE_OPT_LOCKMEM=$val $dtrace $dt_flags -qn 'BEGIN { @ = avg(1234); exit(0); }' echo $? donetest/unittest/misc/tst.lockmem-x.sh +1
-1@@ -12,7 +12,7 @@ dtrace=$1 ulimit -l 1 for val in 16 1K 268435456K 262144M 256G unlimited; do - $dtrace -xlockmem=$val -qn 'BEGIN { @ = avg(1234); exit(0); }' + $dtrace $dt_flags -xlockmem=$val -qn 'BEGIN { @ = avg(1234); exit(0); }' echo $? donetest/unittest/misc/tst.parser1.sh +1
-1@@ -17,7 +17,7 @@ chkfile=$tmpfile.check # Run DTrace. -$dtrace -xtree=1 -e -n ' +$dtrace $dt_flags -xtree=1 -e -n ' BEGIN { x = 1234;test/unittest/misc/tst.parser2.sh +1
-1@@ -17,7 +17,7 @@ chkfile=$tmpfile.check # Run DTrace. -$dtrace -xtree=2 -e -n ' +$dtrace $dt_flags -xtree=2 -e -n ' BEGIN { x = 1234;test/unittest/misc/tst.parser4.sh +1
-1@@ -17,7 +17,7 @@ chkfile=$tmpfile.check # Run DTrace. -$dtrace -xtree=4 -e -n ' +$dtrace $dt_flags -xtree=4 -e -n ' BEGIN { x = 1234;test/unittest/options/tst.bpflog-cmdline.sh +1
-1@@ -8,6 +8,6 @@ dtrace=$1 -$dtrace -xbpflog -qn 'BEGIN { exit(0); }' |& grep '^BPF: ' > /dev/null +$dtrace $dt_flags -xbpflog -qn 'BEGIN { exit(0); }' |& grep '^BPF: ' > /dev/null exit $?test/unittest/options/tst.bpflog-pragma.sh +1
-1@@ -8,7 +8,7 @@ dtrace=$1 -$dtrace -qs /dev/stdin << EOT |& grep '^BPF: ' > /dev/null +$dtrace $dt_flags -qs /dev/stdin << EOT |& grep '^BPF: ' > /dev/null #pragma D option bpflog BEGINtest/unittest/options/tst.bpflogsize-pragma.sh +1
-1@@ -67,7 +67,7 @@ cursiz=$((16 * 1024 * 1024 - 1)) # default size from dt_bpf_load_prog() while [ $cursiz -lt $((1024 * 1024 * 1024)) ]; do # dtrace should not pass - $dtrace -qs D.d >& tmp.out + $dtrace $dt_flags -qs D.d >& tmp.out if [ $? -eq 0 ]; then echo unexpected pass dump_filestest/unittest/options/tst.iregs.sh +1
-1@@ -13,7 +13,7 @@ dtrace=$1 # once n becomes too small, there are insufficient registers for n in 8 7 6 5 4 3; do - $dtrace -xiregs=$n -qn 'BEGIN { + $dtrace $dt_flags -xiregs=$n -qn 'BEGIN { a = b = c = d = e = f = g = h = i = j = k = l = 1; trace(a + b * (c + d * (e + f * (g + h * (i + j * (k + l)))))); exit(0);test/unittest/options/tst.linktype.sh +3
-3@@ -24,7 +24,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -42,7 +42,7 @@ int main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${test_ldflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1@@ -51,7 +51,7 @@ fi # link with different -xlinktype values function mytest() { - $dtrace -G $1 -s prov.d test.o + $dtrace $dt_flags -G $1 -s prov.d test.o # report whether the link succeeded if [ $? -ne 0 ]; thentest/unittest/options/tst.modpath.x +1
-1@@ -9,7 +9,7 @@ fi # Skip test if CTF info is not used for rawtp args[] types. (If all rawtp # args[] types are "uint64_t", this is a symptom of our using the back-up # trial-and-error method.) -types=`$dtrace -lvP rawtp | gawk '/^[ ]*args/ { $1 = ""; print }' | sort -u` +types=`$dtrace $dt_flags -lvP rawtp | gawk '/^[ ]*args/ { $1 = ""; print }' | sort -u` if [ "$types" == " uint64_t" ]; then echo "not using CTF for rawtp args types" exit 2test/unittest/options/tst.strip.sh +4
-4@@ -22,7 +22,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -40,7 +40,7 @@ int main(int argc, char **argv) } EOF -${CC} ${CFLAGS} -c test.c +${CC} ${test_cppflags} ${test_ldflags} ${CFLAGS} -c test.c if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1@@ -50,14 +50,14 @@ fi objdump="objdump --full-contents --section=.SUNW_dof prov.o" -$dtrace -G -xstrip -s prov.d test.o +$dtrace $dt_flags -G -xstrip -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF (stripped)" >& 2 exit 1 fi $objdump >& out.stripped.txt -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1test/unittest/options/tst.switchrate.sh +1
-1@@ -20,7 +20,7 @@ for nexpect in 1 16; do # Run the "instantaneous" D script with the prescribed switchrate. # Time it. Round to the nearest number of seconds with int(t+0.5). nactual=`/usr/bin/time -f "%e" \ - $dtrace -xswitchrate=${nexpect}sec -qn 'BEGIN { exit(0) }' \ + $dtrace $dt_flags -xswitchrate=${nexpect}sec -qn 'BEGIN { exit(0) }' \ |& gawk 'NF != 0 {print int($1 + 0.5)}'` # Check the actual number of seconds to the expected value.test/unittest/options/tst.tregs.sh +1
-1@@ -9,6 +9,6 @@ dtrace=$1 for x in 3 5 9 11; do - $dtrace -xtregs=$x -qn 'BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }' + $dtrace $dt_flags -xtregs=$x -qn 'BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }' echo "tregs $x gives $?" donetest/unittest/pid/tst.offsets.sh +1
-1@@ -65,7 +65,7 @@ fi # We are testing a glob in the pid$target:a.out:loopfunc: probe name. # -$dtrace -xstrsize=16 -qn ' +$dtrace $dt_flags -xstrsize=16 -qn ' pid$target:a.out:coldfunc:entry, pid$target:a.out:loopfunc:, pid$target:a.out:leaffunc:entrytest/unittest/pid/tst.provregex3.sh +2
-2@@ -29,10 +29,10 @@ main.o: main.c prov.h cc $test_cppflags -c main.c prov.h: prov.d - $dtrace -h -s prov.d + $dtrace $dt_flags -h -s prov.d prov.o: prov.d main.o - $dtrace -G -64 -s prov.d main.o + $dtrace $dt_flags -G -64 -s prov.d main.o EOF cat > $DIR/prov.d <<EOFtest/unittest/pid/tst.provregex4.sh +3
-3@@ -31,10 +31,10 @@ main.o: main.c prov.h cc $test_cppflags -c main.c prov.h: prov.d - $dtrace -h -s prov.d + $dtrace $dt_flags -h -s prov.d provmain.o: prov.d main.o - $dtrace -G -o provmain.o -s prov.d main.o + $dtrace $dt_flags -G -o provmain.o -s prov.d main.o altlib.so: altlib.o provalt.o cc $test_cppflags -z defs --shared -o altlib.so altlib.o provalt.o@@ -43,7 +43,7 @@ altlib.o: altlib.c prov.h cc $test_cppflags -c altlib.c provalt.o: prov.d altlib.o - $dtrace -G -o provalt.o -s prov.d altlib.o + $dtrace $dt_flags -G -o provalt.o -s prov.d altlib.o EOF cat > $DIR/prov.d <<EOFtest/unittest/predicates/tst.predcache.sh +2
-2@@ -78,7 +78,7 @@ unload() script1() { - $dtrace -s /dev/stdin <<EOF + $dtrace $dt_flags -s /dev/stdin <<EOF syscall:::entry /pid != $ppid/ {@@ -95,7 +95,7 @@ EOF script2() { - $dtrace -s /dev/stdin <<EOF + $dtrace $dt_flags -s /dev/stdin <<EOF #pragma D option statusrate=1mstest/unittest/printf/tst.wide-bug30404549.sh +1
-1@@ -17,7 +17,7 @@ fi dtrace=$1 # abbreviate output to a simple statement of length. raw output is big (29M) -$dtrace -qs /dev/stdin << EOF | gawk '{ print length($0); }' +$dtrace $dt_flags -qs /dev/stdin << EOF | gawk '{ print length($0); }' BEGIN { printf("%10000000d\n", 1);test/unittest/printf/tst.wide.sh +1
-1@@ -17,7 +17,7 @@ fi dtrace=$1 # abbreviate output, where the raw output of prints is big (29M) -$dtrace -qs /dev/stdin << EOF | gawk '{ +$dtrace $dt_flags -qs /dev/stdin << EOF | gawk '{ if (match($0, " +")) printf("%s{%d* }%s\n", substr($0, 1, RSTART - 1), RLENGTH, substr($0, RSTART + RLENGTH));test/unittest/providers/rawtp/err.lockmem-too-low.sh +2
-2@@ -23,11 +23,11 @@ dtrace=$1 # Determine whether the system respects setting the lockmem limit as root. # Some systems ignore lowering the limit, which means we cannot make it fail. # In that case, we report XFAIL. -if $dtrace -xlockmem=1 -n 'BEGIN { exit(0); }' &> /dev/null; then +if $dtrace $dt_flags -xlockmem=1 -n 'BEGIN { exit(0); }' &> /dev/null; then exit 67 fi -$dtrace -xlockmem=1 -lvn rawtp:::sched_process_fork |& \ +$dtrace $dt_flags -xlockmem=1 -lvn rawtp:::sched_process_fork |& \ gawk 'BEGIN { err = 0; # lockmem error messages CTF = 0; # arg types indicating CTF infotest/unittest/syscall/tst.openret.sh +1
-1@@ -6,7 +6,7 @@ # http://oss.oracle.com/licenses/upl. script() { - $dtrace -c 'cat shajirosan' -qs /dev/stdin <<EOF + $dtrace $dt_flags -c 'cat shajirosan' -qs /dev/stdin <<EOF syscall::open*:entry /pid == \$target/ {test/unittest/usdt/tst.allargs.sh +4
-3@@ -17,6 +17,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="-std=gnu89 $test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-allargs.$$.$RANDOM" mkdir -p $DIRNAME@@ -73,18 +74,18 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1 fi -$dtrace -c ./test -qs /dev/stdin <<EOF +$dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target:::zero { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.andpid.ksh +1
-1@@ -11,7 +11,7 @@ fi dtrace=$1 -$dtrace -c date -s /dev/stdin <<EOF +$dtrace $dt_flags -c date -s /dev/stdin <<EOF plockstat\$target::mutex_lock_impl:, pid\$target::mutex_lock_impl: {}test/unittest/usdt/tst.badguess.sh +5
-4@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-badguess.$$.$RANDOM" mkdir -p $DIRNAME@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -48,13 +49,13 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c 64-bit" >& 2 exit 1 fi -$CC $CFLAGS -m32 -c -o test32.o test.c +$CC $LDFLAGS -m32 -c -o test32.o test.c if [ $? -ne 0 ]; then echo "failed to compile test.c 32-bit" >& 2 exit 1 fi -$dtrace -G -s prov.d test32.o test64.o +$dtrace $dt_flags -G -s prov.d test32.o test64.o if [ $? -eq 0 ]; then echo "DOF generation failed to generate a warning" >& 2 exit 1test/unittest/usdt/tst.corruptenv.sh +4
-4@@ -29,16 +29,16 @@ cat > Makefile <<EOF all: main main: main.o prov.o - \$(CC) -o main main.o prov.o + \$(CC) \$(test_ldflags) -o main main.o prov.o main.o: main.c prov.h - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c prov.h: prov.d - $dtrace -h -s prov.d + $dtrace $dt_flags -h -s prov.d prov.o: prov.d main.o - $dtrace -G -s prov.d main.o + $dtrace $dt_flags -G -s prov.d main.o EOF cat > prov.d <<EOFtest/unittest/usdt/tst.dlclose1.sh +10
-10@@ -44,30 +44,30 @@ cat > Makefile <<EOF all: main livelib.so deadlib.so main: main.o prov.o - \$(CC) -o main main.o -ldl + \$(CC) \$(test_ldflags) -o main main.o -ldl main.o: main.c - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c livelib.so: livelib.o prov.o - \$(CC) -shared -o livelib.so livelib.o prov.o -lc + \$(CC) \$(test_ldflags) -shared -o livelib.so livelib.o prov.o -lc livelib.o: livelib.c prov.h - \$(CC) -c livelib.c + \$(CC) \$(test_cppflags) -c livelib.c prov.o: livelib.o prov.d - $dtrace -G -s prov.d livelib.o + $dtrace \$(dt_flags) -G -s prov.d livelib.o prov.h: prov.d - $dtrace -h -s prov.d + $dtrace \$(dt_flags) -h -s prov.d deadlib.so: deadlib.o - \$(CC) -shared -o deadlib.so deadlib.o -lc + \$(CC) \$(test_ldflags) -shared -o deadlib.so deadlib.o -lc deadlib.o: deadlib.c - \$(CC) -c deadlib.c + \$(CC) \$(test_cppflags) -c deadlib.c clean: rm -f main.o livelib.o prov.o prov.h deadlib.o@@ -203,11 +203,11 @@ pid=$! echo started pid $pid mywait 6 "started" myfile.txt # wait for process to start -$dtrace -lP test_prov$pid # check USDT probes +$dtrace $dt_flags -lP test_prov$pid # check USDT probes kill -s USR1 $pid # signal process mywait 6 "dlclosed" myfile.txt # wait for process to dlclose -$dtrace -lP test_prov$pid # check USDT probes +$dtrace $dt_flags -lP test_prov$pid # check USDT probes kill -s KILL $pid # kill process exit 0test/unittest/usdt/tst.dlclose2.sh +9
-9@@ -26,30 +26,30 @@ cat > Makefile <<EOF all: main livelib.so deadlib.so main: main.o prov.o - \$(CC) -o main main.o -ldl + \$(CC) \$(test_ldflags) -o main main.o -ldl main.o: main.c - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c livelib.so: livelib.o prov.o - \$(CC) -shared -o livelib.so livelib.o prov.o -lc + \$(CC) \$(test_ldflags) -shared -o livelib.so livelib.o prov.o -lc livelib.o: livelib.c prov.h - \$(CC) -c livelib.c + \$(CC) \$(test_cppflags) -c livelib.c prov.o: livelib.o prov.d - $dtrace -G -s prov.d livelib.o + $dtrace \$(dt_flags) -G -s prov.d livelib.o prov.h: prov.d - $dtrace -h -s prov.d + $dtrace \$(dt_flags) -h -s prov.d deadlib.so: deadlib.o - \$(CC) -shared -o deadlib.so deadlib.o -lc + \$(CC) \$(test_ldflags) -shared -o deadlib.so deadlib.o -lc deadlib.o: deadlib.c - \$(CC) -c deadlib.c + \$(CC) \$(test_cppflags) -c deadlib.c clean: rm -f main.o livelib.o prov.o prov.h deadlib.o@@ -128,7 +128,7 @@ if [ $? -ne 0 ]; then fi script() { - $dtrace -c ./main -Zqs /dev/stdin <<EOF + $dtrace $dt_flags -c ./main -Zqs /dev/stdin <<EOF test_prov*::: { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.dlclose3.sh +9
-9@@ -32,28 +32,28 @@ cat > Makefile <<EOF all: main livelib.so deadlib.so main: main.o prov.o - \$(CC) -o main main.o -ldl + \$(CC) \$(test_ldflags) -o main main.o -ldl main.o: main.c - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c livelib.so: livelib.o prov.o - \$(CC) -shared -o livelib.so livelib.o prov.o -lc + \$(CC) \$(test_ldflags) -shared -o livelib.so livelib.o prov.o -lc livelib.o: livelib.c prov.h - \$(CC) -c livelib.c + \$(CC) \$(test_cppflags) -c livelib.c prov.o: livelib.o prov.d - $dtrace -G -s prov.d livelib.o + $dtrace \$(dt_flags) -G -s prov.d livelib.o prov.h: prov.d - $dtrace -h -s prov.d + $dtrace \$(dt_flags) -h -s prov.d deadlib.so: deadlib.o - \$(CC) -shared -o deadlib.so deadlib.o -lc + \$(CC) \$(test_ldflags) -shared -o deadlib.so deadlib.o -lc deadlib.o: deadlib.c - \$(CC) -c deadlib.c + \$(CC) \$(test_cppflags) -c deadlib.c clean: rm -f main.o livelib.o prov.o prov.h deadlib.o@@ -122,7 +122,7 @@ if [ $? -ne 0 ]; then fi script() { - $dtrace -c ./main -s /dev/stdin <<EOF + $dtrace $dt_flags -c ./main -s /dev/stdin <<EOF pid\$target:a.out:foo:entry { gotit = 1;test/unittest/usdt/tst.dlclose4.sh +7
-7@@ -30,22 +30,22 @@ cat > Makefile <<EOF all: main livelib.so main: main.o prov.o - \$(CC) -o main main.o -ldl + \$(CC) \$(test_ldflags) -o main main.o -ldl main.o: main.c - \$(CC) -c main.c + \$(CC) \$(test_cppflags) -c main.c livelib.so: livelib.o prov.o - \$(CC) -shared -o livelib.so livelib.o prov.o -lc + \$(CC) \$(test_ldflags) -shared -o livelib.so livelib.o prov.o -lc livelib.o: livelib.c prov.h - \$(CC) -c livelib.c + \$(CC) \$(test_cppflags) -c livelib.c prov.o: livelib.o prov.d - $dtrace -G -s prov.d livelib.o + $dtrace \$(dt_flags) -G -s prov.d livelib.o prov.h: prov.d - $dtrace -h -s prov.d + $dtrace \$(dt_flags) -h -s prov.d clean: rm -f main.o livelib.o prov.o prov.h@@ -141,7 +141,7 @@ fi # ls /run/dtrace/stash/dof-pid/$pid/*/parsed/test_prov:livelib.so:go:go function check_USDT_probes() { - $dtrace -lP test_prov$pid |& awk ' + $dtrace $dt_flags -lP test_prov$pid |& awk ' /ID *PROVIDER *MODULE *FUNCTION *NAME/ { next } /test_prov'$pid' *livelib\.so *go *go/ { exit(0) } /No probe matches description/ { exit(1) }'test/unittest/usdt/tst.eliminate.sh +5
-4@@ -17,7 +17,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-eliminate.$$.$RANDOM" mkdir -p $DIRNAME@@ -29,7 +30,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -59,12 +60,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1test/unittest/usdt/tst.enable_pid.sh +2
-2@@ -115,7 +115,7 @@ EOF # Build the test program. # -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >&2 exit 1@@ -125,7 +125,7 @@ if [ $? -ne 0 ]; then echo "failed to compile test" >&2 exit 1 fi -$dtrace -G -64 -s prov.d main.o +$dtrace $dt_flags -G -64 -s prov.d main.o if [ $? -ne 0 ]; then echo "failed to create DOF" >&2 exit 1test/unittest/usdt/tst.enabled.sh +6
-5@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-enabled.$$.$RANDOM" mkdir -p $DIRNAME@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -48,12 +49,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -61,7 +62,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.enabled2.sh +6
-5@@ -16,7 +16,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-enabled2.$$.$RANDOM" mkdir -p $DIRNAME@@ -28,7 +29,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -62,12 +63,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -77,7 +78,7 @@ script() { ./test - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { }test/unittest/usdt/tst.entryreturn.sh +4
-3@@ -15,6 +15,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-entryreturn.$$.$RANDOM" mkdir -p $DIRNAME@@ -59,12 +60,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -72,7 +73,7 @@ fi script() { - $dtrace -wqZFs /dev/stdin <<EOF + $dtrace $dt_flags -wqZFs /dev/stdin <<EOF BEGIN { system("$DIRNAME/test");test/unittest/usdt/tst.exec-dof-replacement.sh +6
-5@@ -15,7 +15,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-exec-dof-replacement.$$.$RANDOM" mkdir -p $DIRNAME@@ -33,7 +34,7 @@ provider test_prov { }; EOF -if ! { $dtrace -h -s prov1.d && dtrace -h -s prov2.d; } then +if ! { $dtrace $dt_flags -h -s prov1.d && dtrace -h -s prov2.d; } then echo "failed to generate header files" >&2 exit 1 fi@@ -70,11 +71,11 @@ if ! { ${CC} ${CFLAGS} -c test1.c && ${CC} ${CFLAGS} -c test2.c; } then echo "failed to compile test programs" >&2 exit 1 fi -if ! { $dtrace -G -s prov1.d test1.o && $dtrace -G -s prov2.d test2.o; } then +if ! { $dtrace $dt_flags -G -s prov1.d test1.o && $dtrace $dt_flags -G -s prov2.d test2.o; } then echo "failed to create DOF" >& 2 exit 1 fi -if ! { ${CC} ${CFLAGS} -o test1 test1.o prov1.o && ${CC} ${CFLAGS} -o test2 test2.o prov2.o; } then +if ! { ${CC} ${LDFLAGS} -o test1 test1.o prov1.o && ${CC} ${LDFLAGS} -o test2 test2.o prov2.o; } then echo "failed to link final executables" >& 2 exit 1 fi@@ -89,7 +90,7 @@ PROC=$! while [[ -d /proc/$PROC ]] && [[ "$(readlink /proc/$PROC/exe)" =~ test1$ ]]; do sleep 1 done -$dtrace -p $PROC '-Ptest_prov$target' -l +$dtrace $dt_flags -p $PROC '-Ptest_prov$target' -l status2=$? kill $PROCtest/unittest/usdt/tst.execstack.sh +5
-4@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" OBJDUMP=/usr/bin/objdump READELF=/usr/bin/readelf@@ -29,7 +30,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -54,7 +55,7 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1@@ -64,7 +65,7 @@ if [ $? -eq 0 ]; then echo "EXEC flag on .note.GNU-stack" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${lDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1test/unittest/usdt/tst.fork.sh +6
-5@@ -13,7 +13,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-fork.$$.$RANDOM" mkdir -p $DIRNAME@@ -25,7 +26,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -58,19 +59,19 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1 fi script() { - $dtrace -c ./test -Zqs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -Zqs /dev/stdin <<EOF test_prov*::: { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.forker.sh +1
-1@@ -25,7 +25,7 @@ id=$! disown %+ while kill -0 $id >/dev/null 2>&1; do - $dtrace -p $id -s /dev/stdin <<-EOF + $dtrace $dt_flags -p $id -s /dev/stdin <<-EOF forker*:::fire /i++ == 4/ {test/unittest/usdt/tst.guess32.sh +6
-5@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-guess32.$$.$RANDOM" mkdir -p $DIRNAME@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -48,12 +49,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -m32 -o test test.o prov.o +${CC} ${LDFLAGS} -m32 -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -61,7 +62,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.guess64.sh +6
-5@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-guess64.$$.$RANDOM" mkdir -p $DIRNAME@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -48,12 +49,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -61,7 +62,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.header.sh +5
-4@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-header.$$.$RANDOM" mkdir -p $DIRNAME@@ -27,7 +28,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -52,12 +53,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1test/unittest/usdt/tst.lingering.sh +6
-5@@ -15,7 +15,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-lingering.$$.$RANDOM" mkdir -p $DIRNAME@@ -28,7 +29,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -57,12 +58,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -74,7 +75,7 @@ TRIGPID=$! trap 'kill -9 $TRIGPID' ERR EXIT script() { - $dtrace -p $TRIGPID -qs /dev/stdin <<EOF + $dtrace $dt_flags -p $TRIGPID -qs /dev/stdin <<EOF test_prov\$target:::$1 { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.link-idempotence.sh +6
-5@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-link-idempotence.$$.$RANDOM" mkdir -p $DIRNAME@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -48,13 +49,13 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o -$dtrace -G -s prov.d test.o +${CC} ${LDFLAGS} -o test test.o prov.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to regenerate DOF" >& 2 exit 1test/unittest/usdt/tst.linkpriv.sh +3
-2@@ -13,6 +13,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="-std=gnu99 $test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-linkpriv.$$.$RANDOM" mkdir -p $DIRNAME@@ -49,12 +50,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1test/unittest/usdt/tst.linkunpriv.sh +1
-1@@ -53,7 +53,7 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1test/unittest/usdt/tst.manyprobes.sh +4
-3@@ -13,6 +13,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-manyprobes.$$.$RANDOM" mkdir -p $DIRNAME cd $DIRNAME@@ -47,12 +48,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s manyprobes.d test.o +$dtrace $dt_flags -G -s manyprobes.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o manyprobes.o +${CC} ${LDFLAGS} -o test test.o manyprobes.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -60,7 +61,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF manyprobes\$target:::test1, manyprobes\$target:::test750, manyprobes\$target:::test1999 { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.manyprocs.sh +5
-4@@ -15,7 +15,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-manyprocs.$$.$RANDOM" mkdir -p $DIRNAME@@ -27,7 +28,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -63,12 +64,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1test/unittest/usdt/tst.multiple.sh +6
-5@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-multiple.$$.$RANDOM" mkdir -p $DIRNAME@@ -26,7 +27,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -58,12 +59,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -74,7 +75,7 @@ script() { # rtld activity monitoring from triggering repeated # probe scans (checking for problems doing one-off scans of # already-running processes while probing multiple probes). - ./test & { WAIT=$!; sleep 1; $dtrace -qs /dev/stdin $WAIT <<EOF; } + ./test & { WAIT=$!; sleep 1; $dtrace $dt_flags -qs /dev/stdin $WAIT <<EOF; } test_prov\$1:::go { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.multitrace.sh +6
-5@@ -15,7 +15,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-multitrace.$$.$RANDOM" mkdir -p $DIRNAME@@ -28,7 +29,7 @@ provider test_multitrace { }; EOF -$dtrace -h -s multitrace.d +$dtrace $dt_flags -h -s multitrace.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -60,19 +61,19 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s multitrace.d test.o +$dtrace $dt_flags -G -s multitrace.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o multitrace.o +${CC} ${LDFLAGS} -o test test.o multitrace.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1 fi script() { - exec $dtrace -qws /dev/stdin $1 $2 $3 <<'EOF' + exec $dtrace $dt_flags -qws /dev/stdin $1 $2 $3 <<'EOF' int fired[pid_t]; int exited[pid_t];test/unittest/usdt/tst.nusdtprobes.sh +4
-4@@ -61,22 +61,22 @@ EOF # Build the trigger. -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >&2 exit 1 fi -cc $test_cppflags -c main.c +gcc $test_cppflags -c main.c if [ $? -ne 0 ]; then echo "failed to compile test" >&2 exit 1 fi -$dtrace -G -64 -s prov.d main.o +$dtrace $dt_flags -G -64 -s prov.d main.o if [ $? -ne 0 ]; then echo "failed to create DOF" >&2 exit 1 fi -cc $test_cppflags -o main main.o prov.o +gcc $test_ldflags -o main main.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >&2 exit 1test/unittest/usdt/tst.onlyenabled.sh +5
-4@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-onlyenabled.$$.$RANDOM" mkdir -p $DIRNAME@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -49,12 +50,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1test/unittest/usdt/tst.pie.sh +6
-5@@ -12,7 +12,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS="-fno-inline -pie" +CFLAGS="-fno-inline -pie $test_cppflags" +LDFLAGS="-pie $test_ldflags" DIRNAME="$tmpdir/usdt-pie.$$.$RANDOM" mkdir -p $DIRNAME@@ -24,7 +25,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -52,12 +53,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -65,7 +66,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.reeval.sh +4
-3@@ -14,6 +14,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-reeval.$$.$RANDOM" mkdir -p $DIRNAME@@ -40,12 +41,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -53,7 +54,7 @@ fi script() { - $dtrace -wZs /dev/stdin <<EOF + $dtrace $dt_flags -wZs /dev/stdin <<EOF BEGIN { system("$DIRNAME/test");test/unittest/usdt/tst.static.sh +4
-3@@ -13,6 +13,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-static.$$.$RANDOM" mkdir -p $DIRNAME@@ -50,12 +51,12 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -63,7 +64,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.static2.sh +5
-4@@ -17,6 +17,7 @@ fi dtrace=$1 CC=/usr/bin/gcc CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-static2.$$.$RANDOM" mkdir -p $DIRNAME@@ -54,18 +55,18 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create initial DOF" >& 2 exit 1 fi rm -f prov.o -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create final DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1@@ -73,7 +74,7 @@ fi script() { - $dtrace -c ./test -qs /dev/stdin <<EOF + $dtrace $dt_flags -c ./test -qs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);test/unittest/usdt/tst.user.sh +6
-5@@ -14,7 +14,8 @@ fi dtrace=$1 CC=/usr/bin/gcc -CFLAGS= +CFLAGS="$test_cppflags" +LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-user.$$.$RANDOM" mkdir -p $DIRNAME@@ -26,7 +27,7 @@ provider test_prov { }; EOF -$dtrace -h -s prov.d +$dtrace $dt_flags -h -s prov.d if [ $? -ne 0 ]; then echo "failed to generate header file" >& 2 exit 1@@ -50,19 +51,19 @@ if [ $? -ne 0 ]; then echo "failed to compile test.c" >& 2 exit 1 fi -$dtrace -G -s prov.d test.o +$dtrace $dt_flags -G -s prov.d test.o if [ $? -ne 0 ]; then echo "failed to create DOF" >& 2 exit 1 fi -${CC} ${CFLAGS} -o test test.o prov.o +${CC} ${LDFLAGS} -o test test.o prov.o if [ $? -ne 0 ]; then echo "failed to link final executable" >& 2 exit 1 fi script() { - $dtrace -c 'ppriv -e -s A=basic ./test' -Zqs /dev/stdin <<EOF + $dtrace $dt_flags -c 'ppriv -e -s A=basic ./test' -Zqs /dev/stdin <<EOF test_prov\$target::: { printf("%s:%s:%s\n", probemod, probefunc, probename);Signature · 1 line
2.46.0.278.g36e3a12567