annotate mx.graal/mx_graal.py @ 22139:258eaaa98484

Initial split off from monolithic basic-graal repo
author Doug Simon <doug.simon@oracle.com>
date Mon, 06 Jul 2015 14:11:33 +0200
parents 51ceda0cf404
children d5a51a47eb1b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3718
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 # ----------------------------------------------------------------------------------------------------
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 #
18897
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
4 # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
3718
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 # This code is free software; you can redistribute it and/or modify it
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 # under the terms of the GNU General Public License version 2 only, as
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 # published by the Free Software Foundation.
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 # This code is distributed in the hope that it will be useful, but WITHOUT
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 # version 2 for more details (a copy is included in the LICENSE file that
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 # accompanied this code).
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 # You should have received a copy of the GNU General Public License version
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 # 2 along with this work; if not, write to the Free Software Foundation,
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 # or visit www.oracle.com if you need additional information or have any
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 # questions.
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24 #
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 # ----------------------------------------------------------------------------------------------------
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
27 import os, platform
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
28 from os.path import join, exists
4215
a2caa019ba3a Fix mx : commands' scripts mx_init hook should be called before parsing command line arguments.
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4187
diff changeset
29 import sanitycheck
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
30 import itertools
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
31 import json
22031
434fbaaf53d7 moved findbugs support from mx_graal.py to mx_findbugs.py
Doug Simon <doug.simon@oracle.com>
parents: 22024
diff changeset
32
434fbaaf53d7 moved findbugs support from mx_graal.py to mx_findbugs.py
Doug Simon <doug.simon@oracle.com>
parents: 22024
diff changeset
33 import mx
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
34 import mx_jvmci
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
35 from mx_jvmci import JDKDeployedDist, buildvms, vm, VM, Task, parseVmArgs, get_vm, unittest, ctw, isVMSupported
3718
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36
22018
11ed27b2abe8 remove hard-coded use of 'mx' to refer to the mxDir for the graal suite
Doug Simon <doug.simon@oracle.com>
parents: 22017
diff changeset
37 _suite = mx.suite('graal')
4417
648a7873cea2 Made it possible to build and run the client and server VM with a new '--vm' option to 'mx build' and a global option of the same name.
Doug Simon <doug.simon@oracle.com>
parents: 4407
diff changeset
38
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
39 _graalDeployedDist = JDKDeployedDist('GRAAL', usesJVMCIClassLoader=True)
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
40 _graalTruffleDeployedDist = JDKDeployedDist('GRAAL_TRUFFLE', usesJVMCIClassLoader=True)
15580
ce201bb843b4 mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents: 15577
diff changeset
41
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
42 _graalDeployedDist.postJdkInstall = lambda jdkDir, targetDir: _updateGraalPropertiesFile(join(jdkDir, 'jre', 'lib'))
15405
5dcf0ae606f3 mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents: 15404
diff changeset
43
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
44 mx_jvmci.jdkDeployedDists += [_graalDeployedDist, _graalTruffleDeployedDist]
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
45 mx_jvmci.jacocoIncludes += ['com.oracle.graal.*']
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
46 mx_jvmci.jacocoExcludedAnnotations += ['@Snippet', '@ClassSubstitution']
4156
843c8d6720da Added 'export' command for creating a GraalVM zip file distribution without the Mercurial data or VM sources.
Doug Simon <doug.simon@oracle.com>
parents: 4155
diff changeset
47
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
48 def _run_benchmark(args, availableBenchmarks, runBenchmark):
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
49
22020
36a7ec14279d moved unit test support from mx_graal.py to mx.py
Doug Simon <doug.simon@oracle.com>
parents: 22019
diff changeset
50 vmOpts, benchmarksAndOptions = mx.extract_VM_args(args, useDoubleDash=availableBenchmarks is None)
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
51
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
52 if availableBenchmarks is None:
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
53 harnessArgs = benchmarksAndOptions
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
54 return runBenchmark(None, harnessArgs, vmOpts)
4215
a2caa019ba3a Fix mx : commands' scripts mx_init hook should be called before parsing command line arguments.
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4187
diff changeset
55
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
56 if len(benchmarksAndOptions) == 0:
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
57 mx.abort('at least one benchmark name or "all" must be specified')
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
58 benchmarks = list(itertools.takewhile(lambda x: not x.startswith('-'), benchmarksAndOptions))
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
59 harnessArgs = benchmarksAndOptions[len(benchmarks):]
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
60
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
61 if 'all' in benchmarks:
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
62 benchmarks = availableBenchmarks
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
63 else:
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
64 for bm in benchmarks:
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
65 if bm not in availableBenchmarks:
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
66 mx.abort('unknown benchmark: ' + bm + '\nselect one of: ' + str(availableBenchmarks))
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
67
4215
a2caa019ba3a Fix mx : commands' scripts mx_init hook should be called before parsing command line arguments.
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4187
diff changeset
68 failed = []
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
69 for bm in benchmarks:
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
70 if not runBenchmark(bm, harnessArgs, vmOpts):
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
71 failed.append(bm)
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
72
4157
b26279781d95 Simplified 'dacapo' command and made it more suitable for gate usage.
Doug Simon <doug.simon@oracle.com>
parents: 4156
diff changeset
73 if len(failed) != 0:
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
74 mx.abort('Benchmark failures: ' + str(failed))
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
75
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
76 def dacapo(args):
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
77 """run one or more DaCapo benchmarks"""
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
78
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
79 def launcher(bm, harnessArgs, extraVmOpts):
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
80 return sanitycheck.getDacapo(bm, harnessArgs).test(get_vm(), extraVmOpts=extraVmOpts)
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
81
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
82 _run_benchmark(args, sanitycheck.dacapoSanityWarmup.keys(), launcher)
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
83
4480
7d6490436b57 Add Scala DaCapo benchs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4438
diff changeset
84 def scaladacapo(args):
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
85 """run one or more Scala DaCapo benchmarks"""
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
86
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
87 def launcher(bm, harnessArgs, extraVmOpts):
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
88 return sanitycheck.getScalaDacapo(bm, harnessArgs).test(get_vm(), extraVmOpts=extraVmOpts)
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
89
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
90 _run_benchmark(args, sanitycheck.dacapoScalaSanityWarmup.keys(), launcher)
4584
7e5d8d1c74a1 Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents: 4582
diff changeset
91
21958
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
92 def _updateGraalPropertiesFile(jreLibDir):
21560
a9fba0dfb155 added lower runtime overhead mechanism for setting "graal.version" system property
Doug Simon <doug.simon@oracle.com>
parents: 21559
diff changeset
93 """
21958
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
94 Updates (or creates) 'jreLibDir'/jvmci/graal.properties to set/modify the
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
95 graal.version property.
21560
a9fba0dfb155 added lower runtime overhead mechanism for setting "graal.version" system property
Doug Simon <doug.simon@oracle.com>
parents: 21559
diff changeset
96 """
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
97 version = _suite.release_version()
21958
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
98 graalProperties = join(jreLibDir, 'jvmci', 'graal.properties')
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
99 if not exists(graalProperties):
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
100 with open(graalProperties, 'w') as fp:
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
101 print >> fp, 'graal.version=' + version
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
102 else:
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
103 content = []
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
104 with open(graalProperties) as fp:
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
105 for line in fp:
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
106 if line.startswith('graal.version='):
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
107 content.append('graal.version=' + version)
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
108 else:
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
109 content.append(line.rstrip(os.linesep))
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
110 with open(graalProperties, 'w') as fp:
ab37091f0980 replaced class file patching with use of jre/lib/jvmci/graal.properties to set graal.version system property
Doug Simon <doug.simon@oracle.com>
parents: 21951
diff changeset
111 fp.write(os.linesep.join(content))
21070
2ee48d02afe3 mx: Merge graal service files
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21059
diff changeset
112
18897
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
113 def microbench(args):
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
114 """run JMH microbenchmark projects"""
22020
36a7ec14279d moved unit test support from mx_graal.py to mx.py
Doug Simon <doug.simon@oracle.com>
parents: 22019
diff changeset
115 vmArgs, jmhArgs = mx.extract_VM_args(args, useDoubleDash=True)
18897
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
116
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
117 # look for -f in JMH arguments
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
118 containsF = False
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
119 forking = True
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
120 for i in range(len(jmhArgs)):
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
121 arg = jmhArgs[i]
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
122 if arg.startswith('-f'):
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
123 containsF = True
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
124 if arg == '-f' and (i+1) < len(jmhArgs):
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
125 arg += jmhArgs[i+1]
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
126 try:
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
127 if int(arg[2:]) == 0:
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
128 forking = False
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
129 except ValueError:
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
130 pass
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
131
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
132 # default to -f1 if not specified otherwise
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
133 if not containsF:
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
134 jmhArgs += ['-f1']
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
135
19044
c9ef5e8bda3a Fix comment.
Roland Schatz <roland.schatz@oracle.com>
parents: 18983
diff changeset
136 # find all projects with a direct JMH dependency
18897
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
137 jmhProjects = []
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
138 for p in mx.projects():
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
139 if 'JMH' in p.deps:
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
140 jmhProjects.append(p.name)
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
141 cp = mx.classpath(jmhProjects)
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
142
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
143 # execute JMH runner
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
144 args = ['-cp', cp]
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
145 if not forking:
18931
926488f5d345 mx: fix duplicate arguments for microbench
Roland Schatz <roland.schatz@oracle.com>
parents: 18897
diff changeset
146 args += vmArgs
18897
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
147 args += ['org.openjdk.jmh.Main']
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
148 if forking:
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
149 (_, _, jvm, _, _) = parseVmArgs(vmArgs)
18931
926488f5d345 mx: fix duplicate arguments for microbench
Roland Schatz <roland.schatz@oracle.com>
parents: 18897
diff changeset
150 args += ['--jvmArgsPrepend', ' '.join(['-' + jvm] + vmArgs)]
18897
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
151 vm(args + jmhArgs)
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
152
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
153 def _graal_gate_runner(args, tasks):
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
154 # Build server-hosted-jvmci now so we can run the unit tests
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
155 with Task('BuildHotSpotJVMCIHosted: product', tasks) as t:
21043
5ea65fe64368 Check distributions overlap in gate
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21040
diff changeset
156 if t: buildvms(['--vms', 'server', '--builds', 'product', '--check-distributions'])
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
157
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
158 # Run unit tests on server-hosted-jvmci
19162
32c7a5a88523 Run unit tests even earlier during gate
Doug Simon <doug.simon@oracle.com>
parents: 19160
diff changeset
159 with VM('server', 'product'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
160 with Task('UnitTests:hosted-product', tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
161 if t: unittest(['--enable-timing', '--verbose', '--fail-fast'])
19160
d4f80cf249d0 Run unittest earlier during gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19044
diff changeset
162
21965
647459c6013a mx gate: add UnitTestsSSA task.
Josef Eisl <josef.eisl@jku.at>
parents: 21960
diff changeset
163 # Run unit tests on server-hosted-jvmci with -G:+SSA_LIR
647459c6013a mx gate: add UnitTestsSSA task.
Josef Eisl <josef.eisl@jku.at>
parents: 21960
diff changeset
164 with VM('server', 'product'):
647459c6013a mx gate: add UnitTestsSSA task.
Josef Eisl <josef.eisl@jku.at>
parents: 21960
diff changeset
165 with Task('UnitTestsSSA:hosted-product', tasks) as t:
647459c6013a mx gate: add UnitTestsSSA task.
Josef Eisl <josef.eisl@jku.at>
parents: 21960
diff changeset
166 if t: unittest(['--enable-timing', '--verbose', '--fail-fast', '-G:+SSA_LIR'])
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
167 # Run ctw against rt.jar on server-hosted-jvmci
20032
4d119424b4ce Add CTW of rt.jar to gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 20020
diff changeset
168 with VM('server', 'product'):
4d119424b4ce Add CTW of rt.jar to gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 20020
diff changeset
169 with Task('CTW:hosted-product', tasks) as t:
22095
1ccd66f5890c Disable inline during parsing in CTW gate.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 22041
diff changeset
170 if t: ctw(['--ctwopts', '-Inline +ExitVMOnException', '-esa', '-G:+CompileTheWorldMultiThreaded', '-G:-InlineDuringParsing', '-G:-CompileTheWorldVerbose'])
20032
4d119424b4ce Add CTW of rt.jar to gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 20020
diff changeset
171
19162
32c7a5a88523 Run unit tests even earlier during gate
Doug Simon <doug.simon@oracle.com>
parents: 19160
diff changeset
172 # Build the other VM flavors
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
173 with Task('BuildHotSpotGraalOthers: fastdebug,product', tasks) as t:
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
174 if t: buildvms(['--vms', 'jvmci,server', '--builds', 'fastdebug,product', '--check-distributions'])
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
175
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
176 with VM('jvmci', 'fastdebug'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
177 with Task('BootstrapWithSystemAssertions:fastdebug', tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
178 if t: vm(['-esa', '-XX:-TieredCompilation', '-version'])
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
179
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
180 with VM('jvmci', 'fastdebug'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
181 with Task('BootstrapEconomyWithSystemAssertions:fastdebug', tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
182 if t: vm(['-esa', '-XX:-TieredCompilation', '-G:CompilerConfiguration=economy', '-version'])
19776
287f7c223d58 Add compiler configuration "economy".
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19733
diff changeset
183
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
184 with VM('jvmci', 'fastdebug'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
185 with Task('BootstrapWithSystemAssertionsNoCoop:fastdebug', tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
186 if t: vm(['-esa', '-XX:-TieredCompilation', '-XX:-UseCompressedOops', '-version'])
14123
dc41eab09fe8 gate: add non-tiered bootstrap
Bernhard Urban <bernhard.urban@jku.at>
parents: 14116
diff changeset
187
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
188 with VM('jvmci', 'fastdebug'):
21059
59632bb8e4ad Add bootstrap with invoke exception edges to gate.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 21043
diff changeset
189 with Task('BootstrapWithExceptionEdges:fastdebug', tasks) as t:
59632bb8e4ad Add bootstrap with invoke exception edges to gate.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 21043
diff changeset
190 if t: vm(['-esa', '-XX:-TieredCompilation', '-G:+StressInvokeWithExceptionNode', '-version'])
59632bb8e4ad Add bootstrap with invoke exception edges to gate.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 21043
diff changeset
191
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
192 with VM('jvmci', 'product'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
193 with Task('BootstrapWithGCVerification:product', tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
194 if t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
195 out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
196 vm(['-XX:-TieredCompilation', '-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out)
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
197
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
198 with VM('jvmci', 'product'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
199 with Task('BootstrapWithG1GCVerification:product', tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
200 if t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
201 out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
202 vm(['-XX:-TieredCompilation', '-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out)
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
203
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
204 with VM('jvmci', 'product'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
205 with Task('BootstrapWithRegisterPressure:product', tasks) as t:
20994
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20992 20989
diff changeset
206 if t:
20992
0a4bbeae6e31 [SPARC] Configure registers right for register pressure in gate run
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20967
diff changeset
207 registers = 'o0,o1,o2,o3,f8,f9,d32,d34' if platform.processor() == 'sparc' else 'rbx,r11,r10,r14,xmm3,xmm11,xmm14'
0a4bbeae6e31 [SPARC] Configure registers right for register pressure in gate run
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 20967
diff changeset
208 vm(['-XX:-TieredCompilation', '-G:RegisterPressure=' + registers, '-esa', '-version'])
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
209
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
210 with VM('jvmci', 'product'):
21447
f172a195a8a9 mx gate: bootstrap with -G:+SSA_LIR.
Josef Eisl <josef.eisl@jku.at>
parents: 21281
diff changeset
211 with Task('BootstrapSSAWithRegisterPressure:product', tasks) as t:
f172a195a8a9 mx gate: bootstrap with -G:+SSA_LIR.
Josef Eisl <josef.eisl@jku.at>
parents: 21281
diff changeset
212 if t:
f172a195a8a9 mx gate: bootstrap with -G:+SSA_LIR.
Josef Eisl <josef.eisl@jku.at>
parents: 21281
diff changeset
213 registers = 'o0,o1,o2,o3,f8,f9,d32,d34' if platform.processor() == 'sparc' else 'rbx,r11,r10,r14,xmm3,xmm11,xmm14'
f172a195a8a9 mx gate: bootstrap with -G:+SSA_LIR.
Josef Eisl <josef.eisl@jku.at>
parents: 21281
diff changeset
214 vm(['-XX:-TieredCompilation', '-G:+SSA_LIR', '-G:RegisterPressure=' + registers, '-esa', '-version'])
f172a195a8a9 mx gate: bootstrap with -G:+SSA_LIR.
Josef Eisl <josef.eisl@jku.at>
parents: 21281
diff changeset
215
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
216 with VM('jvmci', 'product'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
217 with Task('BootstrapWithImmutableCode:product', tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
218 if t: vm(['-XX:-TieredCompilation', '-G:+ImmutableCode', '-G:+VerifyPhases', '-esa', '-version'])
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
219
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
220 for vmbuild in ['fastdebug', 'product']:
14877
fdb912b1eb7b gate: use no tiered to test bootstrap, add scaladacapo-kiama (fastdebug)
Bernhard Urban <bernhard.urban@jku.at>
parents: 14872
diff changeset
221 for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild) + sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild):
17438
b8d89559915d mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents: 17437
diff changeset
222 with Task(str(test) + ':' + vmbuild, tasks) as t:
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
223 if t and not test.test('jvmci'):
17438
b8d89559915d mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents: 17437
diff changeset
224 t.abort(test.name + ' Failed')
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
225
16381
d91fecb90fc0 Check -Xbatch still works in the gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16327
diff changeset
226 # ensure -Xbatch still works
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
227 with VM('jvmci', 'product'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
228 with Task('DaCapo_pmd:BatchMode:product', tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
229 if t: dacapo(['-Xbatch', 'pmd'])
16381
d91fecb90fc0 Check -Xbatch still works in the gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16327
diff changeset
230
16437
680f52926754 added test for -Xcomp to the gate
Doug Simon <doug.simon@oracle.com>
parents: 16419
diff changeset
231 # ensure -Xcomp still works
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
232 with VM('jvmci', 'product'):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
233 with Task('XCompMode:product', tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
234 if t: vm(['-Xcomp', '-version'])
16437
680f52926754 added test for -Xcomp to the gate
Doug Simon <doug.simon@oracle.com>
parents: 16419
diff changeset
235
21566
1de4d7e69f85 fixed missed renaming
Doug Simon <doug.simon@oracle.com>
parents: 21562
diff changeset
236 # Prevent JVMCI modifications from breaking the standard builds
1de4d7e69f85 fixed missed renaming
Doug Simon <doug.simon@oracle.com>
parents: 21562
diff changeset
237 if args.buildNonJVMCI:
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
238 for vmbuild in ['product', 'fastdebug']:
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
239 for theVm in ['client', 'server']:
14606
f50dece27798 fixed regression in gate command
Doug Simon <doug.simon@oracle.com>
parents: 14605
diff changeset
240 if not isVMSupported(theVm):
20922
10766b486cbb added missing space
Doug Simon <doug.simon@oracle.com>
parents: 20805
diff changeset
241 mx.log('The ' + theVm + ' VM is not supported on this platform')
14602
591f4a575ebf issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents: 14595
diff changeset
242 continue
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
243 with VM(theVm, vmbuild):
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
244 with Task('DaCapo_pmd:' + theVm + ':' + vmbuild, tasks) as t:
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
245 if t: dacapo(['pmd'])
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
246
20000
e8a0a61526b2 added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents: 19796
diff changeset
247 with Task('UnitTests:' + theVm + ':' + vmbuild, tasks) as t:
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21554
diff changeset
248 if t: unittest(['-XX:CompileCommand=exclude,*::run*', 'graal.api', 'java.test'])
11756
78e6109ee411 mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents: 11605
diff changeset
249
6340
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
250 def deoptalot(args):
22108
51ceda0cf404 mx: make deoptalot command more flexible in terms of VM management
Doug Simon <doug.simon@oracle.com>
parents: 22099
diff changeset
251 """bootstrap a VM with DeoptimizeALot and VerifyOops on
6340
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
252
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
253 If the first argument is a number, the process will be repeated
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
254 this number of times. All other arguments are passed to the VM."""
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
255 count = 1
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
256 if len(args) > 0 and args[0].isdigit():
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
257 count = int(args[0])
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
258 del args[0]
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
259
7509
442668d41bc2 fixed warnings
Doug Simon <doug.simon@oracle.com>
parents: 7345
diff changeset
260 for _ in range(count):
22108
51ceda0cf404 mx: make deoptalot command more flexible in terms of VM management
Doug Simon <doug.simon@oracle.com>
parents: 22099
diff changeset
261 if not vm(['-XX:-TieredCompilation', '-XX:+DeoptimizeALot', '-XX:+VerifyOops'] + args + ['-version']) == 0:
6340
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
262 mx.abort("Failed")
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
263
6340
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
264 def longtests(args):
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
265
6340
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
266 deoptalot(['15', '-Xmx48m'])
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
267
6340
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
268 dacapo(['100', 'eclipse', '-esa'])
4215
a2caa019ba3a Fix mx : commands' scripts mx_init hook should be called before parsing command line arguments.
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4187
diff changeset
269
a2caa019ba3a Fix mx : commands' scripts mx_init hook should be called before parsing command line arguments.
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4187
diff changeset
270 def bench(args):
4324
b0aa4a52b89c Added support for project specs in classpath.
Doug Simon <doug.simon@oracle.com>
parents: 4294
diff changeset
271 """run benchmarks and parse their output for results
4282
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
272
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
273 Results are JSON formated : {group : {benchmark : score}}."""
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
274 resultFile = None
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
275 if '-resultfile' in args:
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
276 index = args.index('-resultfile')
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
277 if index + 1 < len(args):
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
278 resultFile = args[index + 1]
4293
d4906ea4255b Handle SIGTERM : killing mx will properly kill subprocesses
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4288
diff changeset
279 del args[index]
d4906ea4255b Handle SIGTERM : killing mx will properly kill subprocesses
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4288
diff changeset
280 del args[index]
4282
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
281 else:
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
282 mx.abort('-resultfile must be followed by a file name')
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
283 vm = get_vm()
4282
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
284 if len(args) is 0:
7563
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
285 args = ['all']
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
286
8459
3393f870e6a4 Allow vm arguments in mx bench
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8440
diff changeset
287 vmArgs = [arg for arg in args if arg.startswith('-')]
7563
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
288
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
289 def benchmarks_in_group(group):
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
290 prefix = group + ':'
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
291 return [a[len(prefix):] for a in args if a.startswith(prefix)]
4282
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
292
4219
47f7d91d34cf Fix javac build issues with classpath
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4216
diff changeset
293 results = {}
4282
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
294 benchmarks = []
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
295 # DaCapo
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
296 if 'dacapo' in args or 'all' in args:
4282
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
297 benchmarks += sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Benchmark)
4335
0d661161fa24 Add possibility to run individual DaCapo & SPECjvm2008 benchmarks, small fix in success and score regular expressions for SPECjvm2008
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4330
diff changeset
298 else:
7563
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
299 dacapos = benchmarks_in_group('dacapo')
4335
0d661161fa24 Add possibility to run individual DaCapo & SPECjvm2008 benchmarks, small fix in success and score regular expressions for SPECjvm2008
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4330
diff changeset
300 for dacapo in dacapos:
0d661161fa24 Add possibility to run individual DaCapo & SPECjvm2008 benchmarks, small fix in success and score regular expressions for SPECjvm2008
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4330
diff changeset
301 if dacapo not in sanitycheck.dacapoSanityWarmup.keys():
7563
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
302 mx.abort('Unknown DaCapo : ' + dacapo)
8891
ca82d06ec93a mx: bench command should not run dacapos with -n 0 when using a specification such as scaladacapo:specs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8890
diff changeset
303 iterations = sanitycheck.dacapoSanityWarmup[dacapo][sanitycheck.SanityCheckLevel.Benchmark]
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
304 if iterations > 0:
8891
ca82d06ec93a mx: bench command should not run dacapos with -n 0 when using a specification such as scaladacapo:specs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8890
diff changeset
305 benchmarks += [sanitycheck.getDacapo(dacapo, iterations)]
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
306
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
307 if 'scaladacapo' in args or 'all' in args:
4480
7d6490436b57 Add Scala DaCapo benchs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4438
diff changeset
308 benchmarks += sanitycheck.getScalaDacapos(level=sanitycheck.SanityCheckLevel.Benchmark)
7d6490436b57 Add Scala DaCapo benchs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4438
diff changeset
309 else:
7563
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
310 scaladacapos = benchmarks_in_group('scaladacapo')
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
311 for scaladacapo in scaladacapos:
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
312 if scaladacapo not in sanitycheck.dacapoScalaSanityWarmup.keys():
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
313 mx.abort('Unknown Scala DaCapo : ' + scaladacapo)
8891
ca82d06ec93a mx: bench command should not run dacapos with -n 0 when using a specification such as scaladacapo:specs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8890
diff changeset
314 iterations = sanitycheck.dacapoScalaSanityWarmup[scaladacapo][sanitycheck.SanityCheckLevel.Benchmark]
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
315 if iterations > 0:
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
316 benchmarks += [sanitycheck.getScalaDacapo(scaladacapo, ['-n', str(iterations)])]
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
317
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
318 # Bootstrap
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
319 if 'bootstrap' in args or 'all' in args:
4282
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
320 benchmarks += sanitycheck.getBootstraps()
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
321 # SPECjvm2008
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
322 if 'specjvm2008' in args or 'all' in args:
11373
6675167d52b6 fixed specjvm2008 regression in bench command
Doug Simon <doug.simon@oracle.com>
parents: 11372
diff changeset
323 benchmarks += [sanitycheck.getSPECjvm2008(['-ikv', '-wt', '120', '-it', '120'])]
4335
0d661161fa24 Add possibility to run individual DaCapo & SPECjvm2008 benchmarks, small fix in success and score regular expressions for SPECjvm2008
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4330
diff changeset
324 else:
7563
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
325 specjvms = benchmarks_in_group('specjvm2008')
4335
0d661161fa24 Add possibility to run individual DaCapo & SPECjvm2008 benchmarks, small fix in success and score regular expressions for SPECjvm2008
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4330
diff changeset
326 for specjvm in specjvms:
11373
6675167d52b6 fixed specjvm2008 regression in bench command
Doug Simon <doug.simon@oracle.com>
parents: 11372
diff changeset
327 benchmarks += [sanitycheck.getSPECjvm2008(['-ikv', '-wt', '120', '-it', '120', specjvm])]
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
328
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
329 if 'specjbb2005' in args or 'all' in args:
5877
0e54d9bb922d Add SPECjbb2005 to the benchmarks
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5875
diff changeset
330 benchmarks += [sanitycheck.getSPECjbb2005()]
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
331
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
332 if 'specjbb2013' in args: # or 'all' in args //currently not in default set
7565
9a521597686b Add SPECjbb2013
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7563
diff changeset
333 benchmarks += [sanitycheck.getSPECjbb2013()]
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
334
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
335 if 'ctw-full' in args:
9157
a38d748d4130 Add support for the 'optimized' build in mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 9130
diff changeset
336 benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.Full))
13967
4cd7c6629841 mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents: 13952
diff changeset
337 if 'ctw-noinline' in args:
9157
a38d748d4130 Add support for the 'optimized' build in mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 9130
diff changeset
338 benchmarks.append(sanitycheck.getCTW(vm, sanitycheck.CTWMode.NoInline))
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
339
4219
47f7d91d34cf Fix javac build issues with classpath
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4216
diff changeset
340 for test in benchmarks:
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
341 for (groupName, res) in test.bench(vm, extraVmOpts=vmArgs).items():
7563
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
342 group = results.setdefault(groupName, {})
3aab15f42934 moved execution of a benchmark out of OutputParser
Doug Simon <doug.simon@oracle.com>
parents: 7552
diff changeset
343 group.update(res)
4282
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
344 mx.log(json.dumps(results))
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
345 if resultFile:
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
346 with open(resultFile, 'w') as f:
063ea022532c mx commands : improve bench command, fix in the outparser so that no empty 'line' is retruned if there was no match, fix bootstrap's regex
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4276
diff changeset
347 f.write(json.dumps(results))
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
348
4228
e872562f95f8 add a simple specjvm2008 command, fail a benchmark if one of the failureRE matches
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents: 4227
diff changeset
349 def specjvm2008(args):
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
350 """run one or more SPECjvm2008 benchmarks"""
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
351
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
352 def launcher(bm, harnessArgs, extraVmOpts):
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
353 return sanitycheck.getSPECjvm2008(harnessArgs + [bm]).bench(get_vm(), extraVmOpts=extraVmOpts)
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
354
11372
76c45fb64191 added support to the specjvm2008 command for specifying a benchmark group
Doug Simon <doug.simon@oracle.com>
parents: 11371
diff changeset
355 availableBenchmarks = set(sanitycheck.specjvm2008Names)
76c45fb64191 added support to the specjvm2008 command for specifying a benchmark group
Doug Simon <doug.simon@oracle.com>
parents: 11371
diff changeset
356 for name in sanitycheck.specjvm2008Names:
76c45fb64191 added support to the specjvm2008 command for specifying a benchmark group
Doug Simon <doug.simon@oracle.com>
parents: 11371
diff changeset
357 parts = name.rsplit('.', 1)
76c45fb64191 added support to the specjvm2008 command for specifying a benchmark group
Doug Simon <doug.simon@oracle.com>
parents: 11371
diff changeset
358 if len(parts) > 1:
76c45fb64191 added support to the specjvm2008 command for specifying a benchmark group
Doug Simon <doug.simon@oracle.com>
parents: 11371
diff changeset
359 assert len(parts) == 2
76c45fb64191 added support to the specjvm2008 command for specifying a benchmark group
Doug Simon <doug.simon@oracle.com>
parents: 11371
diff changeset
360 group = parts[0]
76c45fb64191 added support to the specjvm2008 command for specifying a benchmark group
Doug Simon <doug.simon@oracle.com>
parents: 11371
diff changeset
361 availableBenchmarks.add(group)
76c45fb64191 added support to the specjvm2008 command for specifying a benchmark group
Doug Simon <doug.simon@oracle.com>
parents: 11371
diff changeset
362
76c45fb64191 added support to the specjvm2008 command for specifying a benchmark group
Doug Simon <doug.simon@oracle.com>
parents: 11371
diff changeset
363 _run_benchmark(args, sorted(availableBenchmarks), launcher)
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
364
8147
9786ac8fff61 Use different vm args for SPECjbb2013
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8135
diff changeset
365 def specjbb2013(args):
16782
9f5e33cf8d52 Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents: 16729
diff changeset
366 """run the composite SPECjbb2013 benchmark"""
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
367
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
368 def launcher(bm, harnessArgs, extraVmOpts):
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
369 assert bm is None
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
370 return sanitycheck.getSPECjbb2013(harnessArgs).bench(get_vm(), extraVmOpts=extraVmOpts)
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
371
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
372 _run_benchmark(args, None, launcher)
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
373
8506
c3657d00e343 -Merge with tip
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8406
diff changeset
374 def specjbb2005(args):
16782
9f5e33cf8d52 Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents: 16729
diff changeset
375 """run the composite SPECjbb2005 benchmark"""
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
376
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
377 def launcher(bm, harnessArgs, extraVmOpts):
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
378 assert bm is None
22139
258eaaa98484 Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents: 22108
diff changeset
379 return sanitycheck.getSPECjbb2005(harnessArgs).bench(get_vm(), extraVmOpts=extraVmOpts)
11514
dc3c8df55905 added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents: 11512
diff changeset
380
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
381 _run_benchmark(args, None, launcher)
8506
c3657d00e343 -Merge with tip
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8406
diff changeset
382
11605
3676540f71cf Allow mxtool suites to be in separate repositories (CR-1367)
Mick Jordan <mick.jordan@oracle.com>
parents: 11534
diff changeset
383 def mx_init(suite):
3718
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
384 commands = {
11367
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
385 'dacapo': [dacapo, '[VM options] benchmarks...|"all" [DaCapo options]'],
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
386 'scaladacapo': [scaladacapo, '[VM options] benchmarks...|"all" [Scala DaCapo options]'],
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
387 'specjvm2008': [specjvm2008, '[VM options] benchmarks...|"all" [SPECjvm2008 options]'],
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
388 'specjbb2013': [specjbb2013, '[VM options] [-- [SPECjbb2013 options]]'],
39b86b83ddeb normalized the command line interface for the dacapo, scaladacapo, specjvm2008, specjbb2005 and specjbb2013 commands
Doug Simon <doug.simon@oracle.com>
parents: 11359
diff changeset
389 'specjbb2005': [specjbb2005, '[VM options] [-- [SPECjbb2005 options]]'],
4559
723df37192d6 Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4540
diff changeset
390 'bench' : [bench, '[-resultfile file] [all(default)|dacapo|specjvm2008|bootstrap]'],
18897
9afee75cee46 mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents: 18894
diff changeset
391 'microbench' : [microbench, '[VM options] [-- [JMH options]]'],
6340
74560fdffd51 Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6319
diff changeset
392 'deoptalot' : [deoptalot, '[n]'],
11867
952ecf32788a mx sl command.
Chris Seaton <chris.seaton@oracle.com>
parents: 11797
diff changeset
393 'longtests' : [longtests, ''],
3718
42e655a6a6f3 Added mx configuration.
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
394 }
5729
dab877fe7c31 prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents: 5708
diff changeset
395
11605
3676540f71cf Allow mxtool suites to be in separate repositories (CR-1367)
Mick Jordan <mick.jordan@oracle.com>
parents: 11534
diff changeset
396 mx.update_commands(suite, commands)