diff options
Diffstat (limited to 'benchmarks/calibrate_benchmark_target.sh')
-rwxr-xr-x | benchmarks/calibrate_benchmark_target.sh | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/benchmarks/calibrate_benchmark_target.sh b/benchmarks/calibrate_benchmark_target.sh index 6c9bcc98..50f2c573 100755 --- a/benchmarks/calibrate_benchmark_target.sh +++ b/benchmarks/calibrate_benchmark_target.sh @@ -54,15 +54,7 @@ set_default_options() { } validate_options() { - if [[ -z "${options["cpu"]}" ]]; then - log E "CPU is not provided." - exit 1 - fi - if [[ "${options["cpu"]}" != @(big|little) ]]; then - log E "Invalid CPU option: ${cpu}" - exit 1 - fi - + validate_cluster "${options["cpu"]}" validate_benchmarks_names "${options["benchmark"]}" } @@ -74,10 +66,10 @@ usage() { log I "" log I "-------------------------------------------" log I " -h, --help - help" - log I " --cpu <big|little> - CPU mode." - log I " 'big': Run dalvikvm on big cores." - log I " 'little': Run dalvikvm on little cores." - log I " Note: The frequency of the specified cores will be pinned." + log I " --cpu <cluster_name> - Cluster name." + log I " Run dalvikvm on the cluster specified by" + log I " cluster_name." + log I " Note: The frequency of the specified cores will be pinned." log I " --classpath <classpath> - Classpath for dalvikvm on a target device." log I " --target_running_time <time in ms>" log I " - The target running time for benchmark methods." @@ -131,8 +123,9 @@ set_environment_for_run() { run_target_cmdline() { local -r sh="chroot ${ART_TEST_CHROOT} sh" + local -r cpu="${options["cpu"]}" - safe "${local_path}/../devices/set_cpu_freq.sh" --all --pin-freq + safe "${local_path}/../devices/set_cpu_freq.sh" --cpu "${cpu}" --pin-freq echo -n "CALIBRATION_RESULT:" adb_shell "${sh}" "${target_virtual_work_dir}/cmdline.sh" @@ -143,22 +136,17 @@ run_target_cmdline() { generate_target_cmdline() { local -r work_dir="${target_virtual_work_dir}" - local -r target_device=$(safe adb_shell getprop ro.product.device) - local -r cpu="${options["cpu"]}" + local -r target_device=$(retrieve_target_product_name) + local -r cluster_name="${options["cpu"]}" local -r classpath="${options["classpath"]}" local -r target_running_time="${options["target_running_time"]}" local -r benchmark="${options["benchmark"]}" exit_on_failure get_device_settings "${target_device}" "${local_path}/../devices/config" - require_big_little_device "${target_device}" - - local dalvikvm_cpus - if [[ "$cpu" == "big" ]]; then - dalvikvm_cpus="$(get_cpu_affinity_mask "${BIG_CPUS[@]}")" - else - dalvikvm_cpus="$(get_cpu_affinity_mask "${LITTLE_CPUS[@]}")" - fi + local -r -a cluster=(${!CPUS[${cluster_name}]}) + local -r -a cpu_ids=($(get_ids_from_cluster "${cluster[*]}")) + local -r dalvikvm_cpus="$(get_cpu_affinity_mask "${cpu_ids[@]}")" local target_script read -r -d '' target_script << EOM |