Loading core/jni/runtime_native_boot-flags-test.sh +24 −23 Original line number Diff line number Diff line Loading @@ -139,33 +139,31 @@ function find_zygote_runtime_option { adb logcat -d -s "$zygote" | grep -q -e "option\[[0-9]\+\]=$runtime_option" } # check_zygote_gc_runtime_option CONTEXT VALUE # -------------------------------------------- # Check that all zygote processes are passed device configuration flag VALUE as # GC runtime option. Use CONTEXT in logging. function check_zygote_gc_runtime_option { # check_zygote_runtime_option CONTEXT RUNTIME_OPTION # -------------------------------------------------- # Check that all zygote processes are passed RUNTIME_OPTION as runtime option. Use # CONTEXT in logging. function check_zygote_runtime_option { local context=$1 local value=$2 local runtime_option=$2 say \ "[$context] Check that all zygote processes are passed the flag value as a GC runtime option..." local runtime_option="-Xgc:$value" "[$context] Check that all zygote processes are passed \`$runtime_option\` as runtime option..." for zygote in $zygotes; do find_zygote_runtime_option "$zygote" "$runtime_option" \ || fail "Found no \`$runtime_option\` among runtime options passed to \`$zygote\`" done } # check_no_zygote_gc_runtime_option CONTEXT VALUE # ----------------------------------------------- # Check that no zygote process is passed device configuration flag VALUE as GC # runtime option. Use CONTEXT in logging. function check_no_zygote_gc_runtime_option { # check_no_zygote_runtime_option CONTEXT RUNTIME_OPTION # ----------------------------------------------------- # Check that no zygote process is passed RUNTIME_OPTION as runtime option. Use # CONTEXT in logging. function check_no_zygote_runtime_option { local context=$1 local value=$2 local runtime_option=$2 say "[$context] Check no zygote process is passed the flag value as a GC runtime option..." local runtime_option="-Xgc:$value" say "[$context] Check that no zygote process is passed \`$runtime_option\` as runtime option..." for zygote in $zygotes; do find_zygote_runtime_option "$zygote" "$runtime_option" \ && fail "Found \`$runtime_option\` among runtime options passed to \`$zygote\`" Loading Loading @@ -270,17 +268,17 @@ esac # ========================================== function check_nogenerational_cc { check_zygote_gc_runtime_option "$1" nogenerational_cc check_zygote_runtime_option "$1" "-Xgc:nogenerational_cc" } function check_no_nogenerational_cc { check_no_zygote_gc_runtime_option "$1" nogenerational_cc check_no_zygote_runtime_option "$1" "-Xgc:nogenerational_cc" } function check_generational_cc { check_zygote_gc_runtime_option "$1" generational_cc check_zygote_runtime_option "$1" "-Xgc:generational_cc" } function check_no_generational_cc { check_no_zygote_gc_runtime_option "$1" generational_cc check_no_zygote_runtime_option "$1" "-Xgc:generational_cc" } test_android_runtime_flag \ Loading @@ -299,11 +297,14 @@ function check_no_default_boot_image { check_no_android_runtime_message "$1" "$default_boot_image_message" } apex_boot_image_message="Using Apex boot image: '-Ximage:/system/framework/apex.art'" apex_boot_image_option="-Ximage:/system/framework/apex.art" apex_boot_image_message="Using Apex boot image: '$apex_boot_image_option'" function check_apex_boot_image { check_zygote_runtime_option "$1" "$apex_boot_image_option" check_android_runtime_message "$1" "$apex_boot_image_message" } function check_no_apex_boot_image { check_no_zygote_runtime_option "$1" "$apex_boot_image_option" check_no_android_runtime_message "$1" "$apex_boot_image_message" } Loading Loading
core/jni/runtime_native_boot-flags-test.sh +24 −23 Original line number Diff line number Diff line Loading @@ -139,33 +139,31 @@ function find_zygote_runtime_option { adb logcat -d -s "$zygote" | grep -q -e "option\[[0-9]\+\]=$runtime_option" } # check_zygote_gc_runtime_option CONTEXT VALUE # -------------------------------------------- # Check that all zygote processes are passed device configuration flag VALUE as # GC runtime option. Use CONTEXT in logging. function check_zygote_gc_runtime_option { # check_zygote_runtime_option CONTEXT RUNTIME_OPTION # -------------------------------------------------- # Check that all zygote processes are passed RUNTIME_OPTION as runtime option. Use # CONTEXT in logging. function check_zygote_runtime_option { local context=$1 local value=$2 local runtime_option=$2 say \ "[$context] Check that all zygote processes are passed the flag value as a GC runtime option..." local runtime_option="-Xgc:$value" "[$context] Check that all zygote processes are passed \`$runtime_option\` as runtime option..." for zygote in $zygotes; do find_zygote_runtime_option "$zygote" "$runtime_option" \ || fail "Found no \`$runtime_option\` among runtime options passed to \`$zygote\`" done } # check_no_zygote_gc_runtime_option CONTEXT VALUE # ----------------------------------------------- # Check that no zygote process is passed device configuration flag VALUE as GC # runtime option. Use CONTEXT in logging. function check_no_zygote_gc_runtime_option { # check_no_zygote_runtime_option CONTEXT RUNTIME_OPTION # ----------------------------------------------------- # Check that no zygote process is passed RUNTIME_OPTION as runtime option. Use # CONTEXT in logging. function check_no_zygote_runtime_option { local context=$1 local value=$2 local runtime_option=$2 say "[$context] Check no zygote process is passed the flag value as a GC runtime option..." local runtime_option="-Xgc:$value" say "[$context] Check that no zygote process is passed \`$runtime_option\` as runtime option..." for zygote in $zygotes; do find_zygote_runtime_option "$zygote" "$runtime_option" \ && fail "Found \`$runtime_option\` among runtime options passed to \`$zygote\`" Loading Loading @@ -270,17 +268,17 @@ esac # ========================================== function check_nogenerational_cc { check_zygote_gc_runtime_option "$1" nogenerational_cc check_zygote_runtime_option "$1" "-Xgc:nogenerational_cc" } function check_no_nogenerational_cc { check_no_zygote_gc_runtime_option "$1" nogenerational_cc check_no_zygote_runtime_option "$1" "-Xgc:nogenerational_cc" } function check_generational_cc { check_zygote_gc_runtime_option "$1" generational_cc check_zygote_runtime_option "$1" "-Xgc:generational_cc" } function check_no_generational_cc { check_no_zygote_gc_runtime_option "$1" generational_cc check_no_zygote_runtime_option "$1" "-Xgc:generational_cc" } test_android_runtime_flag \ Loading @@ -299,11 +297,14 @@ function check_no_default_boot_image { check_no_android_runtime_message "$1" "$default_boot_image_message" } apex_boot_image_message="Using Apex boot image: '-Ximage:/system/framework/apex.art'" apex_boot_image_option="-Ximage:/system/framework/apex.art" apex_boot_image_message="Using Apex boot image: '$apex_boot_image_option'" function check_apex_boot_image { check_zygote_runtime_option "$1" "$apex_boot_image_option" check_android_runtime_message "$1" "$apex_boot_image_message" } function check_no_apex_boot_image { check_no_zygote_runtime_option "$1" "$apex_boot_image_option" check_no_android_runtime_message "$1" "$apex_boot_image_message" } Loading