Mercurial > hg > graal-compiler
comparison mx.graal/mx_graal.py @ 22667:500e3cecfbff
updated jdkartifactstats to show stripped jar sizes
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 21 Sep 2015 23:24:58 +0200 |
parents | f3fd15b9c703 |
children | f74225bf6671 |
comparison
equal
deleted
inserted
replaced
22666:dc332a2c41d0 | 22667:500e3cecfbff |
---|---|
468 | 468 |
469 def jdkartifactstats(args): | 469 def jdkartifactstats(args): |
470 """show stats about JDK deployed Graal artifacts""" | 470 """show stats about JDK deployed Graal artifacts""" |
471 jdkDir = mx_jvmci.get_jvmci_jdk_dir() | 471 jdkDir = mx_jvmci.get_jvmci_jdk_dir() |
472 artifacts = {} | 472 artifacts = {} |
473 for root, _, filenames in os.walk(mx_jvmci.vmLibDirInJdk(jdkDir)): | 473 for root, _, filenames in os.walk(join(jdkDir, 'jre', 'lib')): |
474 for f in filenames: | 474 for f in filenames: |
475 if f.endswith('.jar'): | 475 if f.endswith('.jar') and not f.endswith('.stripped.jar'): |
476 jar = join(root, f) | 476 jar = join(root, f) |
477 if 'truffle' in f: | 477 if 'truffle' in f: |
478 if 'enterprise' in f: | 478 if 'enterprise' in f: |
479 artifacts.setdefault('GraalEnterpriseTruffle', []).append(jar) | 479 artifacts.setdefault('GraalEnterpriseTruffle', []).append(jar) |
480 else: | 480 else: |
485 artifacts.setdefault('JVMCI', []).append(jar) | 485 artifacts.setdefault('JVMCI', []).append(jar) |
486 elif 'graal' in f: | 486 elif 'graal' in f: |
487 artifacts.setdefault('Graal', []).append(jar) | 487 artifacts.setdefault('Graal', []).append(jar) |
488 else: | 488 else: |
489 mx.logv('ignored: ' + jar) | 489 mx.logv('ignored: ' + jar) |
490 | |
491 print '{:>10} {:>10} {:>10} {}'.format('All', 'NoVars', 'None', 'Jar') | |
490 for category in sorted(artifacts.viewkeys()): | 492 for category in sorted(artifacts.viewkeys()): |
491 jars = artifacts[category] | 493 jars = artifacts[category] |
492 if jars: | 494 if jars: |
493 total = 0 | 495 totals = (0, 0, 0) |
494 print | 496 print |
495 for j in jars: | 497 for j in jars: |
496 size = os.path.getsize(j) | 498 gSize = os.path.getsize(j) |
497 print '{:10,}\t{}:{}'.format(size, category, basename(j)) | 499 stripped = j[:-len('.jar')] + '.stripped.jar' |
498 total += size | 500 mx.run([mx.get_jdk().pack200, '--repack', '--quiet', '-J-Djava.util.logging.config.file=', '-DLocalVariableTypeTable=strip', '-DLocalVariableTable=strip', stripped, j]) |
499 print '{:10,}\t{}:<total>'.format(total, category) | 501 gLinesSourceSize = os.path.getsize(stripped) |
502 mx.run([mx.get_jdk().pack200, '--repack', '--quiet', '-J-Djava.util.logging.config.file=', '-G', stripped, j]) | |
503 gNoneSize = os.path.getsize(stripped) | |
504 os.remove(stripped) | |
505 print '{:10,} {:10,} {:10,} {}:{}'.format(gSize, gLinesSourceSize, gNoneSize, category, basename(j)) | |
506 t1, t2, t3 = totals | |
507 totals = (t1 + gSize, t2 + gLinesSourceSize, t3 + gNoneSize) | |
508 t1, t2, t3 = totals | |
509 print '{:10,} {:10,} {:10,} {}'.format(t1, t2, t3, category) | |
500 | 510 |
501 jvmLib = join(jdkDir, mx_jvmci.relativeVmLibDirInJdk(), get_vm(), mx.add_lib_suffix(mx.add_lib_prefix('jvm'))) | 511 jvmLib = join(jdkDir, mx_jvmci.relativeVmLibDirInJdk(), get_vm(), mx.add_lib_suffix(mx.add_lib_prefix('jvm'))) |
502 print | 512 print |
503 if exists(jvmLib): | 513 if exists(jvmLib): |
504 print '{:10,}\t{}'.format(os.path.getsize(jvmLib), jvmLib) | 514 print '{:10,} {}'.format(os.path.getsize(jvmLib), jvmLib) |
505 else: | 515 else: |
506 print '{:>10}\t{}'.format('<missing>', jvmLib) | 516 print '{:>10} {}'.format('<missing>', jvmLib) |
507 | 517 |
508 mx.update_commands(_suite, { | 518 mx.update_commands(_suite, { |
509 'ctw': [ctw, '[-vmoptions|noinline|nocomplex|full]'], | 519 'ctw': [ctw, '[-vmoptions|noinline|nocomplex|full]'], |
510 'dacapo': [dacapo, '[VM options] benchmarks...|"all" [DaCapo options]'], | 520 'dacapo': [dacapo, '[VM options] benchmarks...|"all" [DaCapo options]'], |
511 'jdkartifactstats' : [jdkartifactstats, ''], | 521 'jdkartifactstats' : [jdkartifactstats, ''], |