mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 18:25:57 +01:00
gem5 requires armv7, and we learnt that the versatiledb we were using was pre-v7. We could have moved to -M vexpress-*, but in the end decided to go for -M virt due to its simpliciy, and uniformity with aarch64. platform_device: does not work anymore and was removed, since it was tied to versatilepb. We left a mention on the README and removed all in tree source. The QEMU patch is still left as it was. As a consequence, the linux tree had no other patches, and we now use vanilla linux by default, which is a great thing for reproducibility. Another consequence is the /poweroff.out works for arm -M virt, and we removed all mentions of the problem.
53 lines
1.3 KiB
Bash
53 lines
1.3 KiB
Bash
#!/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" = x86_64 ]; 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
|
|
gem5=false
|