On Wed, 19 May 2010 17:32:19 PDT ron minnich <[email protected]> wrote:
> On Wed, May 19, 2010 at 5:26 PM, Bakul Shah <[email protected]> wro=
> te:
>
> > time ratrace -o /dev/null -c mk # about 19.67 seconds
>
> did you want [2]>/dev/null?
No, because that eats time output as well. My change uses a
new fd if -o is specified, 2 otherwise.
> > mk clean
> > time mk # about 0.88 seconds
> >
> > And here I thought naming it ratrace would make it go faster.
>
> Speed is left as an exercise for the reader.
On a 5 year old T42 thinkpad running freebsd:
mk clean
time ratrace -o /dev/null -c mk # 2.57 seconds
mk clean
time mk # 0.18 seconds
So may be it is 9vx (and freebsd on i386 vs macos on x86_64)
But there are other issues:
term% cat x.c
#include <u.h>
#include <libc.h>
void main(int c, char**v) {
fork()? print("parent\n") : print("child\n");
exits(nil);
}
term% 8c x.c && 8l x.8 && ratrace -c 8.out
178 8.out Rfork 0x1259 00002014child
= 180 "" 0x11af831799634530 0x11af83179b3a4368
178 8.out Pwrite 0x297d 1 0ffffe0c/"parent." 7 -0x1parent
= 6 "" 0x11af83179f9d7a60 0x11af8317a93a9d28
= 7 "" 0x11af8317b1743468 0x11af8317bb73ed78
180 8.out Open 0x120b 0000601c/"#c/pid" 00000000 = 3 "" 0x11af8317c915bc18
0x11af8317c91b5998
178 8.out Open 0x120b 0000601c/"#c/pid" 00000000 = 3 "" 0x11af8317d3cd6700
0x11af8317d3d2fcb0
180 8.out Pread 0x29b0 3 0fffff2c/"........180." 20 -0x1 = 12 ""
0x11af8317dea5ad90 0x11af8317deab08a8
180 8.out Close 0x1239 3 = 0 "" 0x11af8317ebe03a98 0x11af8317ebe39210
180 8.out Exits 0x118b 0/""cwrite: /proc/180/syscall: failed 12 bytes: process
exited
178 8.out Pread 0x29b0 3 0fffff2c/"........178." 20 -0x1 = 12 ""
0x11af8317fac10d30 0x11af8317fac65c90
178 8.out Close 0x1239 3 = 0 "" 0x11af83180d0e04c0 0x11af83180d113910
178 8.out Exits 0x118b 0/""cwrite: /proc/178/syscall: failed 12 bytes: process
exited
term%
Notice the child's Pwrite is missing but its result shows
up. After the 2nd line of ratrace output there should be
= 0 "" 0x11af831799634530 0x11af83179b3XXXXX
to indicate rfork's return in the child but that is missing too.
I need to find time to hack on this!