diff options
author | Artem Serov <artem.serov@linaro.org> | 2022-01-26 16:21:58 +0000 |
---|---|---|
committer | Artem Serov <artem.serov@linaro.org> | 2022-01-28 18:24:46 +0000 |
commit | 1594f04747bb81f5425530b0eb0ba4363bcc5fbc (patch) | |
tree | 3feec41300b1e5495fc8f0be8287b349b8d4a7ee | |
parent | 46cd1666075c7e1d304eb1301a17773b83e55ccf (diff) | |
download | art-build-scripts-1594f04747bb81f5425530b0eb0ba4363bcc5fbc.tar.gz |
Adjust the ART bootclasspath handling.
Recently javac-helper.sh and bootjars.sh helpers have been
removed from ./art; so we have to adjust our scripts.
There are two bootclasspath entities around compiling and running
benchmarks. First one relates to javac compilation, the path is a
host path to the core jar archives with .class bytecode. The second
one - to the ART run time on a target device; core jar files in /apex
that contain .dex bytecode.
- 1st: constructs this manually.
- 2nd: uses get_apex_bootclasspath() from ./art.
This change addresses both uses by reusing some art utils and
manually specifying some of the modules for the path.
Test: compilation_stats_target.sh --cpu default \
./external-benchmarks/apks/DuckDuckGo/duckduckgo.apk \
boot.oat --iterations 2
Test: benchmarks_run_target.sh --cpu default \
--iterations 2 algorithm/DeltaBlue
Test: test-art-host, test-art-target.
Test: ./presubmit.sh
Change-Id: I3edfcc273c60d6fb0cb1ebbbdfde4be54644004a
-rwxr-xr-x | benchmarks/benchmarks_run_target.sh | 2 | ||||
-rw-r--r-- | utils/utils_benchmarks.sh | 54 |
2 files changed, 30 insertions, 26 deletions
diff --git a/benchmarks/benchmarks_run_target.sh b/benchmarks/benchmarks_run_target.sh index b5eb24d3..bc3a621a 100755 --- a/benchmarks/benchmarks_run_target.sh +++ b/benchmarks/benchmarks_run_target.sh @@ -320,6 +320,8 @@ main() { continue fi + export_javac_bootclasspath + buildbot_device_prepare "${bits}" run_all_benchmarks "${bits}" if ${options["dump-cfg"]}; then diff --git a/utils/utils_benchmarks.sh b/utils/utils_benchmarks.sh index bd76032c..89592400 100644 --- a/utils/utils_benchmarks.sh +++ b/utils/utils_benchmarks.sh @@ -15,6 +15,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# This assumes that source utils.sh has been called by the parent script. +source "$(get_art_dir)/test/etc/apex-bootclasspath-utils.sh" + if [[ ! -v JCPU_COUNT ]]; then log E "utils_android.sh must be sourced before utils_benchmarks.sh" abort @@ -47,35 +50,34 @@ build_benchmarks() { # Get the core bootclasspath which can be used to build and to run Java apps on a target. get_target_core_bootclasspath() { - # Get a list of bootjars names. They are space separated. - local -r core_bootjars_names=$("$(get_art_tools_dir)"/bootjars.sh --core --target) - - # Get a space separated list of all bootjars names with names of apex modules they belong to. - # They have the format: <apex module name>:<bootjar name> - local boot_jars_names_with_apex_module=$("$(get_art_tools_dir)"/bootjars.sh --target) - - # Add '.jar' to core bootjars. - # 'boot_jars_names_with_apex_module' will become like - # 'com.android.art:apache-xml.jar platform:framework-minus-apex'. - local name - for name in ${core_bootjars_names}; do - boot_jars_names_with_apex_module="${boot_jars_names_with_apex_module//${name}/${name}.jar}" - done + # Using ART util; HOST="n". + get_apex_bootclasspath "n" +} - local bootclasspath="" - for name in ${boot_jars_names_with_apex_module}; do - if [[ "${name}" == *jar ]]; then - # Convert the name into a file path: /apex/<module>/javalib/<jar>. - name="/apex/${name//://javalib/}" - bootclasspath="${bootclasspath}${name}:" - fi +# Constructs and exports a -bootclasspath argument line for javac invocation; is used +# for building benchmarks in art-testing. +export_javac_bootclasspath() { + # Note: the list of module jar files should be kept up-to-date with ./art setup. + local -r jar_list="core-oj.com.android.art.testing \ + core-libart.com.android.art.testing \ + okhttp.com.android.art.testing \ + bouncycastle.com.android.art.testing \ + apache-xml.com.android.art.testing \ + core-icu4j \ + conscrypt" + local -r jar_prefix="${ANDROID_BUILD_TOP}/out/target/common/obj/JAVA_LIBRARIES/" + local -r jar_suffix="_intermediates/classes.jar" + local bpath="" + local bpath_separator="" + + # Fully qualify module names from jar_list and add separators between them. + for jar_name in ${jar_list}; do + bpath+="${bpath_separator}${jar_prefix}${jar_name}${jar_suffix}" + bpath_separator=":" done - # SPECjvm2008 crypto workloads depend on conscrypt.jar. - # 'conscrypt.jar' is separated from the core boot jars into a separate module. - local -r conscrypt_jar="/apex/com.android.conscrypt/javalib/conscrypt.jar" - - echo "${bootclasspath}${conscrypt_jar}" + log I "Bootclasspath for compiling benchmarks: ${bpath}" + export JAVAC_BOOTCLASSPATH="${bpath}" } # Get target bootclasspath options for dex2oat which are used in ART testing. |