diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/make_release.py | 117 | ||||
-rwxr-xr-x | util/qdo | 57 | ||||
-rwxr-xr-x | util/regress | 3 |
3 files changed, 124 insertions, 53 deletions
diff --git a/util/make_release.py b/util/make_release.py index 636391a96..b6c5f08fa 100755 --- a/util/make_release.py +++ b/util/make_release.py @@ -72,7 +72,7 @@ def movedir(srcdir, destdir, dir): os.makedirs(dirname(dest)) shutil.move(src, dest) -if not isdir('BitKeeper'): +if not isdir('.hg'): sys.exit('Not in the top level of an m5 tree!') usage = '%s <destdir> <release name>' % sys.argv[0] @@ -83,9 +83,9 @@ if len(sys.argv) != 3: destdir = sys.argv[1] releasename = sys.argv[2] release_dest = joinpath(destdir, 'release') -encumbered_dest = joinpath(destdir, 'encumbered') +#encumbered_dest = joinpath(destdir, 'encumbered') release_dir = joinpath(release_dest, releasename) -encumbered_dir = joinpath(encumbered_dest, releasename) +#encumbered_dir = joinpath(encumbered_dest, releasename) if exists(destdir): if not isdir(destdir): @@ -99,42 +99,49 @@ if exists(release_dest): '%s exists, but is not a directory' % release_dest rmtree(release_dest) -if exists(encumbered_dest): - if not isdir(encumbered_dest): - raise AttributeError, \ - '%s exists, but is not a directory' % encumbered_dest - rmtree(encumbered_dest) +#if exists(encumbered_dest): +# if not isdir(encumbered_dest): +# raise AttributeError, \ +# '%s exists, but is not a directory' % encumbered_dest +# rmtree(encumbered_dest) mkdir(release_dest) -mkdir(encumbered_dest) +#mkdir(encumbered_dest) mkdir(release_dir) -mkdir(encumbered_dir) - -system('bk export -tplain -w -r+ %s' % release_dir) - +#mkdir(encumbered_dir) +system('hg update') +system('rsync -av --exclude ".hg*" --exclude build . %s' % release_dir) # move the time forward on some files by a couple of minutes so we can # avoid building things unnecessarily when = int(time.time()) + 120 # make sure scons doesn't try to run flex unnecessarily -touch(release_dir, 'src/encumbered/eio/exolex.cc', when=(when, when)) +#touch(release_dir, 'src/encumbered/eio/exolex.cc', when=(when, when)) # get rid of non-shipping code -rmtree(release_dir, 'src/encumbered/dev') +#rmtree(release_dir, 'src/encumbered/dev') rmtree(release_dir, 'src/cpu/ozone') -rmtree(release_dir, 'src/mem/cache/tags/split*.cc') -rmtree(release_dir, 'src/mem/cache/tags/split*.hh') -rmtree(release_dir, 'src/mem/cache/prefetch/ghb_*.cc') -rmtree(release_dir, 'src/mem/cache/prefetch/ghb_*.hh') -rmtree(release_dir, 'src/mem/cache/prefetch/stride_*.cc') -rmtree(release_dir, 'src/mem/cache/prefetch/stride_*.hh') +rmtree(release_dir, 'src/arch/x86') +#rmtree(release_dir, 'src/mem/cache/tags/split*.cc') +#rmtree(release_dir, 'src/mem/cache/tags/split*.hh') +#rmtree(release_dir, 'src/mem/cache/prefetch/ghb_*.cc') +#rmtree(release_dir, 'src/mem/cache/prefetch/ghb_*.hh') +#rmtree(release_dir, 'src/mem/cache/prefetch/stride_*.cc') +#rmtree(release_dir, 'src/mem/cache/prefetch/stride_*.hh') rmtree(release_dir, 'configs/fullsys') rmtree(release_dir, 'configs/test') rmtree(release_dir, 'configs/splash2') rmtree(release_dir, 'tests/long/*/ref') rmtree(release_dir, 'tests/old') -rmtree(release_dir, 'src/dev/i8*') +rmtree(release_dir, 'tests/quick/00.hello/ref/x86') +rmtree(release_dir, 'tests/test-progs/hello/bin/x86') +rmtree(release_dir, 'src/dev/x86') + +remove(release_dir, 'src/cpu/nativetrace.hh') +remove(release_dir, 'src/cpu/nativetrace.cc') +remove(release_dir, 'build_opts/X86_SE') +remove(release_dir, 'build_opts/X86_FS') # get rid of some of private scripts remove(release_dir, 'util/chgcopyright') @@ -153,19 +160,66 @@ def remove_sources(regex, subdir): outscript.write(line) outscript.close() -# fix up the SConscript to deal with files we've removed -remove_sources(r'.*split.*\.cc', 'src/mem/cache/tags') -remove_sources(r'.*(ghb|stride)_prefetcher\.cc', 'src/mem/cache/prefetch') -remove_sources(r'.*i8254xGBe.*', 'src/dev') +def remove_lines(s_regex, e_regex, f): + f = joinpath(release_dir, f) + if isinstance(s_regex, str): + s_regex = re.compile(s_regex) + if isinstance(e_regex, str): + e_regex = re.compile(e_regex) + inscript = file(f, 'r').readlines() + outscript = file(f, 'w') + skipping = False + for line in inscript: + if (not skipping and s_regex.match(line)) or \ + (e_regex and skipping and not e_regex.match(line)): + skipping = True + continue + skipping = False + outscript.write(line) + outscript.close() + +def replace_line(s_regex, f, rl): + f = joinpath(release_dir, f) + if isinstance(s_regex, str): + s_regex = re.compile(s_regex) + inscript = file(f, 'r').readlines() + outscript = file(f, 'w') + for line in inscript: + if s_regex.match(line): + outscript.write(rl) + continue + outscript.write(line) + outscript.close() + +# fix up the SConscript to deal with files we've removed +#remove_sources(r'.*split.*\.cc', 'src/mem/cache/tags') +#remove_sources(r'.*(ghb|stride)_prefetcher\.cc', 'src/mem/cache/prefetch') +remove_sources(r'.*nativetrace.*', 'src/cpu') + +remove_lines(r'.*X86.*', None, 'src/arch/isa_specific.hh') +remove_lines(r'.*X86.*', None, 'src/base/traceflags.py') +remove_lines(r'.*X86.*', None, 'src/base/loader/object_file.hh') +remove_lines(r'.*_X86_.*', '.*else.*', 'src/base/loader/elf_object.cc') +remove_lines(r'.*X86_ISA.*', r'^.el.*','src/sim/process.cc') +remove_lines(r'.*x86.*', r'.*mips.*','src/cpu/BaseCPU.py') +remove_lines(r'.*X86_ISA.*', r'^.*else.*','src/cpu/o3/dyn_inst.hh') +remove_lines(r'.*X86_ISA.*', r'.*stay.*','src/cpu/simple/base.cc') +remove_lines(r'.*x86.*', r'^if.*','src/cpu/SConscript') + +remove_lines(r'.*makeX86System.*', r'.*makeDualRoot.*','configs/common/FSConfig.py') +remove_lines(r'.*X86.*', None, 'configs/example/fs.py') +remove_lines(r'.*x86.*', None, 'configs/example/fs.py') + +replace_line(r'.*X86_SE.*', 'util/regress', " 'SPARC_SE,SPARC_FS',") benches = [ 'bzip2', 'eon', 'gzip', 'mcf', 'parser', 'perlbmk', 'twolf', 'vortex' ] for bench in benches: rmtree(release_dir, 'tests', 'test-progs', bench) -movedir(release_dir, encumbered_dir, 'src/encumbered') -movedir(release_dir, encumbered_dir, 'tests/test-progs/anagram') -movedir(release_dir, encumbered_dir, 'tests/quick/20.eio-short') +#movedir(release_dir, encumbered_dir, 'src/encumbered') +rmtree(release_dir, 'tests/test-progs/anagram') +rmtree(release_dir, 'tests/quick/20.eio-short') def taritup(directory, destdir, filename): basedir = dirname(directory) @@ -175,8 +229,7 @@ def taritup(directory, destdir, filename): system('cd %s; tar cfj %s %s' % (basedir, tarball, tardir)) taritup(release_dir, destdir, '%s.tar.bz2' % releasename) -taritup(encumbered_dir, destdir, '%s-encumbered.tar.bz2' % releasename) +#taritup(encumbered_dir, destdir, '%s-encumbered.tar.bz2' % releasename) print "release created in %s" % destdir -print "don't forget to tag the repository! The following command will do it:" -print "bk tag %s" % releasename +print "don't forget to tag the repository!" @@ -1,6 +1,6 @@ #! /usr/bin/env python -# Copyright (c) 2004-2005 The Regents of The University of Michigan +# Copyright (c) 2004-2005, 2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,6 +27,15 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Authors: Steve Reinhardt +# Ali Saidi + +# Important! +# This script expects a simple $ prompt, if you are using a shell other than +# sh which defaults to this you'll need to add something like the following +# to your bashrc/bash_profile script: +#if [ "$OAR_USER" = "xxxx" ]; then +# PS1='$ ' + import sys import os @@ -46,13 +55,13 @@ optparser.add_option('-e', dest='stderr_file', optparser.add_option('-o', dest='stdout_file', help='command stdout output file') optparser.add_option('-l', dest='save_log', action='store_true', - help='save qsub output log file') + help='save oarsub output log file') optparser.add_option('-N', dest='job_name', - help='qsub job name') + help='oarsub job name') optparser.add_option('-q', dest='dest_queue', - help='qsub destination queue') -optparser.add_option('--qwait', dest='qsub_timeout', type='int', - help='qsub queue wait timeout', default=30*60) + help='oarsub destination queue') +optparser.add_option('--qwait', dest='oarsub_timeout', type='int', + help='oarsub queue wait timeout', default=30*60) optparser.add_option('-t', dest='cmd_timeout', type='int', help='command execution timeout', default=600*60) @@ -63,7 +72,7 @@ if cmd == []: sys.exit(1) # If we want to do this, need to add check here to make sure cmd[0] is -# a valid PBS job name, else qsub will die on us. +# a valid PBS job name, else oarsub will die on us. # #if not options.job_name: # options.job_name = cmd[0] @@ -98,11 +107,11 @@ class Shell(pexpect.spawn): self.quick_timeout = 15 # wait for a prompt, then change it try: - self.expect('\$ ', options.qsub_timeout) + self.expect('\$ ', options.oarsub_timeout) except pexpect.TIMEOUT: - print >>sys.stderr, "%s: qsub timed out." % progname + print >>sys.stderr, "%s: oarsub timed out." % progname self.kill(9) - self.close(wait=True) + self.safe_close() sys.exit(1) self.do_command('unset PROMPT_COMMAND; PS1="qdo$ "') @@ -137,8 +146,17 @@ class Shell(pexpect.spawn): (output, status) = shell.do_command('[ -d %s ]' % dirname, self.quick_timeout) return status == 0 - - + + # Don't actually try to close it.. just wait until it closes by itself + # We can't actually kill the pid which is what it's trying to do, and if + # we call wait we could be in an unfortunate situation of it printing input + # right as we call wait, so the input is never read and the process never ends + def safe_close(self): + count = 0 + while self.isalive() and count < 10: + time.sleep(1) + self.close(force=False) + # Spawn the interactive pool job. # Hack to do link on poolfs... disabled for now since @@ -148,11 +166,12 @@ if False and len(cmd) > 50: shell_cmd = 'ssh -t poolfs /bin/sh -l' print "%s: running %s on poolfs" % (progname, cmd[0]) else: - shell_cmd = 'qsub -I -S /bin/sh' + shell_cmd = 'oarsub -I' if options.job_name: - shell_cmd += ' -N "%s"' % options.job_name + shell_cmd += ' -n "%s"' % options.job_name if options.dest_queue: shell_cmd += ' -q ' + options.dest_queue + shell_cmd += ' -d %s' % cwd shell = Shell(shell_cmd) @@ -197,25 +216,23 @@ try: except pexpect.TIMEOUT: print >>sys.stderr, "%s: command timed out after %d seconds." \ % (progname, options.cmd_timeout) - shell.sendline('~.') # qsub/ssh termination escape sequence - shell.close(wait=True) + shell.sendline('~.') # oarsub/ssh termination escape sequence + shell.safe_close() status = 3 if output: print output - finally: # end job if shell.isalive(): shell.sendline('exit') - shell.expect('qsub: job .* completed\r\n') - shell.close(wait=True) + shell.expect('Disconnected from OAR job .*') + shell.safe_close() # if there was an error, log the output even if not requested if status != 0 or options.save_log: log = file('qdo-log.' + str(os.getpid()), 'w') log.write(shell.full_output) log.close() - del shell sys.exit(status) diff --git a/util/regress b/util/regress index 8ff07c453..034201317 100755 --- a/util/regress +++ b/util/regress @@ -40,7 +40,8 @@ optparser.add_option('-v', '--verbose', dest='verbose', action='store_true', default=False, help='echo commands before executing') optparser.add_option('--builds', dest='builds', - default='ALPHA_SE,ALPHA_FS,MIPS_SE,SPARC_SE,SPARC_FS', + default='ALPHA_SE,ALPHA_FS,MIPS_SE,' + \ + 'SPARC_SE,SPARC_FS,X86_SE', help='comma-separated list of build targets to test ' " (default: '%default')" ) optparser.add_option('--variants', dest='variants', |