From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Tue, 15 Jun 2010 08:11:03 -0700 Message-ID: From: ron minnich To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Subject: [9fans] small acid trip Topicbox-Message-UUID: 3382b880-ead6-11e9-9d60-3106f5b1d025 term% ys/src/libc/9sys/ctime.c if(i < 0) 597 date Open 000077c9/"/env/timezone" 00000000 = 4 "" 0x11b7720437d8a6f0 0x11b7720437d9a4d8 /sys/src/libc/9sys/read.c return pread(fd, buf, n, -1LL); 597 date Pread 4 0ffff854/"EST.-18000.EDT.-14400....9943200...25664400...41392800...5771880" 1680 -0x1 = 1518 "" 0x11b7720438e35860 0x11b7720438e3fc70 /sys/src/libc/9sys/ctime.c p = buf; 597 date Close 4 = 0 "" 0x11b7720439569c30 0x11b77204395705a8 /sys/src/libc/9sys/write.c return pwrite(fd, buf, n, -1LL); 597 date Pwrite 1 0ffffdc8/"Tue.Jun.15.11:06:21.EDT.2010." 29 -0x1 = 29 "" 0x11b772043a979040 0x11b772043afe1a40 /sys/src/libc/9sys/getpid.c if(f >= 0) { 597 date Open 0000759c/"#c/pid" 00000000 = 4 "" 0x11b772043bd3ae08 0x11b772043bd4d6e8 /sys/src/libc/9sys/read.c return pread(fd, buf, n, -1LL); 597 date Pread 4 0ffffee8/"........597." 20 -0x1 = 12 "" 0x11b772043c177598 0x11b772043c181d90 /sys/src/libc/9sys/getpid.c return atol(b); 597 date Close 4 = 0 "" 0x11b772043cf77170 0x11b772043cf7d700 ?file?(no source) cwrite: /proc/597/syscall: failed bytes: process exited /sys/src/libc/port/atexit.c _exits(s); 597 date Exits 0/"" To get this: ratrace -c /bin/date |[2] acid /bin/date toacid is: #!/bin/rc sed 's/"/\\"/g' | awk '{printf "printto(\"/fd/2\", " ""; printf "pcfile(%s),srcline(%s),", $4, $4; for (i=1;i<=NF; i++) if (i != 4) printf "\" %s\",", $i" "; print(")")}' | acid $1>/dev/null I'm sure there is room for improvement but this is kind of fun. ron