Further test cleanups
cover Further test cleanups
These are the followup test fixes I promised before for https://github.com/oracle/dtrace-utils/issues/75.
The catch is I haven't had a chance to do a full test-run (have done most though) with them again yet, but I figure I'd better send rather than keep people waiting.
Sam James (4):
test: fix 'harness' typo
test: fix bashism in tst.bitfield-offset.x
test: finalize porting small awk stragglers to gawk
test: allow overriding CC, OBJCOPY, OBJDUMP, NM, ...
.../locking/tst.DestructionDoubleUnlock.sh | 2 +- test/internals/headers/tst.header-endianness.sh | 2 +- test/unittest/aggs/tst.aggmod_full2.sh | 2 +- test/unittest/arrays/tst.uregsarray-check.sh | 2 +- test/unittest/bitfields/tst.bitfield-offset.x | 10 +++++----- test/unittest/builtinvar/tst.errno3.sh | 2 +- test/unittest/builtinvar/tst.id_ERROR.sh | 2 +- .../unittest/dtrace-util/tst.ListProbesFuncUSDT.sh | 2 +- .../dtrace-util/tst.ListProbesModuleUSDT.sh | 2 +- .../unittest/dtrace-util/tst.ListProbesNameUSDT.sh | 2 +- .../dtrace-util/tst.ListProbesProviderUSDT.sh | 2 +- test/unittest/error/tst.clause_scope-regular.r.p | 2 +- test/unittest/io/check_io_probe_args.sh | 2 +- test/unittest/io/dump_io_probe_args.d | 2 +- test/unittest/misc/tst.include.sh | 2 +- test/unittest/options/tst.ctypes.sh | 6 +++--- test/unittest/options/tst.dtypes.sh | 6 +++--- test/unittest/options/tst.linktype.sh | 4 ++-- test/unittest/options/tst.strip.sh | 4 ++-- test/unittest/pid/tst.offsets.sh | 2 +- test/unittest/usdt/tst.allargs.sh | 2 +- test/unittest/usdt/tst.badguess.sh | 2 +- test/unittest/usdt/tst.dlclose1.sh | 2 +- test/unittest/usdt/tst.dlclose2.sh | 2 +- test/unittest/usdt/tst.dlclose3.sh | 2 +- test/unittest/usdt/tst.eliminate.sh | 6 +++--- test/unittest/usdt/tst.enabled.sh | 2 +- test/unittest/usdt/tst.enabled2.sh | 2 +- test/unittest/usdt/tst.entryreturn.sh | 2 +- test/unittest/usdt/tst.exec-dof-replacement.sh | 2 +- test/unittest/usdt/tst.execstack.sh | 6 +++--- test/unittest/usdt/tst.fork.sh | 2 +- test/unittest/usdt/tst.guess32.sh | 2 +- test/unittest/usdt/tst.guess64.sh | 2 +- test/unittest/usdt/tst.header.sh | 2 +- test/unittest/usdt/tst.lingering.sh | 2 +- test/unittest/usdt/tst.link-idempotence.sh | 2 +- test/unittest/usdt/tst.linkpriv.sh | 2 +- test/unittest/usdt/tst.linkunpriv.sh | 2 +- test/unittest/usdt/tst.manyprobes.sh | 2 +- test/unittest/usdt/tst.manyprocs.sh | 2 +- test/unittest/usdt/tst.multiple.sh | 2 +- test/unittest/usdt/tst.multitrace.sh | 2 +- test/unittest/usdt/tst.onlyenabled.sh | 2 +- test/unittest/usdt/tst.pie.sh | 2 +- test/unittest/usdt/tst.reeval.sh | 2 +- test/unittest/usdt/tst.static.sh | 2 +- test/unittest/usdt/tst.static2.sh | 2 +- test/unittest/usdt/tst.user.sh | 2 +- test/unittest/variables/bvar/tst.arg3-ERROR-b.sh | 2 +- test/unittest/variables/bvar/tst.arg3-ERROR.sh | 14 +++++++------- test/utils/workload_analyze_loop.sh | 2 +- 52 files changed, 72 insertions(+), 72 deletions(-)
Signature · 1 line
2.48.1
PATCH 1/4 test: fix 'harness' typo
Noticed when grepping for something else.
--- test/unittest/io/check_io_probe_args.sh | 2 +- test/unittest/io/dump_io_probe_args.d | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
test/unittest/io/check_io_probe_args.sh +1 -1
@@ -6,7 +6,7 @@ # http://oss.oracle.com/licenses/upl. # -# @@skip: not used directly by the test hardness; called by other scripts +# @@skip: not used directly by the test harness; called by other scripts # infile=$1
test/unittest/io/dump_io_probe_args.d +1 -1
@@ -4,7 +4,7 @@ * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ -/* @@skip: not used directly by the test hardness; called by other scripts */ +/* @@skip: not used directly by the test harness; called by other scripts */ /* * For all io::: probes, dump "all" probe arguments (and their interesting members).
Signature · 1 line
2.48.1
PATCH 2/4 test: fix bashism in tst.bitfield-offset.x
In reply to Sam Jamestrap ERR is a bashism and won't work with e.g. dash, just change the shebang to #!/bin/bash in this case as ERR is a bit messy to handle (it'd be trivial here but there's no real reason to not use bash).
--- test/unittest/bitfields/tst.bitfield-offset.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
test/unittest/bitfields/tst.bitfield-offset.x +1 -1
@@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. #
Signature · 1 line
2.48.1
PATCH 3/4 test: finalize porting small awk stragglers to gawk
In reply to Sam JamesWe missed some in 8a1264bf0e818c8624be250eb5174714b62ed93c because some other test changes landed before it landed.
--- test/unittest/builtinvar/tst.id_ERROR.sh | 2 +- test/unittest/error/tst.clause_scope-regular.r.p | 2 +- test/unittest/variables/bvar/tst.arg3-ERROR-b.sh | 2 +- test/unittest/variables/bvar/tst.arg3-ERROR.sh | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-)
test/unittest/builtinvar/tst.id_ERROR.sh +1 -1
@@ -30,7 +30,7 @@ fi # Get the ERROR probe ID from "dtrace -l" output. -id=`$dtrace $dt_flags -ln dtrace:::ERROR |& awk '/^ *[0-9]* *dtrace *ERROR *$/ { print $1 }'` +id=`$dtrace $dt_flags -ln dtrace:::ERROR |& gawk '/^ *[0-9]* *dtrace *ERROR *$/ { print $1 }'` # Construct expected output.
test/unittest/error/tst.clause_scope-regular.r.p +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/awk -f +#!/usr/bin/gawk -f # This report has a variable probe ID in it. {
test/unittest/variables/bvar/tst.arg3-ERROR-b.sh +1 -1
@@ -50,7 +50,7 @@ BEGIN } EOT -awk 'BEGIN { +gawk 'BEGIN { ok = 0; }
test/unittest/variables/bvar/tst.arg3-ERROR.sh +7 -7
@@ -49,7 +49,7 @@ fi # Parse the disassembly output for start PCs for the dt_clause_n. -awk ' +gawk ' BEGIN { phase = 0 } # Look for disassembly of dtrace:::BEGIN.
@@ -70,7 +70,7 @@ phase == 3 && NF == 0 { exit(0) } phase == 3 { next } ' disasm.out > dt_clause_start_pcs.txt if [ $? -ne 0 ]; then - echo ERROR: awk + echo ERROR: gawk dump_files disasm.out dt_clause_start_pcs.txt exit 1 fi
@@ -80,7 +80,7 @@ fi for n in 0 1 2 3 4 5; do echo dt_clause_$n >> dt_clause_start_pcs.txt.check done -if ! awk '{print $2}' dt_clause_start_pcs.txt | diff - dt_clause_start_pcs.txt.check; then +if ! gawk '{print $2}' dt_clause_start_pcs.txt | diff - dt_clause_start_pcs.txt.check; then echo ERROR: did not find all expected dt_clause_n dump_files disasm.out dt_clause_start_pcs.txt fi
@@ -94,10 +94,10 @@ fi # dt_probe_error() is the problematic one. We look for those calls. for n in 1 2 3 4; do # For dt_clause_$n, find the starting PC. - pc=`awk '$2 == "dt_clause_'$n'" { print $1 }' dt_clause_start_pcs.txt` + pc=`gawk '$2 == "dt_clause_'$n'" { print $1 }' dt_clause_start_pcs.txt` # Look for the starting PC and then the second dt_probe_error(). - awk ' + gawk ' BEGIN { phase = 0 } # Look for disassembly of dtrace:::BEGIN.
@@ -120,7 +120,7 @@ done # Do a sanity check on DTrace's error output. -awk '/^dtrace: error in dt_clause_[1-4] for probe ID 1 \(dtrace:::BEGIN): invalid address \(0x40) at BPF pc [0-9]*$/ { print $NF }' \ +gawk '/^dtrace: error in dt_clause_[1-4] for probe ID 1 \(dtrace:::BEGIN): invalid address \(0x40) at BPF pc [0-9]*$/ { print $NF }' \ disasm.out > err_pcs.txt.chk1 if ! diff -q err_pcs.txt err_pcs.txt.chk1; then echo ERROR: problem with DTrace error output
@@ -130,7 +130,7 @@ fi # Check the D script output... the arg3 values reported by the dtrace:::ERROR probe. -if ! awk 'NF != 0 { print strtonum("0x"$NF) }' D.out | diff -q - err_pcs.txt; then +if ! gawk 'NF != 0 { print strtonum("0x"$NF) }' D.out | diff -q - err_pcs.txt; then echo ERROR: D script output looks wrong dump_files D.out err_pcs.txt exit 1
Signature · 1 line
2.48.1
PATCH 4/4 test: allow overriding CC, OBJCOPY, OBJDUMP, NM, ...
In reply to Sam James--- test/expensive/locking/tst.DestructionDoubleUnlock.sh | 2 +- test/internals/headers/tst.header-endianness.sh | 2 +- test/unittest/aggs/tst.aggmod_full2.sh | 2 +- test/unittest/arrays/tst.uregsarray-check.sh | 2 +- test/unittest/bitfields/tst.bitfield-offset.x | 8 ++++---- test/unittest/builtinvar/tst.errno3.sh | 2 +- test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh | 2 +- test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh | 2 +- test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh | 2 +- test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh | 2 +- test/unittest/misc/tst.include.sh | 2 +- test/unittest/options/tst.ctypes.sh | 6 +++--- test/unittest/options/tst.dtypes.sh | 6 +++--- test/unittest/options/tst.linktype.sh | 4 ++-- test/unittest/options/tst.strip.sh | 4 ++-- test/unittest/pid/tst.offsets.sh | 2 +- test/unittest/usdt/tst.allargs.sh | 2 +- test/unittest/usdt/tst.badguess.sh | 2 +- test/unittest/usdt/tst.dlclose1.sh | 2 +- test/unittest/usdt/tst.dlclose2.sh | 2 +- test/unittest/usdt/tst.dlclose3.sh | 2 +- test/unittest/usdt/tst.eliminate.sh | 6 +++--- test/unittest/usdt/tst.enabled.sh | 2 +- test/unittest/usdt/tst.enabled2.sh | 2 +- test/unittest/usdt/tst.entryreturn.sh | 2 +- test/unittest/usdt/tst.exec-dof-replacement.sh | 2 +- test/unittest/usdt/tst.execstack.sh | 6 +++--- test/unittest/usdt/tst.fork.sh | 2 +- test/unittest/usdt/tst.guess32.sh | 2 +- test/unittest/usdt/tst.guess64.sh | 2 +- test/unittest/usdt/tst.header.sh | 2 +- test/unittest/usdt/tst.lingering.sh | 2 +- test/unittest/usdt/tst.link-idempotence.sh | 2 +- test/unittest/usdt/tst.linkpriv.sh | 2 +- test/unittest/usdt/tst.linkunpriv.sh | 2 +- test/unittest/usdt/tst.manyprobes.sh | 2 +- test/unittest/usdt/tst.manyprocs.sh | 2 +- test/unittest/usdt/tst.multiple.sh | 2 +- test/unittest/usdt/tst.multitrace.sh | 2 +- test/unittest/usdt/tst.onlyenabled.sh | 2 +- test/unittest/usdt/tst.pie.sh | 2 +- test/unittest/usdt/tst.reeval.sh | 2 +- test/unittest/usdt/tst.static.sh | 2 +- test/unittest/usdt/tst.static2.sh | 2 +- test/unittest/usdt/tst.user.sh | 2 +- test/utils/workload_analyze_loop.sh | 2 +- 46 files changed, 59 insertions(+), 59 deletions(-)
test/expensive/locking/tst.DestructionDoubleUnlock.sh +1 -1
@@ -28,7 +28,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/destruction-double-unlock.$$.$RANDOM"
test/internals/headers/tst.header-endianness.sh +1 -1
@@ -10,7 +10,7 @@ set -e dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} OLDDIRNAME=${PWD} CFLAGS="-I${OLDDIRNAME}/include -I${OLDDIRNAME}/uts/common"
test/unittest/aggs/tst.aggmod_full2.sh +1 -1
@@ -17,7 +17,7 @@ ## dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/aggs-aggmod_full2.$$.$RANDOM"
test/unittest/arrays/tst.uregsarray-check.sh +1 -1
@@ -7,7 +7,7 @@ # dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/arrays-uregsarray-check.$$.$RANDOM"
test/unittest/bitfields/tst.bitfield-offset.x +4 -4
@@ -12,8 +12,8 @@ # skip the test, since we can't possibly tell what it was # generated by. -if ! objdump --ctf=.ctf --ctf-parent=shared_ctf /bin/true > /dev/null 2>&1 && \ - LANG=C objdump --ctf=.ctf --ctf-parent=shared_ctf /bin/true 2>&1 | \ +if ! ${OBJDUMP:-objdump} --ctf=.ctf --ctf-parent=shared_ctf /bin/true > /dev/null 2>&1 && \ + LANG=C ${OBJDUMP:-objdump} --ctf=.ctf --ctf-parent=shared_ctf /bin/true 2>&1 | \ grep 'unrecognized option' > /dev/null 2>&1; then exit 2 fi
@@ -21,7 +21,7 @@ fi ctfa=$tmpdir/vmlinux.ctfa trap "rm -f $ctfa" EXIT ERR -objcopy --add-section=.ctf=/lib/modules/$(uname -r)/kernel/vmlinux.ctfa /bin/true $ctfa +${OBJCOPY:-objcopy} --add-section=.ctf=/lib/modules/$(uname -r)/kernel/vmlinux.ctfa /bin/true $ctfa -objdump --ctf=.ctf --ctf-parent=shared_ctf $ctfa |\ +${OBJDUMP:-objdump} --ctf=.ctf --ctf-parent=shared_ctf $ctfa |\ gawk '/Version: 3/ { exit 1; } /Version: / { exit 0; }'
test/unittest/builtinvar/tst.errno3.sh +1 -1
@@ -7,7 +7,7 @@ # dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} DIRNAME="$tmpdir/builtinvar-errno3.$$.$RANDOM" mkdir -p $DIRNAME
test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh +1 -1
@@ -22,7 +22,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/list-probes-func-usdt.$$.$RANDOM"
test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh +1 -1
@@ -22,7 +22,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/list-probes-module-usdt.$$.$RANDOM"
test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh +1 -1
@@ -22,7 +22,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/list-probes-name-usdt.$$.$RANDOM"
test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh +1 -1
@@ -22,7 +22,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/list-probes-provider-usdt.$$.$RANDOM"
test/unittest/misc/tst.include.sh +1 -1
@@ -13,7 +13,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIR="$tmpdir/misc-include.$$.$RANDOM"
test/unittest/options/tst.ctypes.sh +3 -3
@@ -14,14 +14,14 @@ if [ ! -r $tmpdir/ctypes.ctf ]; then exit 1 fi -if objdump --help | grep ctf >/dev/null; then - objcopy --add-section=.ctf=$tmpdir/ctypes.ctf /bin/true $tmpdir/ctypes.o +if ${OBJDUMP:-objdump} --help | grep ctf >/dev/null; then + ${OBJCOPY:-objcopy} --add-section=.ctf=$tmpdir/ctypes.ctf /bin/true $tmpdir/ctypes.o if [ $? -ne 0 ]; then echo "ERROR: Failed to create ELF object from ctypes.ctf" exit 1 fi - objdump --ctf=.ctf $tmpdir/ctypes.o | \ + ${OBJDUMP:-objdump} --ctf=.ctf $tmpdir/ctypes.o | \ gawk '/CTF_VERSION/ { found = 1; next; } found && $1 ~ /0x[0-9A-Fa-f]+:/ { cnt++; next; } END { print "C CTF data" (found ? " " : " NOT ") "found";
test/unittest/options/tst.dtypes.sh +3 -3
@@ -14,14 +14,14 @@ if [ ! -r $tmpdir/dtypes.ctf ]; then exit 1 fi -if objdump --help | grep ctf >/dev/null; then - objcopy --add-section=.ctf=$tmpdir/dtypes.ctf /bin/true $tmpdir/dtypes.o +if ${OBJDUMP:-objdump} --help | grep ctf >/dev/null; then + ${OBJCOPY:-objcopy} --add-section=.ctf=$tmpdir/dtypes.ctf /bin/true $tmpdir/dtypes.o if [ $? -ne 0 ]; then echo "ERROR: Failed to create ELF object from dtypes.ctf" exit 1 fi - objdump --ctf=.ctf $tmpdir/dtypes.o | \ + ${OBJDUMP:-objdump} --ctf=.ctf $tmpdir/dtypes.o | \ gawk '/CTF_VERSION/ { found = 1; next; } found && $1 ~ /0x[0-9A-Fa-f]+:/ { cnt++; next; } END { print "D CTF data" (found ? " " : " NOT ") "found";
test/unittest/options/tst.linktype.sh +2 -2
@@ -9,7 +9,7 @@ # @@nosort dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/linktype.$$.$RANDOM"
@@ -61,7 +61,7 @@ function mytest() { fi # report whether the file format is recognized - objdump --file-headers prov.o |& gawk ' + ${OBJDUMP:-objdump} --file-headers prov.o |& gawk ' /format not recognized/ { print "objdump does NOT recognize file format"; exit(0);
test/unittest/options/tst.strip.sh +2 -2
@@ -7,7 +7,7 @@ # dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/strip.$$.$RANDOM"
@@ -48,7 +48,7 @@ fi # link with and without -xstrip, dumping the DOF section -objdump="objdump --full-contents --section=.SUNW_dof prov.o" +objdump="${OBJDUMP:-objdump} --full-contents --section=.SUNW_dof prov.o" $dtrace $dt_flags -G -xstrip -s prov.d test.o if [ $? -ne 0 ]; then
test/unittest/pid/tst.offsets.sh +1 -1
@@ -85,7 +85,7 @@ fi # hot and cold instructions in the function. # -objdump -d a.out | gawk ' +${OBJDUMP:-objdump} -d a.out | gawk ' BEGIN { pc0 = 0; # First PC of loopfunc() pcjump = 0; # PC of the jump
test/unittest/usdt/tst.allargs.sh +1 -1
@@ -15,7 +15,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="-std=gnu89 $test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.badguess.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.dlclose1.sh +1 -1
@@ -29,7 +29,7 @@ # The second should not. dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/usdt-dlclose1.$$.$RANDOM"
test/unittest/usdt/tst.dlclose2.sh +1 -1
@@ -15,7 +15,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/usdt-dlclose2.$$.$RANDOM"
test/unittest/usdt/tst.dlclose3.sh +1 -1
@@ -21,7 +21,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/usdt-dlclose3.$$.$RANDOM"
test/unittest/usdt/tst.eliminate.sh +3 -3
@@ -16,7 +16,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
@@ -71,13 +71,13 @@ if [ $? -ne 0 ]; then exit 1 fi -nm test.o | grep \$dtrace > /dev/null +${NM:-nm} test.o | grep \$dtrace > /dev/null if [ $? -ne 0 ]; then echo "no temporary symbols in the object file" >& 2 exit 1 fi -nm test | grep \$dtrace > /dev/null +${NM:-nm} test | grep \$dtrace > /dev/null if [ $? -eq 0 ]; then echo "failed to eliminate temporary symbols" >& 2 exit 1
test/unittest/usdt/tst.enabled.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.enabled2.sh +1 -1
@@ -15,7 +15,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.entryreturn.sh +1 -1
@@ -13,7 +13,7 @@ fi # @@xfail: dtv2, no wildcard usdt probes yet dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.exec-dof-replacement.sh +1 -1
@@ -14,7 +14,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.execstack.sh +3 -3
@@ -11,11 +11,11 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" -OBJDUMP=/usr/bin/objdump -READELF=/usr/bin/readelf +OBJDUMP=${OBJDUMP:-/usr/bin/objdump} +READELF=${READELF:-/usr/bin/readelf} DIRNAME="$tmpdir/usdt-execstack.$$.$RANDOM" mkdir -p $DIRNAME
test/unittest/usdt/tst.fork.sh +1 -1
@@ -12,7 +12,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.guess32.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.guess64.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.header.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.lingering.sh +1 -1
@@ -14,7 +14,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.link-idempotence.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.linkpriv.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="-std=gnu99 $test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.linkunpriv.sh +1 -1
@@ -13,7 +13,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" DIRNAME="$tmpdir/usdt-linkunpriv.$$.$RANDOM"
test/unittest/usdt/tst.manyprobes.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-manyprobes.$$.$RANDOM"
test/unittest/usdt/tst.manyprocs.sh +1 -1
@@ -14,7 +14,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.multiple.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.multitrace.sh +1 -1
@@ -14,7 +14,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.onlyenabled.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.pie.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="-fno-inline -pie $test_cppflags" LDFLAGS="-pie $test_ldflags"
test/unittest/usdt/tst.reeval.sh +1 -1
@@ -12,7 +12,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.static.sh +1 -1
@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.static2.sh +1 -1
@@ -15,7 +15,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/unittest/usdt/tst.user.sh +1 -1
@@ -13,7 +13,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"
test/utils/workload_analyze_loop.sh +1 -1
@@ -13,7 +13,7 @@ if [ ! -e $prog ]; then exit 1 fi -objdump -d $prog | gawk -v myarch=$(uname -m) ' +${OBJDUMP:-objdump} -d $prog | gawk -v myarch=$(uname -m) ' # decide whether to track instructions (which we number n = 1, 2, 3, ...) or not (n < 0) # specifically, do not track instructions until we find the disassembly for <main> BEGIN { n = -1; }
Signature · 1 line
2.48.1
Re: [PATCH 1/4] test: fix 'harness' typo
In reply to Sam JamesQuoted 34 lines · Sam James
Noticed when grepping for something else.
Signed-off-by Sam James <[email protected]>--- test/unittest/io/check_io_probe_args.sh | 2 +- test/unittest/io/dump_io_probe_args.d | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)test/unittest/io/check_io_probe_args.sh +1
-1@@ -6,7 +6,7 @@ # http://oss.oracle.com/licenses/upl. # -# @@skip: not used directly by the test hardness; called by other scripts +# @@skip: not used directly by the test harness; called by other scripts # infile=$1test/unittest/io/dump_io_probe_args.d +1
-1@@ -4,7 +4,7 @@ * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ -/* @@skip: not used directly by the test hardness; called by other scripts */ +/* @@skip: not used directly by the test harness; called by other scripts */ /* * For all io::: probes, dump "all" probe arguments (and their interesting members).
Re: [PATCH 2/4] test: fix bashism in tst.bitfield-offset.x
In reply to Sam JamesQuoted 19 lines · Sam James
trap ERR is a bashism and won't work with e.g. dash, just change the shebang to #!/bin/bash in this case as ERR is a bit messy to handle (it'd be trivial here but there's no real reason to not use bash).
Signed-off-by Sam James <[email protected]>--- test/unittest/bitfields/tst.bitfield-offset.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)test/unittest/bitfields/tst.bitfield-offset.x +1
-1@@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. #
Re: [PATCH 3/4] test: finalize porting small awk stragglers to gawk
In reply to Sam Jamesbut I think we need updated copyright years for test/unittest/builtinvar/tst.id_ERROR.sh test/unittest/variables/bvar/tst.arg3-ERROR-b.sh test/unittest/variables/bvar/tst.arg3-ERROR.sh
Also, at this point there are other "awk" instances on origin/dev. (You're welcome. Oops. Sorry. I bet a lot of these are from me.) I'm okay with going with this patch and then iterating further with a later patch. I can imagine such awk stragglers will continue to find their way into the code. Anyhow, here are other awk instances on origin/dev:
test/unittest/funcs/err.badalloca.r.p:#!/usr/bin/awk -f
test/unittest/pid/tst.entry_off0.sh:awk '$2 == "0" || $2 == "entry"' D.out | awk '
test/unittest/pid/tst.newprobes.sh:pid*:awk::
test/unittest/pid/tst.newprobes.sh: system("$dtrace $dt_flags -c awk -n 'pid\$target::main:entry{exit(0);}' >/dev/null 2>&1");
test/unittest/pid/tst.newprobes.sh: system("$dtrace $dt_flags -c awk -n 'pid\$target::main:entry{exit(0);}' >/dev/null 2>&1");
test/unittest/stack/tst.stack_fbt.sh:awk 'NF != 0 { sub(/+0x[0-9a-f]*$/, "+{ptr}"); print }' dtrace.out > dtrace.post
test/unittest/usdt/tst.defer-Z.sh: awk '
test/unittest/usdt/tst.defer-Z.sh:awk 'NF != 0 { print $1, $2, $3 }' dtrace.out | sort > dtrace.out.post
test/unittest/usdt/tst.defer-nodtrace.sh:if ! awk '{ $2 = "undefined"; print }' main.out | diff -q - main.out.expected; then
test/unittest/usdt/tst.defer.sh: awk '
test/unittest/usdt/tst.defer.sh:awk 'NF != 0 { print $1, $2, $3 }' dtrace.out | sort > dtrace.out.post
test/unittest/usdt/tst.dlclose4.sh: $dtrace $dt_flags -lP test_prov$pid |& awk '
test/unittest/usdt/tst.enable_pid.r.p:#!/usr/bin/awk -f
test/unittest/usdt/tst.nusdtprobes.sh: awk 'NF == 5 { print $1, $2, $3, $4 }' dtrace.out | sort > dtrace.out.sorted
test/unittest/usdt/tst.pidprobes.sh:if [ awk 'NF != 0 { print $1 }' dtrace.out | uniq | wc -l -ne 1 ]; then
test/unittest/usdt/tst.pidprobes.sh:pid=awk 'NF != 0 { print $1 }' dtrace.out | uniq
test/unittest/usdt/tst.pidprobes.sh:objdump -d main | awk '
test/unittest/usdt/tst.pidprobes.sh:pcs=awk '{print strtonum("0x"$1)}' disasm_foo.txt
test/unittest/usdt/tst.pidprobes.sh:pc0=echo $pcs | awk '{print $1}'
test/unittest/usdt/tst.pidprobes.sh: usdt_pcs_all=`awk '
test/unittest/usdt/tst.pidprobes.sh: if [ echo $usdt_pcs_all | awk '{print NF}' -ne 4 ]; then
test/unittest/usdt/tst.pidprobes.sh: usdt_pcs=echo $usdt_pcs_all | awk '{ print $1, $3 }'
test/unittest/usdt/tst.pidprobes.sh: usdt_pcs_isenabled=echo $usdt_pcs_all | awk '{ print $2, $4 }'
test/unittest/usdt/tst.pidprobes.sh: usdt_pcs=awk '/<__dtrace_pyramid___entry>/ { print strtonum("0x"$1) + '$pc0' }' disasm_foo.txt.before
test/unittest/usdt/tst.pidprobes.sh: usdt_pcs_isenabled=`awk '/<__dtraceenabled_pyramid___entry>/ { print strtonum("0x"$1) + '$pc0' }' disasm_foo.t
xt.before`
test/unittest/usdt/tst.pidprobes.sh: if [ echo $usdt_pcs | awk '{print NF}' -ne 2 -o \
test/unittest/usdt/tst.pidprobes.sh: echo $usdt_pcs_isenabled | awk '{print NF}' -ne 2 ]; then
test/unittest/usdt/tst.pidprobes.sh:pc_return=awk '/'$pid' pid'$pid':main:foo:return/ { print $NF }' dtrace.out
test/unittest/usdt/tst.pidprobes.sh:objdump -d main | awk '
test/unittest/usdt/tst.pidprobes.sh:echo $usdt_pcs | awk '{printf("'$pid' pyramid'$pid':main:foo:entry %x\n", $1);}' >> dtrace.out.expected
test/unittest/usdt/tst.pidprobes.sh:echo $usdt_pcs | awk '{printf("'$pid' pyramid'$pid':main:foo:entry %x\n", $2);}' >> dtrace.out.expected
Quoted 109 lines · Sam James
We missed some in
8a1264bf0e818c8624be250eb5174714b62ed93cbecause some other test changes landed before it landed.Signed-off-by Sam James <[email protected]>--- test/unittest/builtinvar/tst.id_ERROR.sh | 2 +- test/unittest/error/tst.clause_scope-regular.r.p | 2 +- test/unittest/variables/bvar/tst.arg3-ERROR-b.sh | 2 +- test/unittest/variables/bvar/tst.arg3-ERROR.sh | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-)test/unittest/builtinvar/tst.id_ERROR.sh +1
-1@@ -30,7 +30,7 @@ fi # Get the ERROR probe ID from "dtrace -l" output. -id=`$dtrace $dt_flags -ln dtrace:::ERROR |& awk '/^ *[0-9]* *dtrace *ERROR *$/ { print $1 }'` +id=`$dtrace $dt_flags -ln dtrace:::ERROR |& gawk '/^ *[0-9]* *dtrace *ERROR *$/ { print $1 }'` # Construct expected output.test/unittest/error/tst.clause_scope-regular.r.p +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/awk -f +#!/usr/bin/gawk -f # This report has a variable probe ID in it. {test/unittest/variables/bvar/tst.arg3-ERROR-b.sh +1
-1@@ -50,7 +50,7 @@ BEGIN } EOT -awk 'BEGIN { +gawk 'BEGIN { ok = 0; }test/unittest/variables/bvar/tst.arg3-ERROR.sh +7
-7@@ -49,7 +49,7 @@ fi # Parse the disassembly output for start PCs for the dt_clause_n. -awk ' +gawk ' BEGIN { phase = 0 } # Look for disassembly of dtrace:::BEGIN.@@ -70,7 +70,7 @@ phase == 3 && NF == 0 { exit(0) } phase == 3 { next } ' disasm.out > dt_clause_start_pcs.txt if [ $? -ne 0 ]; then - echo ERROR: awk + echo ERROR: gawk dump_files disasm.out dt_clause_start_pcs.txt exit 1 fi@@ -80,7 +80,7 @@ fi for n in 0 1 2 3 4 5; do echo dt_clause_$n >> dt_clause_start_pcs.txt.check done -if ! awk '{print $2}' dt_clause_start_pcs.txt | diff - dt_clause_start_pcs.txt.check; then +if ! gawk '{print $2}' dt_clause_start_pcs.txt | diff - dt_clause_start_pcs.txt.check; then echo ERROR: did not find all expected dt_clause_n dump_files disasm.out dt_clause_start_pcs.txt fi@@ -94,10 +94,10 @@ fi # dt_probe_error() is the problematic one. We look for those calls. for n in 1 2 3 4; do # For dt_clause_$n, find the starting PC. - pc=`awk '$2 == "dt_clause_'$n'" { print $1 }' dt_clause_start_pcs.txt` + pc=`gawk '$2 == "dt_clause_'$n'" { print $1 }' dt_clause_start_pcs.txt` # Look for the starting PC and then the second dt_probe_error(). - awk ' + gawk ' BEGIN { phase = 0 } # Look for disassembly of dtrace:::BEGIN.@@ -120,7 +120,7 @@ done # Do a sanity check on DTrace's error output. -awk '/^dtrace: error in dt_clause_[1-4] for probe ID 1 \(dtrace:::BEGIN): invalid address \(0x40) at BPF pc [0-9]*$/ { print $NF }' \ +gawk '/^dtrace: error in dt_clause_[1-4] for probe ID 1 \(dtrace:::BEGIN): invalid address \(0x40) at BPF pc [0-9]*$/ { print $NF }' \ disasm.out > err_pcs.txt.chk1 if ! diff -q err_pcs.txt err_pcs.txt.chk1; then echo ERROR: problem with DTrace error output@@ -130,7 +130,7 @@ fi # Check the D script output... the arg3 values reported by the dtrace:::ERROR probe. -if ! awk 'NF != 0 { print strtonum("0x"$NF) }' D.out | diff -q - err_pcs.txt; then +if ! gawk 'NF != 0 { print strtonum("0x"$NF) }' D.out | diff -q - err_pcs.txt; then echo ERROR: D script output looks wrong dump_files D.out err_pcs.txt exit 1
Re: [PATCH 4/4] test: allow overriding CC, OBJCOPY, OBJDUMP, NM, ...
In reply to Sam JamesI'm open to signing off on this patch, but I have some questions:
*) You said you'd do a full test run. Did that happen?
*) If objdump is used several times in a script, how about setting it once and then reusing the same definition? E.g., test/unittest/bitfields/tst.bitfield-offset.x
test/unittest/options/tst.ctypes.sh
test/unittest/options/tst.dtypes.sh
Same for nm:
test/unittest/usdt/tst.eliminate.sh
But wait, before you answer that question...
*) How about just setting
CC=...
NM=...
OBJCOPY=...
OBJDUMP=...
READELF=...
"once" in runtest.sh? Then use $CC, et al., everywhere, rather than replicating the assignments in all those different files.
*) By the way, more bare objdump instances have crept into origin/dev:
test/unittest/usdt/tst.pidprobes.sh
Sorry. I guess I'm to blame. (Recurring theme here. Oops. Sorry.)
*) Some files still have "CC=/usr/bin/gcc":
test/unittest/dtrace-util/tst.ListProbesArgsUSDT.sh test/unittest/usdt/tst.dlclose4.sh test/unittest/usdt/tst.enable_pid.sh test/unittest/usdt/tst.multiprov-dupprobe-shlibs.sh
*) Some files still have "gcc" hardwired in:
test/stress/options/tst.cpu-syscall.sh test/unittest/funcs/copyout/tst.copyout.sh test/unittest/funcs/copyoutstr/tst.copyoutstr.sh test/unittest/options/tst.cpu-syscall.sh test/unittest/pid/tst.offsets.sh test/unittest/usdt/tst.badguess.x test/unittest/usdt/tst.nusdtprobes.sh
*) Some still have "cc" hardwired in:
test/unittest/pid/tst.provregex1.sh
test/unittest/pid/tst.provregex2.sh
test/unittest/pid/tst.provregex3.sh
test/unittest/pid/tst.provregex4.sh
test/unittest/usdt/tst.enable_pid.sh
test/unittest/usdt/tst.pidprobes.sh
*) A lot of files need updated Copyright years:
test/expensive/locking/tst.DestructionDoubleUnlock.sh test/internals/headers/tst.header-endianness.sh test/unittest/aggs/tst.aggmod_full2.sh test/unittest/arrays/tst.uregsarray-check.sh test/unittest/builtinvar/tst.errno3.sh test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh test/unittest/misc/tst.include.sh test/unittest/options/tst.ctypes.sh test/unittest/options/tst.dtypes.sh test/unittest/options/tst.linktype.sh test/unittest/options/tst.strip.sh test/unittest/pid/tst.offsets.sh test/unittest/usdt/tst.allargs.sh test/unittest/usdt/tst.badguess.sh test/unittest/usdt/tst.dlclose1.sh test/unittest/usdt/tst.dlclose2.sh test/unittest/usdt/tst.dlclose3.sh test/unittest/usdt/tst.eliminate.sh test/unittest/usdt/tst.enabled.sh test/unittest/usdt/tst.enabled2.sh test/unittest/usdt/tst.entryreturn.sh test/unittest/usdt/tst.exec-dof-replacement.sh test/unittest/usdt/tst.execstack.sh test/unittest/usdt/tst.fork.sh test/unittest/usdt/tst.guess32.sh test/unittest/usdt/tst.guess64.sh test/unittest/usdt/tst.header.sh test/unittest/usdt/tst.lingering.sh test/unittest/usdt/tst.link-idempotence.sh test/unittest/usdt/tst.linkpriv.sh test/unittest/usdt/tst.linkunpriv.sh test/unittest/usdt/tst.manyprobes.sh test/unittest/usdt/tst.manyprocs.sh test/unittest/usdt/tst.multiple.sh test/unittest/usdt/tst.multitrace.sh test/unittest/usdt/tst.onlyenabled.sh test/unittest/usdt/tst.pie.sh test/unittest/usdt/tst.reeval.sh test/unittest/usdt/tst.static.sh test/unittest/usdt/tst.static2.sh test/unittest/usdt/tst.user.sh test/utils/workload_analyze_loop.sh
Quoted 719 lines · Sam James
--- test/expensive/locking/tst.DestructionDoubleUnlock.sh | 2 +- test/internals/headers/tst.header-endianness.sh | 2 +- test/unittest/aggs/tst.aggmod_full2.sh | 2 +- test/unittest/arrays/tst.uregsarray-check.sh | 2 +- test/unittest/bitfields/tst.bitfield-offset.x | 8 ++++---- test/unittest/builtinvar/tst.errno3.sh | 2 +- test/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh | 2 +- test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh | 2 +- test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh | 2 +- test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh | 2 +- test/unittest/misc/tst.include.sh | 2 +- test/unittest/options/tst.ctypes.sh | 6 +++--- test/unittest/options/tst.dtypes.sh | 6 +++--- test/unittest/options/tst.linktype.sh | 4 ++-- test/unittest/options/tst.strip.sh | 4 ++-- test/unittest/pid/tst.offsets.sh | 2 +- test/unittest/usdt/tst.allargs.sh | 2 +- test/unittest/usdt/tst.badguess.sh | 2 +- test/unittest/usdt/tst.dlclose1.sh | 2 +- test/unittest/usdt/tst.dlclose2.sh | 2 +- test/unittest/usdt/tst.dlclose3.sh | 2 +- test/unittest/usdt/tst.eliminate.sh | 6 +++--- test/unittest/usdt/tst.enabled.sh | 2 +- test/unittest/usdt/tst.enabled2.sh | 2 +- test/unittest/usdt/tst.entryreturn.sh | 2 +- test/unittest/usdt/tst.exec-dof-replacement.sh | 2 +- test/unittest/usdt/tst.execstack.sh | 6 +++--- test/unittest/usdt/tst.fork.sh | 2 +- test/unittest/usdt/tst.guess32.sh | 2 +- test/unittest/usdt/tst.guess64.sh | 2 +- test/unittest/usdt/tst.header.sh | 2 +- test/unittest/usdt/tst.lingering.sh | 2 +- test/unittest/usdt/tst.link-idempotence.sh | 2 +- test/unittest/usdt/tst.linkpriv.sh | 2 +- test/unittest/usdt/tst.linkunpriv.sh | 2 +- test/unittest/usdt/tst.manyprobes.sh | 2 +- test/unittest/usdt/tst.manyprocs.sh | 2 +- test/unittest/usdt/tst.multiple.sh | 2 +- test/unittest/usdt/tst.multitrace.sh | 2 +- test/unittest/usdt/tst.onlyenabled.sh | 2 +- test/unittest/usdt/tst.pie.sh | 2 +- test/unittest/usdt/tst.reeval.sh | 2 +- test/unittest/usdt/tst.static.sh | 2 +- test/unittest/usdt/tst.static2.sh | 2 +- test/unittest/usdt/tst.user.sh | 2 +- test/utils/workload_analyze_loop.sh | 2 +- 46 files changed, 59 insertions(+), 59 deletions(-)test/expensive/locking/tst.DestructionDoubleUnlock.sh +1
-1@@ -28,7 +28,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/destruction-double-unlock.$$.$RANDOM"test/internals/headers/tst.header-endianness.sh +1
-1@@ -10,7 +10,7 @@ set -e dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} OLDDIRNAME=${PWD} CFLAGS="-I${OLDDIRNAME}/include -I${OLDDIRNAME}/uts/common"test/unittest/aggs/tst.aggmod_full2.sh +1
-1@@ -17,7 +17,7 @@ ## dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/aggs-aggmod_full2.$$.$RANDOM"test/unittest/arrays/tst.uregsarray-check.sh +1
-1@@ -7,7 +7,7 @@ # dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/arrays-uregsarray-check.$$.$RANDOM"test/unittest/bitfields/tst.bitfield-offset.x +4
-4@@ -12,8 +12,8 @@ # skip the test, since we can't possibly tell what it was # generated by. -if ! objdump --ctf=.ctf --ctf-parent=shared_ctf /bin/true > /dev/null 2>&1 && \ - LANG=C objdump --ctf=.ctf --ctf-parent=shared_ctf /bin/true 2>&1 | \ +if ! ${OBJDUMP:-objdump} --ctf=.ctf --ctf-parent=shared_ctf /bin/true > /dev/null 2>&1 && \ + LANG=C ${OBJDUMP:-objdump} --ctf=.ctf --ctf-parent=shared_ctf /bin/true 2>&1 | \ grep 'unrecognized option' > /dev/null 2>&1; then exit 2 fi@@ -21,7 +21,7 @@ fi ctfa=$tmpdir/vmlinux.ctfa trap "rm -f $ctfa" EXIT ERR -objcopy --add-section=.ctf=/lib/modules/$(uname -r)/kernel/vmlinux.ctfa /bin/true $ctfa +${OBJCOPY:-objcopy} --add-section=.ctf=/lib/modules/$(uname -r)/kernel/vmlinux.ctfa /bin/true $ctfa -objdump --ctf=.ctf --ctf-parent=shared_ctf $ctfa |\ +${OBJDUMP:-objdump} --ctf=.ctf --ctf-parent=shared_ctf $ctfa |\ gawk '/Version: 3/ { exit 1; } /Version: / { exit 0; }'test/unittest/builtinvar/tst.errno3.sh +1
-1@@ -7,7 +7,7 @@ # dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} DIRNAME="$tmpdir/builtinvar-errno3.$$.$RANDOM" mkdir -p $DIRNAMEtest/unittest/dtrace-util/tst.ListProbesFuncUSDT.sh +1
-1@@ -22,7 +22,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/list-probes-func-usdt.$$.$RANDOM"test/unittest/dtrace-util/tst.ListProbesModuleUSDT.sh +1
-1@@ -22,7 +22,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/list-probes-module-usdt.$$.$RANDOM"test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh +1
-1@@ -22,7 +22,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/list-probes-name-usdt.$$.$RANDOM"test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh +1
-1@@ -22,7 +22,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/list-probes-provider-usdt.$$.$RANDOM"test/unittest/misc/tst.include.sh +1
-1@@ -13,7 +13,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIR="$tmpdir/misc-include.$$.$RANDOM"test/unittest/options/tst.ctypes.sh +3
-3@@ -14,14 +14,14 @@ if [ ! -r $tmpdir/ctypes.ctf ]; then exit 1 fi -if objdump --help | grep ctf >/dev/null; then - objcopy --add-section=.ctf=$tmpdir/ctypes.ctf /bin/true $tmpdir/ctypes.o +if ${OBJDUMP:-objdump} --help | grep ctf >/dev/null; then + ${OBJCOPY:-objcopy} --add-section=.ctf=$tmpdir/ctypes.ctf /bin/true $tmpdir/ctypes.o if [ $? -ne 0 ]; then echo "ERROR: Failed to create ELF object from ctypes.ctf" exit 1 fi - objdump --ctf=.ctf $tmpdir/ctypes.o | \ + ${OBJDUMP:-objdump} --ctf=.ctf $tmpdir/ctypes.o | \ gawk '/CTF_VERSION/ { found = 1; next; } found && $1 ~ /0x[0-9A-Fa-f]+:/ { cnt++; next; } END { print "C CTF data" (found ? " " : " NOT ") "found";test/unittest/options/tst.dtypes.sh +3
-3@@ -14,14 +14,14 @@ if [ ! -r $tmpdir/dtypes.ctf ]; then exit 1 fi -if objdump --help | grep ctf >/dev/null; then - objcopy --add-section=.ctf=$tmpdir/dtypes.ctf /bin/true $tmpdir/dtypes.o +if ${OBJDUMP:-objdump} --help | grep ctf >/dev/null; then + ${OBJCOPY:-objcopy} --add-section=.ctf=$tmpdir/dtypes.ctf /bin/true $tmpdir/dtypes.o if [ $? -ne 0 ]; then echo "ERROR: Failed to create ELF object from dtypes.ctf" exit 1 fi - objdump --ctf=.ctf $tmpdir/dtypes.o | \ + ${OBJDUMP:-objdump} --ctf=.ctf $tmpdir/dtypes.o | \ gawk '/CTF_VERSION/ { found = 1; next; } found && $1 ~ /0x[0-9A-Fa-f]+:/ { cnt++; next; } END { print "D CTF data" (found ? " " : " NOT ") "found";test/unittest/options/tst.linktype.sh +2
-2@@ -9,7 +9,7 @@ # @@nosort dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/linktype.$$.$RANDOM"@@ -61,7 +61,7 @@ function mytest() { fi # report whether the file format is recognized - objdump --file-headers prov.o |& gawk ' + ${OBJDUMP:-objdump} --file-headers prov.o |& gawk ' /format not recognized/ { print "objdump does NOT recognize file format"; exit(0);test/unittest/options/tst.strip.sh +2
-2@@ -7,7 +7,7 @@ # dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/strip.$$.$RANDOM"@@ -48,7 +48,7 @@ fi # link with and without -xstrip, dumping the DOF section -objdump="objdump --full-contents --section=.SUNW_dof prov.o" +objdump="${OBJDUMP:-objdump} --full-contents --section=.SUNW_dof prov.o" $dtrace $dt_flags -G -xstrip -s prov.d test.o if [ $? -ne 0 ]; thentest/unittest/pid/tst.offsets.sh +1
-1@@ -85,7 +85,7 @@ fi # hot and cold instructions in the function. # -objdump -d a.out | gawk ' +${OBJDUMP:-objdump} -d a.out | gawk ' BEGIN { pc0 = 0; # First PC of loopfunc() pcjump = 0; # PC of the jumptest/unittest/usdt/tst.allargs.sh +1
-1@@ -15,7 +15,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="-std=gnu89 $test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.badguess.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.dlclose1.sh +1
-1@@ -29,7 +29,7 @@ # The second should not. dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/usdt-dlclose1.$$.$RANDOM"test/unittest/usdt/tst.dlclose2.sh +1
-1@@ -15,7 +15,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/usdt-dlclose2.$$.$RANDOM"test/unittest/usdt/tst.dlclose3.sh +1
-1@@ -21,7 +21,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS= DIRNAME="$tmpdir/usdt-dlclose3.$$.$RANDOM"test/unittest/usdt/tst.eliminate.sh +3
-3@@ -16,7 +16,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"@@ -71,13 +71,13 @@ if [ $? -ne 0 ]; then exit 1 fi -nm test.o | grep \$dtrace > /dev/null +${NM:-nm} test.o | grep \$dtrace > /dev/null if [ $? -ne 0 ]; then echo "no temporary symbols in the object file" >& 2 exit 1 fi -nm test | grep \$dtrace > /dev/null +${NM:-nm} test | grep \$dtrace > /dev/null if [ $? -eq 0 ]; then echo "failed to eliminate temporary symbols" >& 2 exit 1test/unittest/usdt/tst.enabled.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.enabled2.sh +1
-1@@ -15,7 +15,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.entryreturn.sh +1
-1@@ -13,7 +13,7 @@ fi # @@xfail: dtv2, no wildcard usdt probes yet dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.exec-dof-replacement.sh +1
-1@@ -14,7 +14,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.execstack.sh +3
-3@@ -11,11 +11,11 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" -OBJDUMP=/usr/bin/objdump -READELF=/usr/bin/readelf +OBJDUMP=${OBJDUMP:-/usr/bin/objdump} +READELF=${READELF:-/usr/bin/readelf} DIRNAME="$tmpdir/usdt-execstack.$$.$RANDOM" mkdir -p $DIRNAMEtest/unittest/usdt/tst.fork.sh +1
-1@@ -12,7 +12,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.guess32.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.guess64.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.header.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.lingering.sh +1
-1@@ -14,7 +14,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.link-idempotence.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.linkpriv.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="-std=gnu99 $test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.linkunpriv.sh +1
-1@@ -13,7 +13,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" DIRNAME="$tmpdir/usdt-linkunpriv.$$.$RANDOM"test/unittest/usdt/tst.manyprobes.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags" DIRNAME="$tmpdir/usdt-manyprobes.$$.$RANDOM"test/unittest/usdt/tst.manyprocs.sh +1
-1@@ -14,7 +14,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.multiple.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.multitrace.sh +1
-1@@ -14,7 +14,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.onlyenabled.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.pie.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="-fno-inline -pie $test_cppflags" LDFLAGS="-pie $test_ldflags"test/unittest/usdt/tst.reeval.sh +1
-1@@ -12,7 +12,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.static.sh +1
-1@@ -11,7 +11,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.static2.sh +1
-1@@ -15,7 +15,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/unittest/usdt/tst.user.sh +1
-1@@ -13,7 +13,7 @@ if [ $# != 1 ]; then fi dtrace=$1 -CC=/usr/bin/gcc +CC=${CC:-/usr/bin/gcc} CFLAGS="$test_cppflags" LDFLAGS="$test_ldflags"test/utils/workload_analyze_loop.sh +1
-1@@ -13,7 +13,7 @@ if [ ! -e $prog ]; then exit 1 fi -objdump -d $prog | gawk -v myarch=$(uname -m) ' +${OBJDUMP:-objdump} -d $prog | gawk -v myarch=$(uname -m) ' # decide whether to track instructions (which we number n = 1, 2, 3, ...) or not (n < 0) # specifically, do not track instructions until we find the disassembly for <main> BEGIN { n = -1; }
Re: [PATCH 4/4] test: allow overriding CC, OBJCOPY, OBJDUMP, NM, ...
Quoted 1 line · Eugene Loh
I'm open to signing off on this patch, but I have some questions:
Thanks for the reviews. I'm just replying to let you know it may be a little while before I can handle answering & respinning.
Quoted 1 line
[...]
sam
Re: [PATCH 4/4] test: allow overriding CC, OBJCOPY, OBJDUMP, NM, ...
I went ahead and rebased the patch on origin/dev, incorporated my suggestions, and ran the test suite to check things out. I'll post a v2 of the patch momentarily. I hope that's okay. I don't mean to step on your toes, but the patch has so many little changes that it'd be nice to get these changes made and then adhere to the new practice.
Quoted 9 lines · Sam James
Quoted 1 line · Eugene Loh
I'm open to signing off on this patch, but I have some questions:
Thanks for the reviews. I'm just replying to let you know it may be a little while before I can handle answering & respinning.
Quoted 1 line
[...]
sam
Re: [PATCH 4/4] test: allow overriding CC, OBJCOPY, OBJDUMP, NM, ...
Quoted 5 lines · Eugene Loh
I went ahead and rebased the patch on origin/dev, incorporated my suggestions, and ran the test suite to check things out. I'll post a v2 of the patch momentarily. I hope that's okay. I don't mean to step on your toes, but the patch has so many little changes that it'd be nice to get these changes made and then adhere to the new practice.
Please do -- and thank you!
Quoted 11 lines · Sam James
Quoted 9 lines
Quoted 1 line · Eugene Loh
I'm open to signing off on this patch, but I have some questions:
Thanks for the reviews. I'm just replying to let you know it may be a little while before I can handle answering & respinning.
Quoted 1 line
[...]
sam