OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [check-times.sh] - Diff between revs 548 and 565

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 548 Rev 565
Line 26... Line 26...
 
 
# The argument is the list of log files to process.
# The argument is the list of log files to process.
 
 
# Intermediate result
# Intermediate result
tmpf=/tmp/check-timings-$$
tmpf=/tmp/check-timings-$$
 
 
tottime=0
tottime=0
count=0
count=0
 
TIMEOUT=1200
 
 
 
# Option to sort
 
if [ $# -gt 0 -a $1 == "-s" ]
 
then
 
    shift
 
    dosort="true"
 
else
 
    dosort="false"
 
fi
 
 
# Get each result
# Get each result
for logfile in $*
for logfile in $*
do
do
    logfile_base=`basename ${logfile}`
    logfile_base=`basename ${logfile}`
    logtime=`grep "completed in" ${logfile} | sed -e 's/^.*completed in //' | sed -e 's/ seconds.*$//'`
    grosstime=`grep "completed in" ${logfile} | sed -e 's/^.*completed in //' | sed -e 's/ seconds.*$//'`
    printf "%-25s %5d\n" ${logfile_base} ${logtime} >> ${tmpf}
    unres=`grep -c UNRESOLVED ${logfile}`
 
    nettime=$(( ${grosstime} - ${TIMEOUT} * ${unres} ))
 
    printf "%-25s %5d %5d" ${logfile_base} ${grosstime} ${nettime} >> ${tmpf}
 
 
    if [ "x${logtime}" != "x" ]
    if [ ${unres} -gt 0 ]
    then
    then
        tottime=$(( ${tottime} + ${logtime} ))
        printf "  %d unresolved\n" ${unres} >> ${tmpf}
 
    else
 
        printf "\n" >> ${tmpf}
 
    fi
 
 
 
    if [ "x${nettime}" != "x" ]
 
    then
 
        tottime=$(( ${tottime} + ${nettime} ))
        count=$(( ${count} + 1 ))
        count=$(( ${count} + 1 ))
    fi
    fi
done
done
 
 
average=$(( ${tottime} / ${count} ))
average=$(( ${tottime} / ${count} ))
 
 
 
# Option to sort
 
if [ ${dosort} == "true" ]
 
then
sort -n +1 -2 ${tmpf}
sort -n +1 -2 ${tmpf}
 
else
 
    cat ${tmpf}
 
fi
 
 
printf "%-25s %5d\n" "Total" ${tottime}
printf "%-25s %5d\n" "Total" ${tottime}
printf "%-25s %5d\n" "Average" ${average}
printf "%-25s %5d\n" "Average" ${average}
 
 
rm ${tmpf}
rm ${tmpf}
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.