summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/skipped.exp
blob: f12bc6f1c9a047b3899888a3de605865f00331dc (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
set test "skip tracking"

if {! [installtest_p]} { untested $test; return }

set nr_cpus [exec sh -c "grep ^processor /proc/cpuinfo | wc -l"]
if {$nr_cpus < 2} { unsupported $test; return }

set script {
global f
probe timer.profile { f++; snooze() }
function snooze() %{ udelay(10000); %}
}

set errs 0
set warns 0
set oks 0
spawn stap -e $script -DMAXTRYLOCK=0 -DSTP_NO_OVERLOAD -tug
expect {
    -timeout 60
    -re {^ERROR: Skipped too many probes, check MAXSKIPPED or try again with stap -t for more details.\r\n} { incr errs; exp_continue }
    -re {^WARNING: Number of errors: 0, skipped probes: [0-9]+\r\n} { incr warns; exp_continue }
    -re {^WARNING: Skipped due to global .f. lock timeout: [0-9]+\r\n} { incr warns; exp_continue }
    -re {^probe timer.profile[^\r\n]+, hits: [0-9]+[^\r\n]+\r\n} { incr oks; exp_continue }
    eof { }
    timeout { fail "$test (timeout)" }
}
catch {close}
catch {wait}

if {$oks >= 1 && $warns == 2 && $errs == 1} { pass "$test ($nr_cpus $oks $warns $errs)" } else { fail "$test ($nr_cpus $oks $warns $errs)" }