--- /dev/null
+#!/usr/bin/perl -wp
+use strict;
+
+our ($fd, $timeadj);
+
+BEGIN {
+ $fd = -1;
+}
+
+if (m/^ connect fd=(\d+) /) {
+ $fd=$1; next;
+}
+
+if (m/^ read fd=$fd buflen=1$/) {
+ die if $timeadj;
+ print
+ " select max=".($fd+1)." rfds=null wfds=[$fd]".
+ " efds=null to=0.000000\n".
+ " select=1 rfds=null wfds=[$fd] efds=null\n".
+ "+0.000001\n";
+ $timeadj = -0.000001;
+}
+
+if (m/^ \+([0-9.]+)$/ && $timeadj) {
+ $_ = sprintf " +%.6f\n", $1 + $timeadj;
+ $timeadj = 0;
+}