diff options
| author | 2017-03-29 00:48:35 +0000 | |
|---|---|---|
| committer | 2017-03-29 00:48:36 +0000 | |
| commit | 09004f020aa7831e5e667aa7857d6fedf4ecf0d0 (patch) | |
| tree | f89c8d6742a56d65abad07b657697afd97e9e618 | |
| parent | 4ba18fdfc2581a2328ab745c2707e3ed375d9e64 (diff) | |
| parent | 002b9314d0e432ecc85e43d8fe800e375a33cebb (diff) | |
Merge "Incorporate random profile tests into run-test."
| -rw-r--r-- | build/Android.common_test.mk | 3 | ||||
| -rw-r--r-- | test/Android.run-test.mk | 2 | ||||
| -rwxr-xr-x | test/etc/run-test-jar | 24 | ||||
| -rw-r--r-- | test/knownfailures.json | 8 | ||||
| -rwxr-xr-x | test/run-all-tests | 3 | ||||
| -rwxr-xr-x | test/run-test | 3 | ||||
| -rw-r--r-- | test/testrunner/env.py | 3 | ||||
| -rwxr-xr-x | test/testrunner/testrunner.py | 9 |
8 files changed, 45 insertions, 10 deletions
diff --git a/build/Android.common_test.mk b/build/Android.common_test.mk index 1876efcd58..1ae79ac8cd 100644 --- a/build/Android.common_test.mk +++ b/build/Android.common_test.mk @@ -66,6 +66,9 @@ ART_TEST_OPTIMIZING ?= true # Do you want to test the optimizing compiler with graph coloring register allocation? ART_TEST_OPTIMIZING_GRAPH_COLOR ?= $(ART_TEST_FULL) +# Do you want to do run-tests with profiles? +ART_TEST_SPEED_PROFILE ?= $(ART_TEST_FULL) + # Do we want to test PIC-compiled tests ("apps")? ART_TEST_PIC_TEST ?= $(ART_TEST_FULL) diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk index cc015b031d..187b383b14 100644 --- a/test/Android.run-test.mk +++ b/test/Android.run-test.mk @@ -208,7 +208,7 @@ define core-image-dependencies endef TARGET_TYPES := host target -COMPILER_TYPES := jit interpreter optimizing regalloc_gc jit interp-ac +COMPILER_TYPES := jit interpreter optimizing regalloc_gc jit interp-ac speed-profile IMAGE_TYPES := picimage no-image multipicimage ALL_ADDRESS_SIZES := 64 32 diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index 808e58a7bd..f1b6132e94 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -64,6 +64,7 @@ TEST_IS_NDEBUG="n" APP_IMAGE="y" VDEX_FILTER="" PROFILE="n" +RANDOM_PROFILE="n" # if "y", run 'sync' before dalvikvm to make sure all files from # build step (e.g. dex2oat) were finished writing. @@ -273,6 +274,9 @@ while true; do elif [ "x$1" = "x--profile" ]; then PROFILE="y" shift + elif [ "x$1" = "x--random-profile" ]; then + RANDOM_PROFILE="y" + shift elif expr "x$1" : "x--" >/dev/null 2>&1; then echo "unknown $0 option: $1" 1>&2 exit 1 @@ -506,17 +510,23 @@ mkdir_locations="${DEX_LOCATION}/dalvik-cache/$ISA" strip_cmdline="true" sync_cmdline="true" -if [ "$PROFILE" = "y" ]; then +# PROFILE takes precedence over RANDOM_PROFILE, since PROFILE tests require a +# specific profile to run properly. +if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then profman_cmdline="${ANDROID_ROOT}/bin/profman \ --apk=$DEX_LOCATION/$TEST_NAME.jar \ - --dex-location=$DEX_LOCATION/$TEST_NAME.jar \ - --create-profile-from=$DEX_LOCATION/profile \ - --reference-profile-file=$DEX_LOCATION/$TEST_NAME.prof" + --dex-location=$DEX_LOCATION/$TEST_NAME.jar" COMPILE_FLAGS="${COMPILE_FLAGS} --profile-file=$DEX_LOCATION/$TEST_NAME.prof" FLAGS="${FLAGS} -Xcompiler-option --profile-file=$DEX_LOCATION/$TEST_NAME.prof" + if [ "$PROFILE" = "y" ]; then + profman_cmdline="${profman_cmdline} --create-profile-from=$DEX_LOCATION/profile \ + --reference-profile-file=$DEX_LOCATION/$TEST_NAME.prof" + else + profman_cmdline="${profman_cmdline} --generate-test-profile=$DEX_LOCATION/$TEST_NAME.prof \ + --generate-test-profile-seed=0" + fi fi - if [ "$PREBUILD" = "y" ]; then mkdir_locations="${mkdir_locations} ${DEX_LOCATION}/oat/$ISA" if [ "$APP_IMAGE" = "y" ]; then @@ -603,7 +613,7 @@ if [ "$HOST" = "n" ]; then adb shell mkdir -p $DEX_LOCATION adb push $TEST_NAME.jar $DEX_LOCATION adb push $TEST_NAME-ex.jar $DEX_LOCATION - if [ "$PROFILE" = "y" ]; then + if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then adb push profile $DEX_LOCATION fi else @@ -611,7 +621,7 @@ if [ "$HOST" = "n" ]; then adb shell mkdir -p $DEX_LOCATION >/dev/null 2>&1 adb push $TEST_NAME.jar $DEX_LOCATION >/dev/null 2>&1 adb push $TEST_NAME-ex.jar $DEX_LOCATION >/dev/null 2>&1 - if [ "$PROFILE" = "y" ]; then + if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then adb push profile $DEX_LOCATION >/dev/null 2>&1 fi diff --git a/test/knownfailures.json b/test/knownfailures.json index 8aa0c55839..8c7eb111c8 100644 --- a/test/knownfailures.json +++ b/test/knownfailures.json @@ -259,7 +259,7 @@ "602-deoptimizeable"], "description": ["Tests that should fail when the optimizing compiler ", "compiles them non-debuggable."], - "variant": "optimizing & ndebuggable | regalloc_gc & ndebuggable" + "variant": "optimizing & ndebuggable | regalloc_gc & ndebuggable | speed-profile & ndebuggable" }, { "tests": "596-app-images", @@ -366,5 +366,11 @@ "644-checker-deopt"], "description": ["Disabled temporarily until a fix arrives."], "bug": "http://b/36371709" + }, + { + "tests": ["629-vdex-speed", + "634-vdex-duplicate"], + "description": ["Profile driven dexlayout does not work with vdex."], + "variant": "speed-profile" } ] diff --git a/test/run-all-tests b/test/run-all-tests index 402c299b55..a0d2f23aa4 100755 --- a/test/run-all-tests +++ b/test/run-all-tests @@ -155,6 +155,9 @@ while true; do elif [ "x$1" = "x--strace" ]; then run_args="${run_args} --strace" shift + elif [ "x$1" = "x--random-profile" ]; then + run_args="${run_args} --random-profile" + shift elif expr "x$1" : "x--" >/dev/null 2>&1; then echo "unknown $0 option: $1" 1>&2 usage="yes" diff --git a/test/run-test b/test/run-test index a6903ff0d4..91ffdfa2cc 100755 --- a/test/run-test +++ b/test/run-test @@ -382,6 +382,9 @@ while true; do filter=$1 run_args="${run_args} --vdex-filter $filter" shift + elif [ "x$1" = "x--random-profile" ]; then + run_args="${run_args} --random-profile" + shift elif expr "x$1" : "x--" >/dev/null 2>&1; then echo "unknown $0 option: $1" 1>&2 usage="yes" diff --git a/test/testrunner/env.py b/test/testrunner/env.py index e93fb3afa8..46244a4766 100644 --- a/test/testrunner/env.py +++ b/test/testrunner/env.py @@ -105,6 +105,9 @@ ART_TEST_OPTIMIZING = getEnvBoolean('ART_TEST_OPTIMIZING', ART_TEST_FULL) # Do you want to test the optimizing compiler with graph coloring register allocation? ART_TEST_OPTIMIZING_GRAPH_COLOR = getEnvBoolean('ART_TEST_OPTIMIZING_GRAPH_COLOR', ART_TEST_FULL) +# Do you want to do run-tests with profiles? +ART_TEST_SPEED_PROFILE = getEnvBoolean('ART_TEST_SPEED_PROFILE', ART_TEST_FULL) + # Do we want to test PIC-compiled tests ("apps")? ART_TEST_PIC_TEST = getEnvBoolean('ART_TEST_PIC_TEST', ART_TEST_FULL) # Do you want tracing tests run? diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py index 149578d9ed..49dc657020 100755 --- a/test/testrunner/testrunner.py +++ b/test/testrunner/testrunner.py @@ -147,7 +147,7 @@ def gather_test_info(): VARIANT_TYPE_DICT['jni'] = {'jni', 'forcecopy', 'checkjni'} VARIANT_TYPE_DICT['address_sizes'] = {'64', '32'} VARIANT_TYPE_DICT['compiler'] = {'interp-ac', 'interpreter', 'jit', 'optimizing', - 'regalloc_gc'} + 'regalloc_gc', 'speed-profile'} for v_type in VARIANT_TYPE_DICT: TOTAL_VARIANTS_SET = TOTAL_VARIANTS_SET.union(VARIANT_TYPE_DICT.get(v_type)) @@ -192,6 +192,8 @@ def setup_test_env(): if env.ART_TEST_OPTIMIZING: COMPILER_TYPES.add('optimizing') OPTIMIZING_COMPILER_TYPES.add('optimizing') + if env.ART_TEST_SPEED_PROFILE: + COMPILER_TYPES.add('speed-profile') # By default we run all 'compiler' variants. if not COMPILER_TYPES: @@ -199,6 +201,7 @@ def setup_test_env(): COMPILER_TYPES.add('jit') COMPILER_TYPES.add('interpreter') COMPILER_TYPES.add('interp-ac') + COMPILER_TYPES.add('speed-profile') OPTIMIZING_COMPILER_TYPES.add('optimizing') if env.ART_TEST_RUN_TEST_RELOCATE: @@ -389,6 +392,8 @@ def run_tests(tests): options_test += ' --interpreter --verify-soft-fail' elif compiler == 'jit': options_test += ' --jit' + elif compiler == 'speed-profile': + options_test += ' --random-profile' if relocate == 'relocate': options_test += ' --relocate' @@ -881,6 +886,8 @@ def parse_option(): IMAGE_TYPES.add('no-image') if options['optimizing']: COMPILER_TYPES.add('optimizing') + if options['speed_profile']: + COMPILER_TYPES.add('speed-profile') if options['trace']: TRACE_TYPES.add('trace') if options['gcstress']: |