* testsuite/lib/systemtap.exp: Define here.
* testsuite/systemtap.*/*.exp: Use it here. Eliminate duplicated
utrace_support_present logic.
}
+proc utrace_p {} {
+ set path "/proc/kallsyms"
+ if {! [catch {exec grep -q utrace_attach $path} dummy]} {
+ return 1
+ } else {
+ return 0
+ }
+}
+
+
proc print_systemtap_version {} {
set version [exec /bin/uname -r]
set location "/boot/vmlinux-$version"
return
}
-# Try to find utrace_attach symbol in /proc/kallsyms
-# copy from utrace_p5.exp
-set utrace_support_found 0
-set path "/proc/kallsyms"
-if {! [catch {exec grep -q utrace_attach $path} dummy]} {
- set utrace_support_found 1
-}
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
catch {exec rm -f $test}
untested "$test -p5"
return
catch {exec gcc -g -o bz6850 $srcdir/$subdir/bz6850.c} err
if {$err == "" && [file exists bz6850]} then { pass "$test compile" } else { fail "$test compile" }
-# Try to find utrace_attach symbol in /proc/kallsyms
-# copy from utrace_p5.exp
-set utrace_support_found 0
-set path "/proc/kallsyms"
-if {! [catch {exec grep -q utrace_attach $path} dummy]} {
- set utrace_support_found 1
-}
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
catch {exec rm -f $test}
untested "$test -p4"
untested "$test -p5"
# Initialize variables
-set utrace_support_found 0
set exepath "[pwd]/ls_[pid]"
set itrace1_script {
}
-# Try to find utrace_attach symbol in /proc/kallsyms
-set path "/proc/kallsyms"
-if {! [catch {exec grep -q utrace_attach $path} dummy]} {
- set utrace_support_found 1
-}
-
set TEST_NAME "itrace1"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
untested $TEST_NAME
set TEST_NAME "itrace2"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
untested $TEST_NAME
set test "labels"
if {![installtest_p]} {untested $test; return}
-
-# Try to find utrace_attach symbol in /proc/kallsyms
-# copy from utrace_p5.exp
-set utrace_support_found 0
-set path "/proc/kallsyms"
-if {! [catch {exec grep -q utrace_attach $path} dummy]} {
- set utrace_support_found 1
-}
-if {$utrace_support_found == 0} { untested "$test"; return }
+if {![utrace_p]} { untested $test; return }
# Compile a C program to use as the user-space probing target
set label_srcpath "[pwd]/labels.c"
}
if {![installtest_p]} {untested $test; return}
-
-# Try to find utrace_attach symbol in /proc/kallsyms
-# copy from utrace_p5.exp
-set utrace_support_found 0
-set path "/proc/kallsyms"
-if {! [catch {exec grep -q utrace_attach $path} dummy]} {
- set utrace_support_found 1
-}
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$test"
catch {exec rm -f $sup_srcpath}
return
catch {exec gcc -g -o jennie jennie.c} err
if {$err == "" && [file exists jennie]} then { pass "$test compile" } else { fail "$test compile" }
-# Try to find utrace_attach symbol in /proc/kallsyms
-# copy from utrace_p5.exp
-set utrace_support_found 0
-set path "/proc/kallsyms"
-if {! [catch {exec grep -q utrace_attach $path} dummy]} {
- set utrace_support_found 1
-}
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$test -p4"; untested "$test -p5"
catch {exec rm -f jennie.c jennie}
return
set testlibflags "$testflags additional_flags=-fPIC additional_flags=-shared"
set maintestflags "$testflags additional_flags=-L$testlibdir additional_flags=-l$testlibname additional_flags=-Wl,-rpath,$testlibdir"
-# Only run on make installcheck
-if {! [installtest_p]} { untested "$test"; return }
-
# Compile our test program and library.
set res [target_compile $testsrclib $testso executable $testlibflags]
if { $res != "" } {
verbose "target_compile for $testso failed: $res" 2
- fail "unable to compile $testsrclib"
+ fail "$test compile $testsrclib"
return
+} else {
+ pass "$test compile $testsrclib"
}
+
set res [target_compile $testsrc $testexe executable $maintestflags]
if { $res != "" } {
verbose "target_compile failed: $res" 2
- fail "unable to compile $testsrc"
+ fail "$test compile $testsrc"
return
+} else {
+ pass "$test compile $testsrc"
}
# XXX main_func needs another/extra test. Disabled for now.
# lib_func}
set ::result_string {lib_func}
+# Only run on make installcheck
+if {! [installtest_p]} { untested "$test"; return }
+if {! [utrace_p]} { untested $test; return }
stap_run2 $srcdir/$subdir/$test.stp -c $testexe
#exec rm -f $testexe $testso
# utrace doesn't exist in the kernel, marks the tests as 'untested'.
# Initialize variables
-set utrace_support_found 0
-
set begin_script {"probe process(\"/bin/ls\").begin { print(\"ls begin\") }"}
set end_script {"probe process(\"/bin/ls\").end { print(\"ls end\") }"}
set syscall_script {"probe process(\"/bin/ls\").syscall { printf(\"|%d\", \$syscall) }"}
set pid_thread_begin_script {"probe process(123).thread.begin { print(\"123 thread.begin\") }"}
set pid_thread_end_script {"probe process(123).thread.end { print(\"123 thread.end\") }"}
-# Try to find utrace_attach symbol in /proc/kallsyms
-set path "/proc/kallsyms"
-if {! [catch {exec grep -q utrace_attach $path} dummy]} {
- set utrace_support_found 1
-}
-
#
# Do some utrace compile tests.
#
set TEST_NAME "UTRACE_P4_01"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling a begin script using a path
}
set TEST_NAME "UTRACE_P4_01_pid"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling a begin script using a pid
}
set TEST_NAME "UTRACE_P4_02"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling a end script using a path
}
set TEST_NAME "UTRACE_P4_02_pid"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling a end script using a pid
}
set TEST_NAME "UTRACE_P4_03"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling a syscall script using a path
}
set TEST_NAME "UTRACE_P4_03_pid"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling a syscall script using a pid
}
set TEST_NAME "UTRACE_P4_04"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling a syscall return script using a path
}
set TEST_NAME "UTRACE_P4_04_pid"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling a syscall return script using a pid
}
set TEST_NAME "UTRACE_P4_05"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling an thread.begin script using a path
}
set TEST_NAME "UTRACE_P4_05_pid"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling an thread.begin script using a pid
}
set TEST_NAME "UTRACE_P4_06"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling an thread.end script using a path
}
set TEST_NAME "UTRACE_P4_06_pid"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling an thread.end script using a pid
}
set TEST_NAME "UTRACE_P4_07"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
# Try compiling an system-wide begin script
# Utrace run (pass 5) tests.
# Initialize variables
-set utrace_support_found 0
set exepath "[pwd]/cat_[pid]"
set multi_srcpath "$srcdir/systemtap.base/utrace_p5_multi.c"
set multi_exepath "[pwd]/utrace_p5_multi_[pid]"
}
set bz6841_script_output ".+ issues syscall \\d+ times\r\n"
-# Try to find utrace_attach symbol in /proc/kallsyms
-set path "/proc/kallsyms"
-if {! [catch {exec grep -q utrace_attach $path} dummy]} {
- set utrace_support_found 1
-}
-
# Set up our own copy of /bin/cat, to make testing for a particular
# executable easy. We can't use 'ln' here, since we might be creating
# a cross-device link. We can't use 'ln -s' here, since the kernel
}
set TEST_NAME "UTRACE_P5_01"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
untested "$TEST_NAME"
}
set TEST_NAME "UTRACE_P5_02"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
untested "$TEST_NAME"
}
set TEST_NAME "UTRACE_P5_03"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
untested "$TEST_NAME"
}
set TEST_NAME "UTRACE_P5_04"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
untested "$TEST_NAME"
}
set TEST_NAME "UTRACE_P5_05"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
untested "$TEST_NAME"
}
set TEST_NAME "UTRACE_P5_06"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
untested "$TEST_NAME"
}
set TEST_NAME "UTRACE_P5_07"
-if {$utrace_support_found == 0} {
+if {![utrace_p]} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
untested "$TEST_NAME"
buildok/process_test.stp {setup_kfail 1155 *-*-*}
buildok/rpc-all-probes.stp {setup_kfail 4413 *-*-*}
buildok/nfs-all-probes.stp {setup_kfail 4413 *-*-*}
+ buildok/per-process-syscall.stp {if {![utrace_p]} { setup_kfail 9999 *-*-*} }
}
if {$rc == 0} { pass $test } else { fail $test }
}