summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/tracepoints.exp
blob: b9014208a7e1b6ad3b665c5448b549297b8a2d31 (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
30
31
32
33
34
35
36
37
38
39
40

set tracepoints {}
spawn stap -l {kernel.trace("*")}
expect {
    -timeout 60
    -re {^kernel.trace[^\r\n]*\r\n} {
        append tracepoints $expect_out(0,string)
        exp_continue
    }
    timeout {}
    eof {}
}
catch {close}; catch { wait }

# Use this to test each tracepoint individually.
#foreach tp $tracepoints {
#    set test "tracepoint $tp -p4"
#    if {[catch {exec stap -w -p4 -e "probe $tp { println($\$name, $\$vars) }"} res]} {
#        fail "$test $res"
#    } else {
#        pass "$test"
#    }
#}

# This tests all tracepoints all at once (much faster than the above)
set script "probe begin {}"
foreach tp $tracepoints {
	set script "$script probe $tp { println($\$name, $\$vars) }"
}
send_log "Trying stap -w -p4 -e $script\n"
if {[catch {exec stap -w -p4 -e "$script"} res]} {
	fail "tracepoints $res"
} else {
	pass "tracepoints"
}

set test "tracepoints"
if {![installtest_p]} { untested $test; return }
set ::result_string {tracepoints OK}
stap_run2 $srcdir/$subdir/$test.stp