bench-boot: continue progress, renamte to test-boot

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent c2983e0e1f
commit eedbb02a14
7 changed files with 38 additions and 62 deletions

View File

@@ -10993,8 +10993,8 @@ We tried to automate it on Travis with link:.travis.yml[] but it hits the curren
Run all kernel boot benchmarks for one arch:
....
./build-bench-boot --size 3 && ./bench-boot --size 3
cat "$(./getvar bench_boot)"
./build-test-boot --size 3 && ./test-boot --size 3
cat "$(./getvar test_boot_benchmark_file)"
....
Sample results at 8fb9db39316d43a6dbd571e04dd46ae73915027f:

View File

@@ -117,8 +117,8 @@ fi
if "$bench_linux_boot"; then
cd "${root_dir}"
"${root_dir}/build" --all-archs all
"${root_dir}/bench-boot" --size 3
cp "$(${root_dir}/getvar bench_boot)" "$new_dir"
"${root_dir}/test-boot" --size 3
cp "$(${root_dir}/getvar test_boot_benchmark_file)" "$new_dir"
fi
if "$update_repo"; then

View File

@@ -9,5 +9,5 @@ while [ $# -gt 0 ]; do
;;
esac
done
./build-bench-boot --size "$test_size"
./build-test-boot --size "$test_size"
./build --all-archs test-gdb

View File

@@ -47,7 +47,7 @@ consts['buildroot_out_dir'] = os.path.join(consts['out_dir'], 'buildroot')
consts['gem5_m5_build_dir'] = os.path.join(consts['out_dir'], 'util', 'm5')
consts['run_dir_base'] = os.path.join(consts['out_dir'], 'run')
consts['crosstool_ng_out_dir'] = os.path.join(consts['out_dir'], 'crosstool-ng')
consts['bench_boot'] = os.path.join(consts['out_dir'], 'bench-boot.txt')
consts['test_boot_benchmark_file'] = os.path.join(consts['out_dir'], 'test-boot.txt')
consts['packages_dir'] = os.path.join(consts['root_dir'], 'buildroot_packages')
consts['kernel_modules_subdir'] = 'kernel_modules'
consts['kernel_modules_source_dir'] = os.path.join(consts['root_dir'], consts['kernel_modules_subdir'])

2
test
View File

@@ -9,7 +9,7 @@ while [ $# -gt 0 ]; do
;;
esac
done
./bench-boot --size "$test_size"
./test-boot --size "$test_size"
./test-modules --all-archs --all-emulators
./test-gdb --all-archs --all-emulators
./test-baremetal --all-archs --all-emulators

View File

@@ -30,16 +30,18 @@ Size of the tests to run. Scale:
self.run(**kwargs)
def timed_main(self):
# TODO bring this benchmark code back to life. Likely should go inside run with an option
#
#bench() (
# "${root_dir}/bench-cmd" "./run --arch ${1}${extra_args}" "$self.env['bench_boot']"
# "${root_dir}/bench-cmd" "./run --arch ${1}${extra_args}" "$self.env['test_boot_benchmark_file']"
#)
#
#newline() (
# echo >> "$self.env['bench_boot']"
# echo >> "$self.env['test_boot_benchmark_file']"
#)
#
#gem5_insts() (
# printf "instructions $(./gem5-stat --arch "$1" sim_insts)\n" >> "$self.env['bench_boot']"
# printf "instructions $(./gem5-stat --arch "$1" sim_insts)\n" >> "$self.env['test_boot_benchmark_file']"
# newline
#)
#
@@ -47,12 +49,11 @@ Size of the tests to run. Scale:
# common_arch="$1"
# ./qemu-trace2txt --arch "$common_arch"
# common_qemu_trace_txt_file="$("$getvar" --arch "$common_arch" qemu_trace_txt_file)"
# printf "instructions $(wc -l "${common_qemu_trace_txt_file}" | cut -d' ' -f1)\n" >> "$self.env['bench_boot']"
# printf "instructions $(wc -l "${common_qemu_trace_txt_file}" | cut -d' ' -f1)\n" >> "$self.env['test_boot_benchmark_file']"
# newline
#)
#
#rm -f "${self.env['bench_boot']}"
#rm -f "${self.env['test_boot_benchmark_file']}"
self.run = self.import_path_main('run')
run_args = self.get_common_args()
if self.env['emulator'] == 'gem5':
@@ -66,59 +67,34 @@ Size of the tests to run. Scale:
# TODO: find out why it fails.
if self.env['emulator'] != 'gem5':
self._bench(kvm=True, **run_args)
# newline
if self.env['emulator'] == 'qemu' and self.env['size'] >= 2:
self._bench(trace='exec_tb', **run_args)
# qemu_insts "$arch"
if self.env['emulator'] == 'gem5' and self.env['size'] >= 3:
self._bench(
extra_emulator_args=[
'--cpu-type',
if self.env['arch'] == 'x86_64':
cpu_types = ['DerivO3CPU']
elif self.env['is_arm']:
cpu_types = [
'DerivO3CPU',
'--caches',
'--l2cache',
'--l1d_size=1024kB',
'--l1i_size=1024kB',
'--l2_size=1024kB',
'--l3_size=1024kB',
],
**run_args
)
# gem5_insts "$arch"
#arch=arm
#bench "$arch --eval '/poweroff.out'"
#newline
#if [ self.env['size'] -ge 2 ]; then
# bench "$arch --eval '/poweroff.out' --trace exec_tb"
# qemu_insts "$arch"
# bench "$arch --eval 'm5 exit' --emulator gem5"
# gem5_insts "$arch"
#fi
#if [ self.env['size'] -ge 3 ]; then
# bench "$arch --eval 'm5 exit' --emulator gem5 -- --cpu-type=HPI ${caches}"
# gem5_insts "$arch"
#fi
#arch=aarch64
#bench "$arch --eval '/poweroff.out'"
#newline
#if [ self.env['size'] -ge 2 ]; then
# bench "$arch --eval '/poweroff.out' --trace exec_tb"
# qemu_insts "$arch"
# bench "$arch --eval 'm5 exit' --emulator gem5"
# gem5_insts "$arch"
#fi
#if [ self.env['size'] -ge 3 ]; then
# bench "$arch --eval 'm5 exit' --emulator gem5 -- --cpu-type=HPI ${caches}"
# gem5_insts "$arch"
# #bench "$arch --eval 'm5 exit' --emulator gem5 --gem5-script biglittle"
# #gem5_insts "$arch"
# bench "$arch --eval 'm5 exit' --emulator gem5 --gem5-build-type fast"
# gem5_insts "$arch"
# bench "$arch --eval 'm5 exit' --emulator gem5 --gem5-build-type debug"
# gem5_insts "$arch"
#fi
'HPI',
]
for cpu_type in cpu_types:
self._bench(
extra_emulator_args=[
'--cpu-type', cpu_type,
'--caches',
'--l2cache',
'--l1d_size=1024kB',
'--l1i_size=1024kB',
'--l2_size=1024kB',
'--l3_size=1024kB',
],
**run_args
)
if self.env['arch'] == 'aarch64':
# Do a fuller testing for aarch64.
for build_type in ['debug', 'fast']:
self._bench(gem5_build_type=build_type, **run_args)
self._bench(gem5_script='biglittle', **run_args)
if __name__ == '__main__':
Main().cli_exit()