#!/bin/bash # TODO!!! COMMENT EXPLAINING ALL THIS!!! # $1 = name of benchmark suite # $2 = date that the suite was run # get rid of files we'll be generating / appending to # make sure you don't want any of these files! rm -f junk* rm -f benchmark_names rm -f runtime_table rm -f more-junk* rm -f diff_input_1 rm -f diff_input_2 rm -f paranoid_diff_out rm -f diff_out rm -f $1_paranoid_diff_$2 rm -f $1_diff_$2 rm -f $1_report_$2 rm -f status_table rm -f temp_report # fill table with user runtimes cat $1_times_$2 | grep -v Abort | grep -v fault | split -l 21 - junk for file in junk* do head -n1 $file >> benchmark_names done for file in junk* do grep user $file | xargs echo | sed -e "s/user //g" done | paste -d' ' benchmark_names - | sort > runtime_table # get pass or failure status for each benchmark find ./$1/ -name *.out | grep -E 'java\.out|9-switch-debug\.out|r1575-switch-debug\.out|9-inlined\.out|r1575-inlined\.out' | \ sort | split -l 5 - more-junk for file in more-junk* do for filetype in java.out 1.0.9-switch-debug.out r1575-switch-debug.out 1.0.9-inlined.out r1575-inlined.out do # paranoid diff to make sure ... save everything cat `grep java.out $file` | grep -i -v -E 'returned value' > diff_input_1 cat `grep $filetype $file` | grep -i -v -E 'returned value' > diff_input_2 diff diff_input_1 diff_input_2 > paranoid_diff_out echo `grep $filetype $file` | cat - paranoid_diff_out >> $1_paranoid_diff_$2 # timing measurements cause false alarms cat `grep java.out $file` | grep -i -v -E 'time|total|msec|returned value' > diff_input_1 cat `grep $filetype $file` | grep -i -v -E 'time|total|msec|returned value' > diff_input_2 diff diff_input_1 diff_input_2 > diff_out if [ $? -eq 0 ] then echo PASS else echo FAIL echo `grep $filetype $file` | cat - diff_out >> $1_diff_$2 fi done | xargs echo >> status_table done # generate the final report echo name java_t 1.0.9-sd_t r1575-sd_t 1.0.9-i_t r1575-i_t java_s 1.0.9-sd_s r1575-sd_s 1.0.9-i_s r1575-i_s > temp_report paste -d' ' runtime_table status_table >> temp_report cat temp_report | tr ' ' '\t' | expand -t 15 > $1_report_$2 # get rid of files again (keeping actual results) rm -f junk* rm -f benchmark_names rm -f runtime_table rm -f more-junk* rm -f diff_input_1 rm -f diff_input_2 rm -f paranoid_diff_out rm -f diff_out rm -f status_table rm -f temp_report