5 my $S99 = "$FindBin::Bin/initramfs/etc/init.d/S99benchmark";
7 system("cat > $S99; chmod +x $S99") unless -t STDIN;
15 last if ($ready = /Welcome to Buildroot/ || /UGW started/);
17 die "Boot failed" unless $ready;
21 echo "Starting latester"
22 sudo ip l set eth0 down
23 sudo ~/bin/latester -d can0 -d can1 -d can2 -c 3200 -q --oneattime -n tmp
28 for i in sent lost enobufs $(seq -f percentile%g 0 10 100); do keyval="$keyval $i=$((i))"; done
29 echo "! PERF: gw_latency $avg µs $keyval ok"
33 my $status = system((qw(ssh -T glab), $latester));
37 sub kill_boot() { kill('TERM', -$pid) if defined $pid; }
40 # die("No boot command") if ($#ARGV eq -1);
41 # my $bootcmd = "'".join("' '", @ARGV)."'";
43 my $bootcmd = "$FindBin::Bin/boot";
45 $SIG{INT} = sub { kill_boot(); exit; };
47 pipe($boot, $wh) || die("pipe: $!");
48 my $pid = fork() // die("fork: $!");
50 setpgrp(); # Start new process group so that we can kill all
51 # background processes at once
53 open(STDERR, ">&", $wh) || die "Can't dup STDERR: $!";
54 my $cmd = "$bootcmd 2>&1 | tee /dev/stderr";
55 exec($cmd) || die "Can't exec $cmd: $!";