scripts: benchmarkskript so modifiziert, dass libc-calls keine probleme machen
authorBernhard Urban <lewurm@gmail.com>
Tue, 11 May 2010 09:55:12 +0000 (11:55 +0200)
committerBernhard Urban <lewurm@gmail.com>
Tue, 11 May 2010 09:55:12 +0000 (11:55 +0200)
scripts/bench.sh
scripts/dumpinstr.sh

index 4973e7b2e9261da2faf64e0d912b0cffad48a83c..02738d644ec9594e4ffda1ea7807e4dade34ebca 100755 (executable)
@@ -48,12 +48,6 @@ for i in $TEST/*.0; do
     # create executable
     gcc -DCALL=\"${i%.0}.call\" -o $TMPNAME $TMPNAME.s $TESTMAIN $CALLCONV
     
     # create executable
     gcc -DCALL=\"${i%.0}.call\" -o $TMPNAME $TMPNAME.s $TESTMAIN $CALLCONV
     
-    # count instructions
-    $DUMPINSTR $TMPNAME call >/dev/null
-    if [ $? != 0 ]; then
-       echo "$bi FEHLGESCHLAGEN"
-       continue
-    fi
     
     # extract the exported symbols from the .s file
     #LABEL=`grep '.globl' $TMPNAME.s | sed 's/^.*\\.globl *\\([a-zA-Z0-9_]\\+\\).*$/\1/g'`
     
     # extract the exported symbols from the .s file
     #LABEL=`grep '.globl' $TMPNAME.s | sed 's/^.*\\.globl *\\([a-zA-Z0-9_]\\+\\).*$/\1/g'`
@@ -61,9 +55,16 @@ for i in $TEST/*.0; do
     # this won't work, we need all actual labels
     LABEL=`grep '[a-zA-Z0-9_.$]\\+:' $TMPNAME.s | sed 's/^\\(.*[^a-zA-Z0-9_.$]\\)\\?\\([a-zA-Z0-9_.$]\\+\\):.*$/\2/g'`
 
     # this won't work, we need all actual labels
     LABEL=`grep '[a-zA-Z0-9_.$]\\+:' $TMPNAME.s | sed 's/^\\(.*[^a-zA-Z0-9_.$]\\)\\?\\([a-zA-Z0-9_.$]\\+\\):.*$/\2/g'`
 
+    rm -f $TMPNAME.trace
     MATCHES=0
     for j in $LABEL; do
     MATCHES=0
     for j in $LABEL; do
-       MATCHES="$MATCHES\\|$j"
+               MATCHES="$MATCHES\\|$j"
+               # count instructions
+               $DUMPINSTR $TMPNAME $j > /dev/null
+               if [ $? != 0 ]; then
+                       echo "$bi FEHLGESCHLAGEN"
+                       continue
+               fi
     done
 
     # filter trace
     done
 
     # filter trace
index 0653bcc4867716a336d4aaf2cf5f5a03c2cf116e..0a6850ee6d0ed918f0bbcb81d5345134be877eda 100755 (executable)
@@ -50,15 +50,13 @@ quit
 
 END
 
 
 END
 
-gdb < $EXECFILE.tmp > $EXECFILE.trace 2>/dev/null
-
-mv $EXECFILE.trace $EXECFILE.output
+gdb < $EXECFILE.tmp > $EXECFILE.output 2>/dev/null
 
 awk -- '\
 /^====BEGIN/ {ll = ("begin " $2);} \
 /^==== / {print ll; ll = (" " substr($0, 5));} \
 /^====END/ {print "end", $2;}
 
 awk -- '\
 /^====BEGIN/ {ll = ("begin " $2);} \
 /^==== / {print ll; ll = (" " substr($0, 5));} \
 /^====END/ {print "end", $2;}
-' $EXECFILE.output > $EXECFILE.trace
+' $EXECFILE.output >> $EXECFILE.trace
 
 echo instructions: `grep "^  " $EXECFILE.trace | wc -l`
 echo trace output: $EXECFILE.trace
 
 echo instructions: `grep "^  " $EXECFILE.trace | wc -l`
 echo trace output: $EXECFILE.trace