mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
a bit less broken stuff
This commit is contained in:
46
test-boot
46
test-boot
@@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import common
|
||||
import shell_helpers
|
||||
from shell_helpers import LF
|
||||
|
||||
class Main(common.LkmcCliFunction):
|
||||
class Main(common.TestCliFunction):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
defaults={
|
||||
@@ -27,19 +28,16 @@ Size of the tests to run. Scale:
|
||||
)
|
||||
|
||||
def _bench(self, **kwargs):
|
||||
self.run(**kwargs)
|
||||
words = []
|
||||
for line in self.run.get_cli(**kwargs):
|
||||
words.extend(line)
|
||||
extra_params = shell_helpers.ShellHelpers().cmd_to_string(words + [LF])
|
||||
run_args = kwargs.copy()
|
||||
run_args.update(self.common_args)
|
||||
self.run_test(self.run, run_args, extra_params)
|
||||
|
||||
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['test_boot_benchmark_file']"
|
||||
#)
|
||||
#
|
||||
#newline() (
|
||||
# echo >> "$self.env['test_boot_benchmark_file']"
|
||||
#)
|
||||
#
|
||||
#gem5_insts() (
|
||||
# printf "instructions $(./gem5-stat --arch "$1" sim_insts)\n" >> "$self.env['test_boot_benchmark_file']"
|
||||
# newline
|
||||
@@ -55,20 +53,21 @@ Size of the tests to run. Scale:
|
||||
#
|
||||
#rm -f "${self.env['test_boot_benchmark_file']}"
|
||||
self.run = self.import_path_main('run')
|
||||
run_args = self.get_common_args()
|
||||
self.common_args = self.get_common_args()
|
||||
self.common_args['ctrl_c_host'] = True
|
||||
if self.env['emulator'] == 'gem5':
|
||||
run_args['eval'] = 'm5 exit'
|
||||
self.common_args['eval'] = 'm5 exit'
|
||||
elif self.env['emulator'] == 'qemu':
|
||||
run_args['eval'] = '/poweroff.out'
|
||||
self.common_args['eval'] = '/poweroff.out'
|
||||
if (self.env['emulator'] == 'qemu' or
|
||||
(self.env['emulator'] == 'gem5' and self.env['size'] >= 2)):
|
||||
self._bench(**run_args)
|
||||
self._bench()
|
||||
if self.env['host_arch'] == self.env['arch']:
|
||||
# TODO: find out why it fails.
|
||||
if self.env['emulator'] != 'gem5':
|
||||
self._bench(kvm=True, **run_args)
|
||||
self._bench(kvm=True)
|
||||
if self.env['emulator'] == 'qemu' and self.env['size'] >= 2:
|
||||
self._bench(trace='exec_tb', **run_args)
|
||||
self._bench(trace='exec_tb')
|
||||
if self.env['emulator'] == 'gem5' and self.env['size'] >= 3:
|
||||
if self.env['arch'] == 'x86_64':
|
||||
cpu_types = ['DerivO3CPU']
|
||||
@@ -83,18 +82,17 @@ Size of the tests to run. Scale:
|
||||
'--cpu-type', cpu_type,
|
||||
'--caches',
|
||||
'--l2cache',
|
||||
'--l1d_size=1024kB',
|
||||
'--l1i_size=1024kB',
|
||||
'--l2_size=1024kB',
|
||||
'--l3_size=1024kB',
|
||||
'--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)
|
||||
self._bench(gem5_build_type=build_type)
|
||||
self._bench(gem5_script='biglittle')
|
||||
|
||||
if __name__ == '__main__':
|
||||
Main().cli_exit()
|
||||
|
||||
Reference in New Issue
Block a user