home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- # extract goodies from the log file
- # $Header: mk2,v 1.3 87/08/07 15:40:36 kenj Exp $
- awk '
- /^$/ { next }
- /^[A-Z][A-Z]*=/ { next }
- /Benchmark/ { next }
- /Disk Problem/ { next }
- /C Compiler Test/ { next }
- /iterations/ { next }
- /interactive users/ { next }
- /loop < ohead:/ { next }
- /Synthetic Work/ { mem=0; next }
- /Simulated Work/ { mem=0; next }
- /Simulated Multi-user/ { mem=0; next }
- /type = arithoh/ { tbl=1; t="Loop Overhead"; next }
- /type = register/ { tbl=1; t="Register Arithmetic"; next }
- /type = short/ { tbl=1; t="Short Arithmetic"; next }
- /type = int/ { tbl=1; t="Integer Arithmetic"; next }
- /type = long/ { tbl=1; t="Long Arithmetic"; next }
- /type = float/ { tbl=1; t="Float Arithmetic"; next }
- /type = double/ { tbl=1; t="Double Arithmetic"; next }
- /sqrt/ { tbl=1; t="dc sqrt(2)"; und=1; next }
- /Hanoi/ { tbl=1; t="Recursion"; next }
- /System Call/ { tbl=1; t="System Calls"; und=1; next }
- /Pipe Throughput/ { tbl=1; t="Pipe Throughput"; next }
- /Pipe-based Context/ { tbl=1; t="Pipes & Context Switching"; next }
- /Signal-based Context/ { tbl=1; t="Signals & Context Switching"; next }
- /Process Creation/ { tbl=1; t="Process Create"; next }
- /Execl/ { tbl=1; t="Execing"; next }
- /cc -c.* cctest.c/ { tbl=1; t="C Compile"; und=1; next }
- /cc -c.* fstime.c/ { tbl=1; t="C Compile"; und=1; next }
- /cc cctest.o/ { tbl=1; t="C Load"; next }
- /cc fstime.o/ { tbl=1; t="C Load"; next }
- /^[0-9]+ Concurrent/ { tbl=5; t=$1 "_Users"; next}
- /Elapsed/ && /Actual/ { e=$(NF-1); next }
- /Elapsed/ { e=$3; next }
- /CPU/ && /Actual/ { c=$(NF-1)
- if (intbl != tbl) {
- if (intbl) print ".TE\n.)b"
- printf ".so tbl.%d\n",tbl
- intbl=tbl
- }
- if (und) { print "_"; und=0 }
- printf "%s\t%.2f\t%.2f\n",t,e,c
- t=""
- next
- }
- /CPU/ && mem==0 { c=$3
- if (intbl != tbl) {
- if (intbl) print ".TE\n.)b"
- printf ".so tbl.%d\n",tbl
- intbl=tbl
- }
- if (und) { print "_"; und=0 }
- printf "%s\t%.2f\t%.2f\n",t,e,c
- t=""
- next
- }
- /CPU/ && mem!=0 { next }
- /Sequential Memory/ { mem=1; found++;
- if (intbl != 2) {
- if (intbl) print ".TE\n.)b"
- print ".so tbl.2"
- intbl=2
- }
- next
- }
- /Random Memory/ { mem=2; found++; tbl=2
- if (intbl != 2) {
- if (intbl) print ".TE\n.)b"
- printf ".so tbl.2"
- intbl=2
- }
- next
- }
- /Array Size/ { size=$3; next }
- /Real Rate/ { if (mem==1) s[size]=$3/1000
- if (mem==2) r[size]=$3/1000
- if (found==2) {
- printf "%d\t%.2f\t%.2f\n",size,s[size],r[size]
- if (size==512) {
- mem=0
- found=0
- }
- }
- next
- }
- /Filesystem Throughput/ { if (intbl) print ".TE\n.)b"
- print ".so tbl.3"
- print ".so disks"
- print ".so tbl.4"
- intbl=4
- next }
- /File Size/ { printf "%sK bytes",$3; next }
- /Write:/ { printf "\t%.2f",$2; next }
- /Read:/ { printf "\t%.2f",$2; next }
- /Copy:/ { printf "\t%.2f",$2; print ""; next }
- /\/dev/ || /tty/ || /used/ || /[dD]irector/ || /wallclock/ { next }
- /^[^ ][^ ]*:\/[^ ]/ { next } # df for NFS mounted filesystem
- { print $0 }
- END { if (intbl) print ".TE\n.)b" }
- ' $1
-