home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume11 / musbus / part04 / mk2 < prev    next >
Encoding:
Text File  |  1987-09-16  |  3.1 KB  |  104 lines

  1. #! /bin/sh
  2. # extract goodies from the log file
  3. # $Header: mk2,v 1.3 87/08/07 15:40:36 kenj Exp $
  4. awk '
  5. /^$/            { next }
  6. /^[A-Z][A-Z]*=/        { next }
  7. /Benchmark/        { next }
  8. /Disk Problem/        { next }
  9. /C Compiler Test/    { next }
  10. /iterations/        { next }
  11. /interactive users/    { next }
  12. /loop < ohead:/        { next }
  13. /Synthetic Work/    { mem=0; next }
  14. /Simulated Work/    { mem=0; next }
  15. /Simulated Multi-user/    { mem=0; next }
  16. /type = arithoh/    { tbl=1; t="Loop Overhead"; next }
  17. /type = register/    { tbl=1; t="Register Arithmetic"; next }
  18. /type = short/        { tbl=1; t="Short Arithmetic"; next }
  19. /type = int/        { tbl=1; t="Integer Arithmetic"; next }
  20. /type = long/        { tbl=1; t="Long Arithmetic"; next }
  21. /type = float/        { tbl=1; t="Float Arithmetic"; next }
  22. /type = double/        { tbl=1; t="Double Arithmetic"; next }
  23. /sqrt/            { tbl=1; t="dc sqrt(2)"; und=1; next }
  24. /Hanoi/            { tbl=1; t="Recursion"; next }
  25. /System Call/        { tbl=1; t="System Calls"; und=1; next }
  26. /Pipe Throughput/    { tbl=1; t="Pipe Throughput"; next }
  27. /Pipe-based Context/    { tbl=1; t="Pipes & Context Switching"; next }
  28. /Signal-based Context/    { tbl=1; t="Signals & Context Switching"; next }
  29. /Process Creation/    { tbl=1; t="Process Create"; next }
  30. /Execl/            { tbl=1; t="Execing"; next }
  31. /cc -c.* cctest.c/    { tbl=1; t="C Compile"; und=1; next }
  32. /cc -c.* fstime.c/    { tbl=1; t="C Compile"; und=1; next }
  33. /cc cctest.o/        { tbl=1; t="C Load"; next }
  34. /cc fstime.o/        { tbl=1; t="C Load"; next }
  35. /^[0-9]+ Concurrent/    { tbl=5; t=$1 "_Users"; next}
  36. /Elapsed/ && /Actual/    { e=$(NF-1); next }
  37. /Elapsed/        { e=$3; next }
  38. /CPU/ && /Actual/    { c=$(NF-1)
  39.               if (intbl != tbl) {
  40.                 if (intbl) print ".TE\n.)b"
  41.                 printf ".so tbl.%d\n",tbl
  42.                 intbl=tbl
  43.               }
  44.               if (und) { print "_"; und=0 }
  45.               printf "%s\t%.2f\t%.2f\n",t,e,c
  46.               t=""
  47.               next
  48.             }
  49. /CPU/ && mem==0        { c=$3
  50.               if (intbl != tbl) {
  51.                 if (intbl) print ".TE\n.)b"
  52.                 printf ".so tbl.%d\n",tbl
  53.                 intbl=tbl
  54.               }
  55.               if (und) { print "_"; und=0 }
  56.               printf "%s\t%.2f\t%.2f\n",t,e,c
  57.               t=""
  58.               next
  59.             }
  60. /CPU/ && mem!=0        { next }
  61. /Sequential Memory/    { mem=1; found++;
  62.               if (intbl != 2) {
  63.                 if (intbl) print ".TE\n.)b"
  64.                 print ".so tbl.2"
  65.                     intbl=2
  66.               }
  67.               next
  68.             }
  69. /Random Memory/        { mem=2; found++; tbl=2
  70.               if (intbl != 2) {
  71.                 if (intbl) print ".TE\n.)b"
  72.                 printf ".so tbl.2"
  73.                     intbl=2
  74.               }
  75.               next
  76.             }
  77. /Array Size/        { size=$3; next }
  78. /Real Rate/         { if (mem==1) s[size]=$3/1000
  79.               if (mem==2) r[size]=$3/1000
  80.               if (found==2) {
  81.                   printf "%d\t%.2f\t%.2f\n",size,s[size],r[size]
  82.                   if (size==512) {
  83.                       mem=0
  84.                       found=0
  85.                   }
  86.               }
  87.               next
  88.             }
  89. /Filesystem Throughput/    { if (intbl) print ".TE\n.)b"
  90.               print ".so tbl.3"
  91.               print ".so disks"
  92.               print ".so tbl.4"
  93.               intbl=4
  94.               next }
  95. /File Size/        { printf "%sK bytes",$3; next }
  96. /Write:/        { printf "\t%.2f",$2; next }
  97. /Read:/            { printf "\t%.2f",$2; next }
  98. /Copy:/            { printf "\t%.2f",$2; print ""; next }
  99. /\/dev/ || /tty/ || /used/ || /[dD]irector/ || /wallclock/    { next }
  100. /^[^     ][^     ]*:\/[^     ]/    { next }    # df for NFS mounted filesystem
  101.             { print $0 }
  102. END            { if (intbl) print ".TE\n.)b" }
  103. ' $1
  104.