With the previous code, it was possible for the delayedkill ./loop job
to be killed before the stap script watching for its end got really
ready. That could mean that the stap script starts, and waits, and
waits, and waits more, and waits, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits, and waits, and
waits, and waits, and waits yet more, and waits, and waits, and waits,
and waits, and waits, and waits, and waits, and waits, and waits, and
waits, and waits a bit longer, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits more , and waits,
and waits, and waits, and waits, and waits, and waits, and waits, and
waits, and keeps waiting, and waits, and waits, and waits, and waits,
and waits, and waits, and waits, and goes on waiting, and waits, and
waits a lot, and waits, and waits, and waits, and waits, and waits,
and waits, and waits, and waits for warts, and waits, and waits, and
waits, and waits, and waits, and waits, and waits, and waits, now
getting slightly impatient, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits a lot more.
Since there is no robust synchronization in the test case, let's
increase the delayedkill interval to make the above wait less likely,
plus add a godot timeout probe that will abort the script before it
gets grey hairs, loses its teeth, and gets bombarded with funeral
pre-planning spam.
# Test the probe type. If successful, the stap rc will be 0.
set probe [add_args $probe_type $our_pid]
- set cmd [concat [list $stap --unprivileged -e "probe $probe { if (is_myproc ()) println (\"is myproc\") else println (\"not myproc\"); exit (); }"] [extra_options $probe_type]]
+ set cmd [concat [list $stap --unprivileged -e "probe $probe { if (is_myproc ()) println (\"is myproc\") else println (\"not myproc\"); exit (); } probe timer.s(15) { println(\"timeout\") exit() }"] [extra_options $probe_type]]
# If the probe types was 'process(number).end' or 'process(string).end' then set up a
# delayed kill of our test program in order to make the probe fire.
if {[regexp "^process\\(number\\)\\.end" $probe_type] || \
[regexp "^process\\(string\\)\\.end" $probe_type]} {
- exec $srcdir/$subdir/delayedkill $our_pid 5 &
+ exec $srcdir/$subdir/delayedkill $our_pid 10 &
}
# Run stap.