scripts: hoffentlich arbeitet bench.sh nun korrekt
[testub10.git] / scripts / bench.sh
index 009a0f14669a70ae3951ece9e0ab4cba6c999bde..d53bc9872a7d7050c417e0972717394e1825896a 100755 (executable)
@@ -53,12 +53,18 @@ for i in $TEST/*.0; do
     #LABEL=`grep '.globl' $TMPNAME.s | sed 's/^.*\\.globl *\\([a-zA-Z0-9_]\\+\\).*$/\1/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'`
+     grep '[a-zA-Z_][a-zA-Z0-9_]*:' $TMPNAME.s | sed 's/^\(.*[^a-zA-Z_.]\)\?\([a-zA-Z0-9_.$]\+\):.*$/\2/g' > $TMPNAME.uniq
+
+     LABEL_ASM=`cat $TMPNAME.uniq`
+
+     # functionidentifiers from CALL-file
+     grep '[a-zA-Z_][a-zA-Z0-9_]*(.*)' ${i%.0}.call | sed 's/.*[^a-zA-Z_]\([a-zA-Z_][a-zA-Z0-9_]*\)(.*)\;/\1/g' | sort | uniq >> $TMPNAME.uniq
+
+     LABEL=`sort $TMPNAME.uniq | uniq -d`
+     rm $TMPNAME.uniq
 
     rm -f $TMPNAME.trace
-    MATCHES=0
     for j in $LABEL; do
-               MATCHES="$MATCHES\\|$j"
                # count instructions
                $DUMPINSTR $TMPNAME $j > /dev/null
                if [ $? != 0 ]; then
@@ -67,6 +73,11 @@ for i in $TEST/*.0; do
                fi
     done
 
+    MATCHES=0
+       for j in $LABEL_ASM; do
+               MATCHES="$MATCHES\\|$j"
+       done
+
     # filter trace
     grep "<\\($MATCHES\\)\\(+[0-9]*\\)\\?>:" $TMPNAME.trace > $TRACEDIR/$bi.trace