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] - Blame information for rev 570

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 548 jeremybenn
#!/bin/bash
2
 
3
# Copyright (C) 2010 Embecosm Limited
4
 
5
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
6
 
7
# This file is a script to look at log file timings
8
 
9
# This program is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by the Free
11
# Software Foundation; either version 3 of the License, or (at your option)
12
# any later version.
13
 
14
# This program is distributed in the hope that it will be useful, but WITHOUT
15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
17
# more details.
18
 
19
# You should have received a copy of the GNU General Public License along
20
# with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 
22
# ------------------------------------------------------------------------------
23
 
24
# Look for the different GNU results in different directories. We put the
25
# results to a temporary file, to allow us to suck out the summary as well.
26
 
27
# The argument is the list of log files to process.
28
 
29
# Intermediate result
30
tmpf=/tmp/check-timings-$$
31 565 jeremybenn
 
32 548 jeremybenn
tottime=0
33
count=0
34 565 jeremybenn
TIMEOUT=1200
35 548 jeremybenn
 
36 565 jeremybenn
# Option to sort
37
if [ $# -gt 0 -a $1 == "-s" ]
38
then
39
    shift
40
    dosort="true"
41
else
42
    dosort="false"
43
fi
44
 
45 548 jeremybenn
# Get each result
46
for logfile in $*
47
do
48
    logfile_base=`basename ${logfile}`
49 565 jeremybenn
    grosstime=`grep "completed in" ${logfile} | sed -e 's/^.*completed in //' | sed -e 's/ seconds.*$//'`
50
    unres=`grep -c UNRESOLVED ${logfile}`
51
    nettime=$(( ${grosstime} - ${TIMEOUT} * ${unres} ))
52
    printf "%-25s %5d %5d" ${logfile_base} ${grosstime} ${nettime} >> ${tmpf}
53 548 jeremybenn
 
54 565 jeremybenn
    if [ ${unres} -gt 0 ]
55 548 jeremybenn
    then
56 565 jeremybenn
        printf "  %d unresolved\n" ${unres} >> ${tmpf}
57
    else
58
        printf "\n" >> ${tmpf}
59
    fi
60
 
61
    if [ "x${nettime}" != "x" ]
62
    then
63
        tottime=$(( ${tottime} + ${nettime} ))
64 548 jeremybenn
        count=$(( ${count} + 1 ))
65
    fi
66
done
67
 
68
average=$(( ${tottime} / ${count} ))
69 565 jeremybenn
 
70
# Option to sort
71
if [ ${dosort} == "true" ]
72
then
73
    sort -n +1 -2 ${tmpf}
74
else
75
    cat ${tmpf}
76
fi
77
 
78 548 jeremybenn
printf "%-25s %5d\n" "Total" ${tottime}
79
printf "%-25s %5d\n" "Average" ${average}
80
 
81
rm ${tmpf}

powered by: WebSVN 2.1.0

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