summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/probe_list.exp
blob: b3e6884b972eda48d2118df2d7c79baf02e3ac0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This test ensures that "-l" lists only include probe names, and not any of
# the local variables.  There was a bug that "-l" would print variables that
# couldn't be optimized away, due to an incorrect assumption in the
# implementation.

# NB: This is a bit abusively formed.  Currently -l internally writes "probe"
# and "{}" around its argument.  For this test we want to introduce a variable
# that can't be optimized away.  The trailing comment mark lets the auto "{}"
# get ignored.
spawn stap -l "begin { if (a) next }#"

expect {
    # the output should not include anything else, like the 'a' local.
    -re "^begin\r\n$" {
        pass "probe list is correct"
        return
    }
}
fail "probe list is incorrect"