diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-01-21 19:46:40 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-25 12:44:13 +0000 |
commit | 5c367eccf86848558dcc212bb244204e642e5cf8 (patch) | |
tree | 8e4c24c4072fc5e48b496d94f6f18498b3e04174 /scripts/contrib/build-perf-test.sh | |
parent | 44fee2bb7a1d2b024982c4bf4bb29d473ec30d56 (diff) | |
download | poky-5c367eccf86848558dcc212bb244204e642e5cf8.tar.gz |
build-perf-test.sh: more generic timing function
Make it possible to time also other than bitbake commands. The name of
the log file is changed from bitbake.log to commands.log.
(From OE-Core rev: 7b355dc96255b06f3108a7d02ab0ed408d64bf1b)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/build-perf-test.sh')
-rwxr-xr-x | scripts/contrib/build-perf-test.sh | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/contrib/build-perf-test.sh b/scripts/contrib/build-perf-test.sh index cdd7885dca..105b54b35c 100755 --- a/scripts/contrib/build-perf-test.sh +++ b/scripts/contrib/build-perf-test.sh | |||
@@ -128,7 +128,7 @@ rev=$(git rev-parse --short HEAD) || exit 1 | |||
128 | OUTDIR="$clonedir/build-perf-test/results-$rev-`date "+%Y%m%d%H%M%S"`" | 128 | OUTDIR="$clonedir/build-perf-test/results-$rev-`date "+%Y%m%d%H%M%S"`" |
129 | BUILDDIR="$OUTDIR/build" | 129 | BUILDDIR="$OUTDIR/build" |
130 | resultsfile="$OUTDIR/results.log" | 130 | resultsfile="$OUTDIR/results.log" |
131 | bboutput="$OUTDIR/bitbake.log" | 131 | cmdoutput="$OUTDIR/commands.log" |
132 | myoutput="$OUTDIR/output.log" | 132 | myoutput="$OUTDIR/output.log" |
133 | globalres="$clonedir/build-perf-test/globalres.log" | 133 | globalres="$clonedir/build-perf-test/globalres.log" |
134 | 134 | ||
@@ -180,14 +180,13 @@ time_count=0 | |||
180 | declare -a SIZES | 180 | declare -a SIZES |
181 | size_count=0 | 181 | size_count=0 |
182 | 182 | ||
183 | bbtime () { | 183 | time_cmd () { |
184 | local arg="$@" | 184 | log " Timing: $*" |
185 | log " Timing: bitbake ${arg}" | ||
186 | 185 | ||
187 | if [ $verbose -eq 0 ]; then | 186 | if [ $verbose -eq 0 ]; then |
188 | /usr/bin/time -v -o $resultsfile bitbake ${arg} >> $bboutput | 187 | /usr/bin/time -v -o $resultsfile "$@" >> $cmdoutput |
189 | else | 188 | else |
190 | /usr/bin/time -v -o $resultsfile bitbake ${arg} | 189 | /usr/bin/time -v -o $resultsfile "$@" |
191 | fi | 190 | fi |
192 | ret=$? | 191 | ret=$? |
193 | if [ $ret -eq 0 ]; then | 192 | if [ $ret -eq 0 ]; then |
@@ -206,12 +205,16 @@ bbtime () { | |||
206 | log "More stats can be found in ${resultsfile}.${i}" | 205 | log "More stats can be found in ${resultsfile}.${i}" |
207 | } | 206 | } |
208 | 207 | ||
208 | bbtime () { | ||
209 | time_cmd bitbake "$@" | ||
210 | } | ||
211 | |||
209 | #we don't time bitbake here | 212 | #we don't time bitbake here |
210 | bbnotime () { | 213 | bbnotime () { |
211 | local arg="$@" | 214 | local arg="$@" |
212 | log " Running: bitbake ${arg}" | 215 | log " Running: bitbake ${arg}" |
213 | if [ $verbose -eq 0 ]; then | 216 | if [ $verbose -eq 0 ]; then |
214 | bitbake ${arg} >> $bboutput | 217 | bitbake ${arg} >> $cmdoutput |
215 | else | 218 | else |
216 | bitbake ${arg} | 219 | bitbake ${arg} |
217 | fi | 220 | fi |