This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH v2] Add test for target_set tapset.
On Fri, Jun 19, 2009 at 22:59, Przemyslaw Pawelczyk
<przemyslaw@pawelczyk.it> wrote:
> +proc expect_target_set_pids generations {
> + ? ? ? global test
> + ? ? ? global stp_pid
> + ? ? ? for {set i 0} {$i < $generations} {incr i} {
> + ? ? ? ? ? ? ? expect {
> + ? ? ? ? ? ? ? ? ? ? ? -timeout 0
> + ? ? ? ? ? ? ? ? ? ? ? -re {^([0-9]+) begat ([0-9]+)\r\n} { set pid_array($expect_out(1,string)) $expect_out(2,string) }
> + ? ? ? ? ? ? ? ? ? ? ? timeout { failtest; return -code return }
> + ? ? ? ? ? ? ? }
> + ? ? ? }
This zero timeout is way to optimistic and leads to occasional
failures as Josh pointed out on #systemtap.
> +probe nd_syscall.compat_nanosleep
> +{
> + ? ? ? if (target_set_pid(pid()) && @cast(req_uaddr, "timespec", "<linux/time.h>")->tv_sec == $1)
> + ? ? ? ? ? ? ? target_set_report()
> +}
This is completely wrong and shouldn't see the light of day. I'm really ashamed.
Thanks Josh for noticing this and the problem of compat_* functions in general.
Still I don't see any solution for CONFIG_COMPAT=n on 64-bit architectures.
I have already sent next draft version of the patch. Any comments and
suggestions are welcomed, but please send them as reply to that patch
(not this mail). Thank you.
Regards.
--
Przemysław Pawełczyk