home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / x / x11p-13.zip / RCS / x11perfcomp,v < prev    next >
Text File  |  1990-01-07  |  3KB  |  147 lines

  1. head     1.2;
  2. access   ;
  3. symbols  ;
  4. locks    ; strict;
  5. comment  @# @;
  6.  
  7.  
  8. 1.2
  9. date     90.01.07.20.18.44;  author joel;  state Exp;
  10. branches ;
  11. next     1.1;
  12.  
  13. 1.1
  14. date     89.12.27.19.31.03;  author joel;  state Exp;
  15. branches ;
  16. next     ;
  17.  
  18.  
  19. desc
  20. @Replacement for x11perfcomp.sh
  21. @
  22.  
  23.  
  24. 1.2
  25. log
  26. @Added stuff for doing relative numbers from Keith
  27. @
  28. text
  29. @#! /bin/sh
  30. # Collects multiple outputs of x11perf.  Just feed it a list of files, each
  31. # containing the output from an x11perf run, and this shell will extract the
  32. # object/second information and show it in tabular form.  An 80-column line is
  33. # big enough to compare 4 different servers.
  34. #
  35. # This script normally uses the results from $1 to extract the test label
  36. # descriptions, so you can run x11perf on a subset of the test and then compare
  37. # the results.  But note that x11perffill requires the labels file to be a
  38. # superset of the x11perf results file.  If you run into an ugly situation in
  39. # which none of the servers completes the desired tests (possible on non-DEC
  40. # servers :), you can use -l <filename> as $1 and $2 to force x11perfcomp to 
  41. # use the labels stored in file $2.  (You can run x11perf with the -labels
  42. # option to generate such a file.)
  43. #
  44. # Mark Moraes, University of Toronto
  45. # Joel McCormack, DEC Western Research Lab
  46.  
  47. set -e
  48. tmp=/tmp/rates.$$
  49. mkdir $tmp $tmp/rates
  50. ratio=
  51. allfiles=
  52. # Include relative rates in output?  Report only relative rates?
  53. case $1 in
  54. -r)
  55.     ratio=1
  56.     shift;
  57.     ;;
  58. -ro)
  59.     ratio=2
  60.     shift;
  61.     ;;
  62. esac
  63. # Get either the provided label file, or construct one from the first x11perf
  64. # output file given.
  65. case $1 in
  66. -l)    cp $2 $tmp/labels
  67.     shift; shift
  68.     ;;
  69. *)    awk '$2 == "reps" || $2 == "trep" { \
  70.         print $0; \
  71.         next; \
  72.         } \
  73.     ' $1 | sed 's/^.*: //' | uniq > $tmp/labels
  74.     ;;
  75. esac
  76. # Go through all files, and create a corresponding rate file for each
  77. n=1
  78. for i
  79. do
  80. # Get lines with average numbers, fill in any tests that may be missing
  81. # then extract the rate field
  82.     base=`basename $i`
  83.     (echo "     $n  "; \
  84.      echo '--------'; \
  85.      awk '$2 == "reps" || $2 == "trep" {
  86.         line = $0;
  87.         next;
  88.         }
  89.         NF == 0 && line != "" {
  90.         print line;
  91.         line="";
  92.         next;
  93.         }
  94.      ' $i > $tmp/$base.avg; \
  95.      x11perffill $tmp/$base.avg $tmp/labels |
  96.      sed 's/( *\([0-9]*\)/(\1/'   |
  97.      awk '$2 == "reps" || $2 == "trep" {
  98.         n = substr($6,2,length($6)-7);
  99.         printf "%8s\n", n;
  100.         }
  101.     ') > $tmp/rates/$base
  102.     echo "$n: $base"
  103.     n=`expr $n + 1`
  104.     allfiles="$allfiles$base "
  105. done
  106. case x$ratio in
  107. x)
  108.     ratio=/bin/cat
  109.     ;;
  110. x1)
  111.     ratio="x11perfboth $n"
  112.     ;;
  113. *)
  114.     ratio="x11perfratio $n"
  115.     ;;
  116. esac
  117. echo ''
  118. (echo Operation; echo '---------'; cat $tmp/labels) | \
  119. (cd $tmp/rates; paste $allfiles -) | \
  120. sed 's/    /  /g' | $ratio
  121. rm -rf $tmp
  122. @
  123.  
  124.  
  125. 1.1
  126. log
  127. @Initial revision
  128. @
  129. text
  130. @d22 13
  131. d54 1
  132. d66 2
  133. a67 2
  134.      ' $i > $tmp/$i.avg; \
  135.      x11perffill $tmp/$i.avg $tmp/labels |
  136. d73 2
  137. a74 2
  138.     ') > $tmp/rates/$i
  139.     echo "$n: $i"
  140. d76 1
  141. d78 11
  142. d91 2
  143. a92 2
  144. (cd $tmp/rates; paste $* -) | \
  145. sed 's/    /  /g'
  146. @
  147.