1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
set test bz6905
catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err
if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" }
spawn stap -p2 $srcdir/$subdir/$test.stp
set hint 0
set probes 0
set skipped 0
expect {
-timeout 60
-re "# probes" { incr hint; exp_continue }
-re {process.*statement.*} { incr probes; exp_continue }
-re {never.*} { incr skipped; exp_continue}
timeout { fail "$test (timeout)" }
eof { }
}
wait
if { $skipped == 1 } {
untested "$test -p2"
} else {
if { $hint == 1 && $probes > 0 } then { pass "$test -p2" } else { fail "$test -p2 ($probes)" }
}
exec rm -f $test
set test bz10294
catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err
if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" }
spawn stap -p2 $srcdir/$subdir/$test.stp
set hint 0
set probes 0
set skipped 0
expect {
-timeout 60
-re "# probes" { incr hint; exp_continue }
-re {process.*statement.*} { incr probes; exp_continue }
-re {never.*} { incr skipped; exp_continue}
timeout { fail "$test (timeout)" }
eof { }
}
wait
if { $skipped == 1 } {
untested "$test -p2"
} else {
if { $hint == 1 && $probes == 1 } then { pass "$test -p2" } else { fail "$test -p2 ($probes)" }
}
set no_func stmtnofunc
set func_script "probe %%( CONFIG_UTRACE == \"y\" %%? process(\"%s\").statement(\"foo@%s.c:*\") %%: never %%) {}"
set script [format $func_script "./$test" "$test"]
spawn stap -p2 -we $script
expect {
-timeout 60
-re {semantic error: no match while resolving probe point.*\r\n} { xfail $no_func }
-re {never.*} { untested "$no_func"}
timeout { fail "$no_func (timeout)" }
eof { fail $no_func }
}
wait
exec rm -f $test
|