Add support for dex2oat 8 and 9 and verbose options to tools/dex2oat.py
R=sgjesse
Change-Id: I6a679c1c8d430849fe8894fae1cba6fdd2e48b7a
diff --git a/tools/dex2oat.py b/tools/dex2oat.py
index 1e2cffd..e21dc7d 100755
--- a/tools/dex2oat.py
+++ b/tools/dex2oat.py
@@ -14,6 +14,8 @@
VERSIONS = [
'default',
+ '9.0.0',
+ '8.1.0',
'7.0.0',
'6.0.1',
'5.1.1',
@@ -21,6 +23,8 @@
DIRS = {
'default': 'art',
+ '9.0.0': 'art-9.0.0',
+ '8.1.0': 'art-8.1.0',
'7.0.0': 'art-7.0.0',
'6.0.1': 'art-6.0.1',
'5.1.1': 'art-5.1.1',
@@ -28,6 +32,8 @@
PRODUCTS = {
'default': 'angler',
+ '9.0.0': 'marlin',
+ '8.1.0': 'marlin',
'7.0.0': 'angler',
'6.0.1': 'angler',
'5.1.1': 'mako',
@@ -35,11 +41,23 @@
ARCHS = {
'default': 'arm64',
+ '9.0.0': 'arm64',
+ '8.1.0': 'arm64',
'7.0.0': 'arm64',
'6.0.1': 'arm64',
'5.1.1': 'arm',
}
+VERBOSE_OPTIONS = [
+ 'verifier',
+ 'compiler',
+ 'gc',
+ 'jit',
+ 'jni',
+ 'class',
+ 'all',
+]
+
def ParseOptions():
parser = optparse.OptionParser()
parser.add_option('--version',
@@ -53,6 +71,10 @@
parser.add_option('--output',
help='Where to place the output oat (defaults to no output / temp file).',
default=None)
+ parser.add_option('--verbose',
+ help='Enable verbose dex2oat logging.',
+ choices=VERBOSE_OPTIONS,
+ default=None)
return parser.parse_args()
def Main():
@@ -66,12 +88,15 @@
dexfile = args[0]
oatfile = options.output
versions = VERSIONS if options.all else [options.version]
+ verbose = [options.verbose] if options.verbose else []
+ if 'all' in verbose:
+ verbose = [x for x in VERBOSE_OPTIONS if x is not 'all']
for version in versions:
- run(dexfile, oatfile, version)
+ run(dexfile, oatfile, version, verbose)
print
return 0
-def run(dexfile, oatfile=None, version='default'):
+def run(dexfile, oatfile=None, version='default', verbose=[]):
# dex2oat accepts non-existent dex files, check here instead
if not os.path.exists(dexfile):
raise Exception('DEX file not found: "{}"'.format(dexfile))
@@ -90,6 +115,8 @@
'--oat-file=' + oatfile,
'--instruction-set=' + arch,
]
+ for flag in verbose:
+ cmd += ['--runtime-arg', '-verbose:' + flag]
env = {"LD_LIBRARY_PATH": os.path.join(base, 'lib')}
utils.PrintCmd(cmd)
subprocess.check_call(cmd, env = env)