Mercurial > hg > truffle
comparison mx/commands.py @ 7685:7d66682cc901
Merge.
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Fri, 01 Feb 2013 17:06:26 +0100 |
parents | 9a521597686b |
children | cf27135ccf5b |
comparison
equal
deleted
inserted
replaced
7684:bbf97d6688d3 | 7685:7d66682cc901 |
---|---|
24 # or visit www.oracle.com if you need additional information or have any | 24 # or visit www.oracle.com if you need additional information or have any |
25 # questions. | 25 # questions. |
26 # | 26 # |
27 # ---------------------------------------------------------------------------------------------------- | 27 # ---------------------------------------------------------------------------------------------------- |
28 | 28 |
29 import os, sys, shutil, zipfile, tempfile, re, time, datetime, platform, subprocess, multiprocessing, types | 29 import os, sys, shutil, zipfile, tempfile, re, time, datetime, platform, subprocess, multiprocessing |
30 from os.path import join, exists, dirname, basename | 30 from os.path import join, exists, dirname, basename |
31 from argparse import ArgumentParser, REMAINDER | 31 from argparse import ArgumentParser, REMAINDER |
32 from threading import Thread | |
33 import mx | 32 import mx |
34 import sanitycheck | 33 import sanitycheck |
35 import json | 34 import json |
36 | 35 |
37 _graal_home = dirname(dirname(__file__)) | 36 _graal_home = dirname(dirname(__file__)) |
78 | 77 |
79 """ | 78 """ |
80 | 79 |
81 def _chmodDir(chmodFlags, dirname, fnames): | 80 def _chmodDir(chmodFlags, dirname, fnames): |
82 os.chmod(dirname, chmodFlags) | 81 os.chmod(dirname, chmodFlags) |
83 for file in fnames: | 82 for name in fnames: |
84 os.chmod(os.path.join(dirname, file), chmodFlags) | 83 os.chmod(os.path.join(dirname, name), chmodFlags) |
85 | 84 |
86 def chmodRecursive(dirname, chmodFlags): | 85 def chmodRecursive(dirname, chmodFlags): |
87 os.path.walk(dirname, _chmodDir, chmodFlags) | 86 os.path.walk(dirname, _chmodDir, chmodFlags) |
88 | 87 |
89 def clean(args): | 88 def clean(args): |
573 # pass them down in the command line. This one is an example of that. | 572 # pass them down in the command line. This one is an example of that. |
574 runCmd.append('STRIP_POLICY=no_strip') | 573 runCmd.append('STRIP_POLICY=no_strip') |
575 # This removes the need to unzip the *.diz files before debugging in gdb | 574 # This removes the need to unzip the *.diz files before debugging in gdb |
576 env.setdefault('ZIP_DEBUGINFO_FILES', '0') | 575 env.setdefault('ZIP_DEBUGINFO_FILES', '0') |
577 | 576 |
577 # We don't need to run the Queens test (i.e. test_gamma) | |
578 env.setdefault('TEST_IN_BUILD', 'false') | |
579 | |
578 # Clear these 2 variables as having them set can cause very confusing build problems | 580 # Clear these 2 variables as having them set can cause very confusing build problems |
579 env.pop('LD_LIBRARY_PATH', None) | 581 env.pop('LD_LIBRARY_PATH', None) |
580 env.pop('CLASSPATH', None) | 582 env.pop('CLASSPATH', None) |
581 | 583 |
582 mx.run(runCmd, cwd=join(_graal_home, 'make'), err=filterXusage) | 584 mx.run(runCmd, cwd=join(_graal_home, 'make'), err=filterXusage) |
774 if not args.cleanJava: | 776 if not args.cleanJava: |
775 cleanArgs.append('--no-java') | 777 cleanArgs.append('--no-java') |
776 clean(cleanArgs) | 778 clean(cleanArgs) |
777 tasks.append(t.stop()) | 779 tasks.append(t.stop()) |
778 | 780 |
781 eclipse_exe = os.environ.get('ECLIPSE_EXE') | |
782 if eclipse_exe is not None: | |
783 t = Task('CodeFormatCheck') | |
784 if mx.eclipseformat(['-e', eclipse_exe]) != 0: | |
785 t.abort('Formatter modified files - run "mx eclipseformat", check in changes and repush') | |
786 tasks.append(t.stop()) | |
787 | |
779 t = Task('BuildJava') | 788 t = Task('BuildJava') |
780 build(['--no-native']) | 789 build(['--no-native']) |
781 tasks.append(t.stop()) | 790 tasks.append(t.stop()) |
782 | 791 |
783 if exists('jacoco.exec'): | 792 if exists('jacoco.exec'): |
873 count = 1 | 882 count = 1 |
874 if len(args) > 0 and args[0].isdigit(): | 883 if len(args) > 0 and args[0].isdigit(): |
875 count = int(args[0]) | 884 count = int(args[0]) |
876 del args[0] | 885 del args[0] |
877 | 886 |
878 for n in range(count): | 887 for _ in range(count): |
879 if not vm(['-XX:+DeoptimizeALot', '-XX:+VerifyOops'] + args + ['-version'], vmbuild='fastdebug') == 0: | 888 if not vm(['-XX:+DeoptimizeALot', '-XX:+VerifyOops'] + args + ['-version'], vmbuild='fastdebug') == 0: |
880 mx.abort("Failed") | 889 mx.abort("Failed") |
881 | 890 |
882 def longtests(args): | 891 def longtests(args): |
883 | 892 |
914 del args[index] | 923 del args[index] |
915 else: | 924 else: |
916 mx.abort('-resultfile must be followed by a file name') | 925 mx.abort('-resultfile must be followed by a file name') |
917 vm = _vm | 926 vm = _vm |
918 if len(args) is 0: | 927 if len(args) is 0: |
919 args += ['all'] | 928 args = ['all'] |
929 | |
930 def benchmarks_in_group(group): | |
931 prefix = group + ':' | |
932 return [a[len(prefix):] for a in args if a.startswith(prefix)] | |
920 | 933 |
921 results = {} | 934 results = {} |
922 benchmarks = [] | 935 benchmarks = [] |
923 #DaCapo | 936 #DaCapo |
924 if ('dacapo' in args or 'all' in args): | 937 if ('dacapo' in args or 'all' in args): |
925 benchmarks += sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) | 938 benchmarks += sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) |
926 else: | 939 else: |
927 dacapos = [a[7:] for a in args if a.startswith('dacapo:')] | 940 dacapos = benchmarks_in_group('dacapo') |
928 for dacapo in dacapos: | 941 for dacapo in dacapos: |
929 if dacapo not in sanitycheck.dacapoSanityWarmup.keys(): | 942 if dacapo not in sanitycheck.dacapoSanityWarmup.keys(): |
930 mx.abort('Unknown dacapo : ' + dacapo) | 943 mx.abort('Unknown DaCapo : ' + dacapo) |
931 benchmarks += [sanitycheck.getDacapo(dacapo, sanitycheck.dacapoSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark])] | 944 benchmarks += [sanitycheck.getDacapo(dacapo, sanitycheck.dacapoSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark])] |
932 | 945 |
933 if ('scaladacapo' in args or 'all' in args): | 946 if ('scaladacapo' in args or 'all' in args): |
934 benchmarks += sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) | 947 benchmarks += sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Benchmark) |
935 else: | 948 else: |
936 dacapos = [a[7:] for a in args if a.startswith('scaladacapo:')] | 949 scaladacapos = benchmarks_in_group('scaladacapo') |
937 for dacapo in dacapos: | 950 for scaladacapo in scaladacapos: |
938 if dacapo not in sanitycheck.dacapoScalaSanityWarmup.keys(): | 951 if scaladacapo not in sanitycheck.dacapoScalaSanityWarmup.keys(): |
939 mx.abort('Unknown dacapo : ' + dacapo) | 952 mx.abort('Unknown Scala DaCapo : ' + scaladacapo) |
940 benchmarks += [sanitycheck.getScalaDacapo(dacapo, sanitycheck.dacapoScalaSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark])] | 953 benchmarks += [sanitycheck.getScalaDacapo(scaladacapo, sanitycheck.dacapoScalaSanityWarmup[scaladacapo][sanitycheck.SanityCheckLevel.Benchmark])] |
941 | 954 |
942 #Bootstrap | 955 #Bootstrap |
943 if ('bootstrap' in args or 'all' in args): | 956 if ('bootstrap' in args or 'all' in args): |
944 benchmarks += sanitycheck.getBootstraps() | 957 benchmarks += sanitycheck.getBootstraps() |
945 #SPECjvm2008 | 958 #SPECjvm2008 |
946 if ('specjvm2008' in args or 'all' in args): | 959 if ('specjvm2008' in args or 'all' in args): |
947 benchmarks += [sanitycheck.getSPECjvm2008([], False, True, 120, 120)] | 960 benchmarks += [sanitycheck.getSPECjvm2008([], False, True, 120, 120)] |
948 else: | 961 else: |
949 specjvms = [a[12:] for a in args if a.startswith('specjvm2008:')] | 962 specjvms = benchmarks_in_group('specjvm2008') |
950 for specjvm in specjvms: | 963 for specjvm in specjvms: |
951 benchmarks += [sanitycheck.getSPECjvm2008([specjvm], False, True, 120, 120)] | 964 benchmarks += [sanitycheck.getSPECjvm2008([specjvm], False, True, 120, 120)] |
952 | 965 |
953 if ('specjbb2005' in args or 'all' in args): | 966 if ('specjbb2005' in args or 'all' in args): |
954 benchmarks += [sanitycheck.getSPECjbb2005()] | 967 benchmarks += [sanitycheck.getSPECjbb2005()] |
968 | |
969 if ('specjbb2013' in args or 'all' in args): | |
970 benchmarks += [sanitycheck.getSPECjbb2013()] | |
955 | 971 |
956 for test in benchmarks: | 972 for test in benchmarks: |
957 for (group, res) in test.bench(vm).items(): | 973 for (groupName, res) in test.bench(vm).items(): |
958 if not results.has_key(group): | 974 group = results.setdefault(groupName, {}) |
959 results[group] = {}; | 975 group.update(res) |
960 results[group].update(res) | |
961 mx.log(json.dumps(results)) | 976 mx.log(json.dumps(results)) |
962 if resultFile: | 977 if resultFile: |
963 with open(resultFile, 'w') as f: | 978 with open(resultFile, 'w') as f: |
964 f.write(json.dumps(results)) | 979 f.write(json.dumps(results)) |
965 | 980 |