mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 18:25:57 +01:00
Don't pass all arguments explicitly, just use existing vars. Prefix all common_setup inputs and outputs with common_ to avoid name conflicts.
46 lines
1.3 KiB
Bash
Executable File
46 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eu
|
|
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
|
caches='--caches --l2cache --l1d_size=1024kB --l1i_size=1024kB --l2_size=1024kB --l3_size=1024kB'
|
|
bench() (
|
|
common_bench_cmd "./run -a ${1}" "$common_bench_boot"
|
|
)
|
|
gem5_insts() (
|
|
printf "instructions $(./gem5-stat -a "$1" sim_insts)\n" >> "$common_bench_boot"
|
|
)
|
|
qemu_insts() (
|
|
common_arch="$1"
|
|
./qemu-trace2txt -a "$common_arch"
|
|
common_setup
|
|
printf "instructions $(wc -l "${common_trace_txt_file}" | cut -d' ' -f1)\n" >> "$common_bench_boot"
|
|
)
|
|
rm -f "${common_bench_boot}"
|
|
|
|
arch=x86_64
|
|
bench "$arch -E '/poweroff.out'"
|
|
bench "$arch -E '/poweroff.out' -K"
|
|
bench "$arch -E '/poweroff.out' -T exec_tb"
|
|
qemu_insts "$arch"
|
|
bench "$arch -E 'm5 exit' -g"
|
|
gem5_insts "$arch"
|
|
#bench "$arch -E 'm5 exit' -g -- --cpu-type=DerivO3CPU ${caches}"
|
|
#gem5_insts "$arch"
|
|
|
|
arch=arm
|
|
bench "$arch -E '/poweroff.out'"
|
|
bench "$arch -E '/poweroff.out' -T exec_tb"
|
|
qemu_insts "$arch"
|
|
bench "$arch -E 'm5 exit' -g"
|
|
gem5_insts "$arch"
|
|
#bench "$arch -E 'm5 exit' -g -- --cpu-type=HPI ${caches}"
|
|
#gem5_insts "$arch"
|
|
|
|
arch=aarch64
|
|
bench "$arch -E '/poweroff.out'"
|
|
bench "$arch -E '/poweroff.out' -T exec_tb"
|
|
qemu_insts "$arch"
|
|
bench "$arch -E 'm5 exit' -g"
|
|
gem5_insts "$arch"
|
|
bench "$arch -E 'm5 exit' -g -- --cpu-type=HPI ${caches}"
|
|
gem5_insts "$arch"
|