Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/probe_list.exp

raw
1 # This test ensures that "-l" lists only include probe names, and not any of
2 # the local variables. There was a bug that "-l" would print variables that
3 # couldn't be optimized away, due to an incorrect assumption in the
4 # implementation.
5
6 # NB: This is a bit abusively formed. Currently -l internally writes "probe"
7 # and "{}" around its argument. For this test we want to introduce a variable
8 # that can't be optimized away. The trailing comment mark lets the auto "{}"
9 # get ignored.
10 spawn stap -l "begin { if (a) next }#"
11
12 set ok 0
13 expect {
14 # the output should not include anything else, like the 'a' local.
15 -re "^begin\r\n$" {
16 incr ok
17 }
18 }
19 catch {close}; catch {wait}
20 if {$ok == 1} {
21 pass "probe list is correct"
22 } else {
23 fail "probe list is incorrect"
24 }