Skip to content

Commit

Permalink
FileSizeBenchmarkSuite: add fatal_is_missing flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cosminbasca committed Sep 16, 2021
1 parent a20a5fc commit 8536c08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sdk/mx.sdk/mx_sdk_vm_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2678,15 +2678,16 @@ def has_svm_launchers(components, fatalIfMissing=False):
return all((has_svm_launcher(component, fatalIfMissing=fatalIfMissing) for component in components))


def get_native_image_locations(name, image_name):
def get_native_image_locations(name, image_name, fatal_if_missing=True):
c = name if isinstance(name, mx_sdk.GraalVmComponent) else get_component(name)
configs = _get_library_configs(c) + _get_launcher_configs(c)
libgraal_libs = [l for l in configs if image_name in basename(l.destination)]
if libgraal_libs:
library_config = libgraal_libs[0]
dist = get_final_graalvm_distribution()
source_type = 'skip' if _skip_libraries(library_config) else 'dependency'
return join(graalvm_output_root(), dist.find_single_source_location(source_type + ':' + GraalVmLibrary.project_name(library_config)))
return join(graalvm_output_root(), dist.find_single_source_location(
source_type + ':' + GraalVmLibrary.project_name(library_config), fatal_if_missing=fatal_if_missing))
return None


Expand Down
4 changes: 2 additions & 2 deletions vm/mx.vm/mx_vm_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,13 +1087,13 @@ def runAndReturnStdOut(self, benchmarks, bmSuiteArgs):
for cfg in gcomponent.launcher_configs:
binary_dst = cfg.destination
binary_name = os.path.split(binary_dst)[-1]
pth = get_native_image_locations(gcomponent, binary_name)
pth = get_native_image_locations(gcomponent, binary_name, fatal_if_missing=False)
if pth and os.path.exists(pth):
sz_msg = FileSizeBenchmarkSuite.SZ_MSG_PATTERN.format(binary_name, os.path.getsize(pth), pth)
elif isinstance(gcomponent, GraalVmJreComponent):
mx.log("checking GraalVmJreComponent: {}".format(gcomponent))
if gcomponent.name == "LibGraal":
pth = get_native_image_locations(gcomponent, 'jvmcicompiler')
pth = get_native_image_locations(gcomponent, 'jvmcicompiler', fatal_if_missing=False)
if pth and os.path.exists(pth):
sz_msg = FileSizeBenchmarkSuite.SZ_MSG_PATTERN.format(gcomponent.name, os.path.getsize(pth), pth)

Expand Down

0 comments on commit 8536c08

Please sign in to comment.