12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #!/usr/bin/env bash
- common_abspath() (
- echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
- )
- common_bench_cmd() (
- # Benchmark a command.
- #
- # $1: command to benchmark
- # $2: where to write results to
- #
- # Result format:
- #
- # cmd <command run>
- # time <time in seconds to finish>
- # status <exit status>
- cmd="$1"
- results_file="$2"
- printf 'cmd ' >> "$results_file"
- env time --append -f 'time %e' --output="$results_file" ./eeval -a "$cmd" "$results_file"
- printf "status $?\n" >> "$results_file"
- )
- set_common_vars() {
- arch="$1"
- gem5="${2:-false}"
- buildroot_dir="${root_dir}/buildroot"
- arch_dir="$arch"
- if "$gem5" && [ ! "$arch" = aarch64 ]; then
- arch_dir="${arch}-gem5"
- fi
- out_arch_dir="${out_dir}/${arch_dir}"
- buildroot_out_dir="${out_arch_dir}/buildroot"
- build_dir="${buildroot_out_dir}/build"
- images_dir="${buildroot_out_dir}/images"
- host_dir="${buildroot_out_dir}/host"
- gem5_out_dir="${out_arch_dir}/gem5"
- m5out_dir="${gem5_out_dir}/m5out"
- qemu_out_dir="${out_arch_dir}/qemu"
- qemu_trace_txt_file="${qemu_out_dir}/trace.txt"
- }
- root_dir="$(pwd)"
- out_dir="${root_dir}/out"
- data_dir="${root_dir}/data"
- p9_dir="${data_dir}/9p"
- readfile_file="${data_dir}/readfile"
- common_dir="${out_dir}/common"
- f="${data_dir}/cli"
- if [ -f "$f" ]; then
- . "$f"
- fi
- # Default arch.
- arch=x86_64
|