}
+proc uprobes_p {} {
+ global env
+ if {! [utrace_p]} {
+ return 0
+ }
+ set uprobes $env(SYSTEMTAP_RUNTIME)/uprobes
+ set res [catch "exec make -q -C $uprobes uprobes.ko" output]
+ if {$res != 0} {
+ if {! [installtest_p]} {
+ # build as user in the source tree
+ verbose -log "exec make -C $uprobes"
+ set res [catch "exec make -C $uprobes" output]
+ verbose -log "OUT $output"
+ verbose -log "RC $res"
+ } else {
+ # build as root in the installed location
+ set res [as_root "make -C $uprobes"]
+ }
+ }
+ if {$res == 0} { return 1 } else { return 0 }
+}
+
+
proc print_systemtap_version {} {
set version [exec /bin/uname -r]
set location "/boot/vmlinux-$version"
catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err
if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" }
-if {![utrace_p]} {
+if {![uprobes_p]} {
catch {exec rm -f $test}
untested "$test -p4"
untested "$test -p5"
return
}
-# Pick up the stap being tested.
-set stapexe [exec /usr/bin/which stap]
-spawn sudo $stapexe $srcdir/$subdir/$test.stp -c ./$test
+spawn stap $srcdir/$subdir/$test.stp -c ./$test
set ok 0
expect {
-timeout 60
catch {exec gcc -g -o bz6850 $srcdir/$subdir/bz6850.c} err
if {$err == "" && [file exists bz6850]} then { pass "$test compile" } else { fail "$test compile" }
-if {![utrace_p]} {
+if {![uprobes_p]} {
catch {exec rm -f $test}
untested "$test -p4"
untested "$test -p5"
return
}
-# Pick up the stap being tested.
-set stapexe [exec /usr/bin/which stap]
-spawn sudo $stapexe $srcdir/$subdir/bz6850.stp -c ./bz6850
+spawn stap $srcdir/$subdir/bz6850.stp -c ./bz6850
expect {
-timeout 60
-re {[^\r\n]*called\r\n} { exp_continue }
return
}
-set stapexe [exec /usr/bin/which stap]
-spawn sudo $stapexe -p2 $srcdir/$subdir/$test.stp
+spawn stap -p2 $srcdir/$subdir/$test.stp
set hint 0
set probes 0
expect {
catch {exec gcc -g -o jennie jennie.c} err
if {$err == "" && [file exists jennie]} then { pass "$test compile" } else { fail "$test compile" }
-if {![utrace_p]} {
+if {! [uprobes_p]} {
untested "$test -p4"; untested "$test -p5"
catch {exec rm -f jennie.c jennie}
return
return
}
-# Pick up the stap being tested.
-set stapexe [exec /usr/bin/which stap]
-spawn sudo $stapexe $srcdir/$subdir/uprobes.stp -w -c "./jennie 1 2 3 4"
+spawn stap $srcdir/$subdir/uprobes.stp -w -c "./jennie 1 2 3 4"
set ok 0
expect {
-re {^process[^\r\n]*jennie[^\r\n]*main[^\r\n]*argc=0x[1-5][^\r\n]*\r\n} { incr ok; exp_continue }