Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: buildbot/buildbot_spec2k.sh

Issue 11377144: add and enable validator tests for x86 (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/canned_nexe_tool.sh » ('j') | tools/canned_nexe_tool.sh » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 set -o xtrace 6 set -o xtrace
7 set -o nounset 7 set -o nounset
8 set -o errexit 8 set -o errexit
9 9
10 ###################################################################### 10 ######################################################################
11 # SCRIPT CONFIG 11 # SCRIPT CONFIG
12 ###################################################################### 12 ######################################################################
13 13
14 CLOBBER=${CLOBBER:-yes} 14 readonly CLOBBER=${CLOBBER:-yes}
15 SCONS_TRUSTED="./scons --mode=opt-host -j8" 15 readonly SCONS_TRUSTED="./scons --mode=opt-host -j8"
16 SCONS_NACL="./scons --mode=opt-host,nacl -j8" 16 readonly SCONS_NACL="./scons --mode=opt-host,nacl -j8"
17 SPEC_HARNESS=${SPEC_HARNESS:-${HOME}/cpu2000-redhat64-ia32}/ 17 readonly SPEC_HARNESS=${SPEC_HARNESS:-${HOME}/cpu2000-redhat64-ia32}/
18 18
19 TRYBOT_TESTS="176.gcc 179.art 181.mcf 197.parser 252.eon 254.gap" 19 readonly TRYBOT_TESTS="176.gcc 179.art 181.mcf 197.parser 252.eon 254.gap"
20 TRYBOT_TRANSLATOR_TESTS="176.gcc" 20 readonly TRYBOT_TRANSLATOR_TESTS="176.gcc"
21 TRYBOT_X86_64_ZERO_BASED_SANDBOX_TESTS="176.gcc" 21 readonly TRYBOT_X86_64_ZERO_BASED_SANDBOX_TESTS="176.gcc"
22 22
23 readonly BUILDBOT_PNACL="buildbot/buildbot_pnacl.sh" 23 readonly BUILDBOT_PNACL="buildbot/buildbot_pnacl.sh"
24 readonly UP_DOWN_LOAD="buildbot/file_up_down_load.sh" 24 readonly UP_DOWN_LOAD="buildbot/file_up_down_load.sh"
25 25
26 SPEC_BASE="tests/spec2k" 26 readonly SPEC_BASE="tests/spec2k"
27 readonly ARCHIVE_NAME=$(${SPEC_BASE}/run_all.sh GetTestArchiveName) 27 readonly ARCHIVE_NAME=$(${SPEC_BASE}/run_all.sh GetTestArchiveName)
28 28
29 readonly NAME_ARM_TRY_UPLOAD=$(${BUILDBOT_PNACL} NAME_ARM_TRY_UPLOAD) 29 readonly NAME_ARM_TRY_UPLOAD=$(${BUILDBOT_PNACL} NAME_ARM_TRY_UPLOAD)
30 readonly NAME_ARM_TRY_DOWNLOAD=$(${BUILDBOT_PNACL} NAME_ARM_TRY_DOWNLOAD) 30 readonly NAME_ARM_TRY_DOWNLOAD=$(${BUILDBOT_PNACL} NAME_ARM_TRY_DOWNLOAD)
31 readonly NAME_ARM_UPLOAD=$(${BUILDBOT_PNACL} NAME_ARM_UPLOAD) 31 readonly NAME_ARM_UPLOAD=$(${BUILDBOT_PNACL} NAME_ARM_UPLOAD)
32 readonly NAME_ARM_DOWNLOAD=$(${BUILDBOT_PNACL} NAME_ARM_DOWNLOAD) 32 readonly NAME_ARM_DOWNLOAD=$(${BUILDBOT_PNACL} NAME_ARM_DOWNLOAD)
33 33
34 readonly QEMU_TOOL="$(pwd)/toolchain/linux_arm-trusted/run_under_qemu_arm"
35
36 readonly CANNED_NEXE_REV=1001
37
34 # If true, terminate script when first error is encountered. 38 # If true, terminate script when first error is encountered.
35 FAIL_FAST=${FAIL_FAST:-false} 39 readonly FAIL_FAST=${FAIL_FAST:-false}
36 RETCODE=0 40 RETCODE=0
37 41
38 # Print the number of tests being run for the buildbot status output 42 # Print the number of tests being run for the buildbot status output
39 testcount() { 43 testcount() {
40 local tests="$1" 44 local tests="$1"
41 if [[ ${tests} == "all" ]]; then 45 if [[ ${tests} == "all" ]]; then
42 echo "all" 46 echo "all"
43 else 47 else
44 echo ${tests} | wc -w 48 echo ${tests} | wc -w
45 fi 49 fi
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 else 148 else
145 ${UP_DOWN_LOAD} DownloadArmBinariesForHWBots ${NAME_ARM_DOWNLOAD} \ 149 ${UP_DOWN_LOAD} DownloadArmBinariesForHWBots ${NAME_ARM_DOWNLOAD} \
146 ${ARCHIVE_NAME} 150 ${ARCHIVE_NAME}
147 fi 151 fi
148 echo "@@@BUILD_STEP spec2k untar@@@" 152 echo "@@@BUILD_STEP spec2k untar@@@"
149 pushd ${SPEC_BASE} 153 pushd ${SPEC_BASE}
150 ./run_all.sh UnpackArmBinaries 154 ./run_all.sh UnpackArmBinaries
151 popd 155 popd
152 } 156 }
153 157
158 download-validator-test-nexes() {
159 local arch="$1"
160 echo "@@@BUILD_STEP validator test download@@@"
161 ${UP_DOWN_LOAD} DownloadArchivedNexes ${CANNED_NEXE_REV} \
jvoung (off chromium) 2012/11/15 19:10:48 Did you want to reuse tools/canned_nexe_tool.sh in
162 "${arch}_giant" giant_nexe.tar.bz2
163 # This generates "CannedNexes/" in the current directory
164 rm -rf CannedNexes
jvoung (off chromium) 2012/11/15 19:10:48 indentation
robertm 2012/11/15 19:33:31 Done.
165 tar jxf giant_nexe.tar.bz2
166 }
167
168 get-validator() {
169 local arch="$1"
170 if [[ ${arch} == "x86-32" ]] ; then
171 echo "$(pwd)/scons-out/opt-linux-x86-32/staging/ncval"
jvoung (off chromium) 2012/11/15 19:14:19 Also, would the dfa-validator devs be interested i
robertm 2012/11/15 19:33:31 absolutely, will send email to khim about it On 2
172 elif [[ ${arch} == "x86-64" ]] ; then
173 echo "$(pwd)/scons-out/opt-linux-x86-64/staging/ncval"
174 elif [[ ${arch} == "arm" ]] ; then
175 echo "$(pwd)/scons-out/opt-linux-arm/staging/arm-ncval-core"
176 else
177 echo "ERROR: unknown arch"
178 fi
179 }
180
181 LogTimeHelper() {
182 # This format is recognized by the buildbot system
183 echo "RESULT $1_$2: $3= $(bc) secs"
jvoung (off chromium) 2012/11/15 19:10:48 What does the invocation of bc do here? Oh... I se
robertm 2012/11/15 19:33:31 I eliminated the mess with the temp files. so the
184 }
185
186 LogTimedRun() {
187 local graph=$1
188 local benchmark=$2
189 local variant=$3
190 shift 3
191 # S: system mode CPU-seconds used by the process
192 # U: user mode CPU-seconds used by the process
193 # We add a plus sign inbetween so that we can pipe the output to "bc"
194 /usr/bin/time -f "%U + %S" \
195 --output >(LogTimeHelper ${graph} ${benchmark} ${variant}) \
jvoung (off chromium) 2012/11/15 21:00:43 Does --output need an argument?
robertm 2012/11/15 21:12:37 added a comment On 2012/11/15 21:00:43, jvoung (c
196 "$@"
197 }
198
199 measure-validator-speed() {
jvoung (off chromium) 2012/11/15 21:00:43 Perhaps add a cross reference to the canned-nexe t
robertm 2012/11/15 21:12:37 I added a comment before: readonly CANNED_NEXE_REV
200 local arch="$1"
201 local validator=$(get-validator ${arch})
202 echo "@@@BUILD_STEP validator speed test@@@"
jvoung (off chromium) 2012/11/15 19:10:48 maybe print the ${arch} too inside the BUILD_STEP
robertm 2012/11/15 19:33:31 Done.
203 if [[ ! -e ${validator} ]] ; then
204 echo "ERROR: missing validator executable: ${validator}"
205 handle-error
206 return
207 fi
208
209 if [[ ${arch} == "arm" && $(uname -p) != arm* ]] ; then
210 validator="${QEMU_TOOL} ${validator}"
jvoung (off chromium) 2012/11/15 19:10:48 Do we really want to run this in qemu, or can we d
robertm 2012/11/15 19:33:31 The qemu part is useful when I manually tests this
211 fi
212
213 for nexe in CannedNexes/* ; do
214 ls --size --block-size=1 ${nexe}
215 LogTimedRun "validationtime" $(basename ${nexe}) "canned" \
216 ${validator} ${nexe}
217 echo "next"
jvoung (off chromium) 2012/11/15 19:10:48 why not echo "validating ${nexe}" at the beginning
robertm 2012/11/15 19:33:31 that was debugging leftovers - remvoed
218 done
219 }
220
154 ###################################################################### 221 ######################################################################
155 # NOTE: trybots only runs a subset of the the spec2k tests 222 # NOTE: trybots only runs a subset of the the spec2k tests
156 # TODO: elminate this long running bot in favor per arch sharded bots 223 # TODO: elminate this long running bot in favor per arch sharded bots
157 pnacl-trybot-arm-qemu() { 224 pnacl-trybot-arm-qemu() {
158 clobber 225 clobber
159 build-prerequisites "arm" "bitcode" 226 build-prerequisites "arm" "bitcode"
160 build-tests SetupPnaclArmOpt "${TRYBOT_TESTS}" 0 1 227 build-tests SetupPnaclArmOpt "${TRYBOT_TESTS}" 0 1
161 run-tests SetupPnaclArmOpt "${TRYBOT_TESTS}" 0 1 228 run-tests SetupPnaclArmOpt "${TRYBOT_TESTS}" 0 1
162 } 229 }
163 230
(...skipping 16 matching lines...) Expand all
180 handle-error 247 handle-error
181 popd 248 popd
182 } 249 }
183 250
184 pnacl-trybot-x8632() { 251 pnacl-trybot-x8632() {
185 clobber 252 clobber
186 build-prerequisites "x86-32" "bitcode" 253 build-prerequisites "x86-32" "bitcode"
187 build-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 0 1 254 build-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 0 1
188 run-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 0 1 255 run-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 0 1
189 build-tests SetupPnaclTranslatorX8632Opt "${TRYBOT_TRANSLATOR_TESTS}" 0 1 256 build-tests SetupPnaclTranslatorX8632Opt "${TRYBOT_TRANSLATOR_TESTS}" 0 1
190 run-tests SetupPnaclTranslatorX8632Opt "${TRYBOT_TRANSLATOR_TESTS}" 0 1 257 run-tests SetupPnaclTranslatorX8632Opt "${TRYBOT_TRANSLATOR_TESTS}" 0 1
jvoung (off chromium) 2012/11/15 21:02:04 Perhaps add it to the trybot runs too, so that we
robertm 2012/11/15 21:12:37 Done. for x86
191 } 258 }
192 259
193 pnacl-x86-64-zero-based-sandbox() { 260 pnacl-x86-64-zero-based-sandbox() {
194 clobber 261 clobber
195 export NACL_ENABLE_INSECURE_ZERO_BASED_SANDBOX=1 262 export NACL_ENABLE_INSECURE_ZERO_BASED_SANDBOX=1
196 build-prerequisites "x86-64" "bitcode" "x86_64_zero_based_sandbox=1" 263 build-prerequisites "x86-64" "bitcode" "x86_64_zero_based_sandbox=1"
197 build-tests SetupPnaclX8664ZBSOpt \ 264 build-tests SetupPnaclX8664ZBSOpt \
198 "${TRYBOT_X86_64_ZERO_BASED_SANDBOX_TESTS}" 0 1 265 "${TRYBOT_X86_64_ZERO_BASED_SANDBOX_TESTS}" 0 1
199 run-tests SetupPnaclX8664ZBSOpt \ 266 run-tests SetupPnaclX8664ZBSOpt \
200 "${TRYBOT_X86_64_ZERO_BASED_SANDBOX_TESTS}" 0 1 267 "${TRYBOT_X86_64_ZERO_BASED_SANDBOX_TESTS}" 0 1
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 pnacl-x8664() { 306 pnacl-x8664() {
240 clobber 307 clobber
241 build-prerequisites "x86-64" "bitcode" 308 build-prerequisites "x86-64" "bitcode"
242 local setups="SetupPnaclX8664 \ 309 local setups="SetupPnaclX8664 \
243 SetupPnaclX8664Opt \ 310 SetupPnaclX8664Opt \
244 SetupPnaclTranslatorX8664 \ 311 SetupPnaclTranslatorX8664 \
245 SetupPnaclTranslatorX8664Opt" 312 SetupPnaclTranslatorX8664Opt"
246 build-tests "${setups}" all 1 3 313 build-tests "${setups}" all 1 3
247 run-tests "${setups}" all 1 3 314 run-tests "${setups}" all 1 3
248 pnacl-x86-64-zero-based-sandbox 315 pnacl-x86-64-zero-based-sandbox
316 measure-validator-speed x86-64
249 } 317 }
250 318
251 pnacl-x8632() { 319 pnacl-x8632() {
252 clobber 320 clobber
253 build-prerequisites "x86-32" "bitcode" 321 build-prerequisites "x86-32" "bitcode"
254 local setups="SetupPnaclX8632 \ 322 local setups="SetupPnaclX8632 \
255 SetupPnaclX8632Opt \ 323 SetupPnaclX8632Opt \
256 SetupPnaclTranslatorX8632 \ 324 SetupPnaclTranslatorX8632 \
257 SetupPnaclTranslatorX8632Opt" 325 SetupPnaclTranslatorX8632Opt"
258 build-tests "${setups}" all 1 3 326 build-tests "${setups}" all 1 3
259 run-tests "${setups}" all 1 3 327 run-tests "${setups}" all 1 3
328 measure-validator-speed x86-32
260 } 329 }
261 330
262 nacl-x8632() { 331 nacl-x8632() {
263 clobber 332 clobber
264 build-prerequisites "x86-32" "" 333 build-prerequisites "x86-32" ""
265 local setups="SetupNaclX8632 \ 334 local setups="SetupNaclX8632 \
266 SetupNaclX8632Opt" 335 SetupNaclX8632Opt"
267 build-tests "${setups}" all 1 3 336 build-tests "${setups}" all 1 3
268 run-tests "${setups}" all 1 3 337 run-tests "${setups}" all 1 3
338 measure-validator-speed x86-32
269 } 339 }
270 340
271 nacl-x8664() { 341 nacl-x8664() {
272 clobber 342 clobber
273 build-prerequisites "x86-64" "" 343 build-prerequisites "x86-64" ""
274 local setups="SetupNaclX8664 \ 344 local setups="SetupNaclX8664 \
275 SetupNaclX8664Opt" 345 SetupNaclX8664Opt"
276 build-tests "${setups}" all 1 3 346 build-tests "${setups}" all 1 3
277 run-tests "${setups}" all 1 3 347 run-tests "${setups}" all 1 3
348 measure-validator-speed x86-64
278 } 349 }
279 350
280 351
281 ###################################################################### 352 ######################################################################
282 # Script assumed to be run in native_client/ 353 # Script assumed to be run in native_client/
283 if [[ $(pwd) != */native_client ]]; then 354 if [[ $(pwd) != */native_client ]]; then
284 echo "ERROR: must be run in native_client!" 355 echo "ERROR: must be run in native_client!"
285 exit 1 356 exit 1
286 fi 357 fi
287 358
288 359
289 if [[ $# -eq 0 ]] ; then 360 if [[ $# -eq 0 ]] ; then
290 echo "you must specify a mode on the commandline:" 361 echo "you must specify a mode on the commandline:"
291 exit 1 362 exit 1
292 fi 363 fi
293 364
294 if [ "$(type -t $1)" != "function" ]; then 365 if [ "$(type -t $1)" != "function" ]; then
295 Usage 366 Usage
296 echo "ERROR: unknown mode '$1'." >&2 367 echo "ERROR: unknown mode '$1'." >&2
297 exit 1 368 exit 1
298 fi 369 fi
299 370
300 "$@" 371 "$@"
301 372
302 if [[ ${RETCODE} != 0 ]]; then 373 if [[ ${RETCODE} != 0 ]]; then
303 echo "@@@BUILD_STEP summary@@@" 374 echo "@@@BUILD_STEP summary@@@"
304 echo There were failed stages. 375 echo There were failed stages.
305 exit ${RETCODE} 376 exit ${RETCODE}
306 fi 377 fi
OLDNEW
« no previous file with comments | « no previous file | tools/canned_nexe_tool.sh » ('j') | tools/canned_nexe_tool.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698