blob: 822e0d7ed726b8f1d0b2c054d121f3bec88f795a (
plain)
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
|
set test "stmtvars"
# PR 5787
set pc 0
set vars ""
spawn stap -e "probe kernel.function(\"sys_open\") {\$foo}" -p4 -vv -u
expect {
-re {probe sys_open[^\r\n]*pc=(0x[^\r\n]*)\r\n} { set pc $expect_out(1,string); exp_continue }
-re {alternatives: ([^\r\n]*)\): identifier [^\r\n]*\r\n} { set vars $expect_out(1,string); exp_continue }
timeout { fail "$test (timeout)" }
eof
}
wait
verbose -log "pc=$pc vars=$vars"
if {$pc != 0 && $vars != ""} { pass "$test - .function" } { fail "$test - .function" }
set pc2 0
set vars2 ""
spawn stap -e "probe kernel.statement($pc) {\$foo}" -p4 -vv -u
expect {
-re {probe sys_open[^\r\n]*pc=(0x[^\r\n]*)\r\n} { set pc2 $expect_out(1,string); exp_continue }
-re {alternatives: ([^\r\n]*)\): identifier [^\r\n]*\r\n} { set vars2 $expect_out(1,string); exp_continue }
timeout { fail "$test (timeout)" }
eof
}
wait
verbose -log "pc2=$pc2 vars2=$vars2"
if {$pc == $pc2 && $vars == $vars2} { pass $test } { fail $test }
|