Debian Codegraph @

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

raw
1 # Test proper shutdown while "overflowing" warning and system messages
2
3 set test "warn_overflow"
4 if {![installtest_p]} { untested $test; return }
5
6 # --vp 00002 suppresses WARNING duplication filtering in staprun.
7 # The syscall.* probe handlers try to overflow the cmd message buffers
8 # which might take some time, so add -DMAXSKIPPED=9999 to not error
9 # out because some probes take too long.
10 spawn stap --vp 00002 -DMAXSKIPPED=9999 $srcdir/$subdir/$test.stp
11 set ok 0
12 set warn 0
13 expect {
14 -timeout 180
15
16 -re {^WARNING: too many pending \([a-z]+\) messages\r\n} {
17 incr warn; exp_continue
18 }
19
20 -re {^stap_begin\r\n} { incr ok; exp_continue; }
21 -re {^stap_syscall\r\n} { incr ok; exp_continue; }
22 -re {^stap_end\r\n} { incr ok; exp_continue; }
23
24 -re {^[^\r\n]*\r\n} { exp_continue }
25 timeout { fail "$test (timeout)" }
26 eof { }
27 }
28 catch { close }; catch { wait }
29
30 # There can be more than 3 "too many pending" messages in case
31 # stap recovered quick enough and then overflowed again.
32 if {$ok == 3 && $warn >= 3} {
33 pass "$test ($ok,$warn)"
34 } {
35 fail "$test ($ok,$warn)"
36 }