mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
test-boot: run in parallel
--quit-after-boot: fix for gem5, update path to gem5.sh Improve the printing of results and errors: - remove newlines from IDs at the end for ./test-boot - remove newlines from progress for __call__ commands and don't print executed commands at all, otherwise there are too many lines per test and it is hard to tell what is going on - print backtraces for any exception in the threads (bugs while developing this code) Tests across different archs and emulators are still not running in parallel, which is a huge loss. TODO. thread_pool: introduce with API. This was motivate by test-boot, I've had enough of doing separate error handling for each loop type! Greatly dries up the code, awesome. common: make --all-emulators work properly with native hopefully for the last time, ./test-baremetal was still failing. gem5: don't pass --command-line for baremetal. Maybe later we can use it to actually pass command line arguments to main()? To be seen.
This commit is contained in:
48
run
48
run
@@ -231,9 +231,9 @@ Setup a kernel init parameter that makes the emulator quit immediately after boo
|
||||
help='''\
|
||||
Output directly to the terminal, don't pipe to tee as the default.
|
||||
With this, we don't not save the output to a file as is done by default,
|
||||
but we are able to do things that require not having a pipe suh as you to
|
||||
using debuggers. This option issSet automatically by --debug-vm, but you still need
|
||||
it to debug gem5 Python scripts with pdb.
|
||||
but we are able to do things that require not having a pipe such as
|
||||
using debuggers. This option is set automatically by --debug-vm, but you
|
||||
still need it to debug gem5 Python scripts with pdb.
|
||||
'''
|
||||
)
|
||||
self.add_argument(
|
||||
@@ -309,8 +309,6 @@ Extra options to append at the end of the emulator command line.
|
||||
)
|
||||
|
||||
def timed_main(self):
|
||||
if self.env['emulator'] == 'native' and self.env['userland'] is None:
|
||||
raise Exception('native emulator only supported in user mode')
|
||||
show_stdout = self.env['show_stdout']
|
||||
# Common qemu / gem5 logic.
|
||||
# nokaslr:
|
||||
@@ -481,7 +479,8 @@ Extra options to append at the end of the emulator command line.
|
||||
if self.env['arch'] == 'x86_64':
|
||||
if self.env['kvm']:
|
||||
cmd.extend(['--cpu-type', 'X86KvmCPU', LF])
|
||||
cmd.extend(['--command-line', 'earlyprintk={} lpj=7999923 root=/dev/sda {}'.format(console, kernel_cli), LF])
|
||||
if self.env['baremetal'] is None:
|
||||
cmd.extend(['--command-line', 'earlyprintk={} lpj=7999923 root=/dev/sda {}'.format(console, kernel_cli), LF])
|
||||
elif self.env['is_arm']:
|
||||
if self.env['kvm']:
|
||||
cmd.extend(['--cpu-type', 'ArmV8KvmCPU', LF])
|
||||
@@ -492,14 +491,24 @@ Extra options to append at the end of the emulator command line.
|
||||
cmd.extend([
|
||||
# TODO why is it mandatory to pass mem= here? Not true for QEMU.
|
||||
# Anything smaller than physical blows up as expected, but why can't it auto-detect the right value?
|
||||
'--command-line', 'earlyprintk=pl011,0x1c090000 lpj=19988480 rw loglevel=8 mem={} root=/dev/sda {}'.format(memory, kernel_cli), LF,
|
||||
'--machine-type', self.env['machine'], LF,
|
||||
])
|
||||
if self.env['baremetal'] is None:
|
||||
cmd.extend(['--command-line', 'earlyprintk=pl011,0x1c090000 lpj=19988480 rw loglevel=8 mem={} root=/dev/sda {}'.format(memory, kernel_cli), LF])
|
||||
dtb = None
|
||||
if self.env['dtb'] is not None:
|
||||
dtb = self.env['dtb']
|
||||
elif self.env['dp650']:
|
||||
dtb = os.path.join(self.env['gem5_system_dir'], 'arm', 'dt', 'armv{}_gem5_v1_{}{}cpu.dtb'.format(self.env['armv'], dp650_cmd, self.env['cpus']))
|
||||
dtb = os.path.join(
|
||||
self.env['gem5_system_dir'],
|
||||
'arm',
|
||||
'dt',
|
||||
'armv{}_gem5_v1_{}{}cpu.dtb'.format(
|
||||
self.env['armv'],
|
||||
dp650_cmd,
|
||||
self.env['cpus']
|
||||
)
|
||||
)
|
||||
if dtb is not None:
|
||||
cmd.extend(['--dtb-filename', dtb, LF])
|
||||
if self.env['baremetal'] is None:
|
||||
@@ -521,7 +530,13 @@ Extra options to append at the end of the emulator command line.
|
||||
cpt_dir = self.gem5_list_checkpoint_dirs()[-self.env['gem5_restore']]
|
||||
extra_emulator_args.extend(['--restore-from', os.path.join(self.env['m5out_dir'], cpt_dir)])
|
||||
cmd.extend([
|
||||
os.path.join(self.env['gem5_source_dir'], 'configs', 'example', 'arm', 'fs_bigLITTLE.py'), LF,
|
||||
os.path.join(
|
||||
self.env['gem5_source_dir'],
|
||||
'configs',
|
||||
'example',
|
||||
'arm',
|
||||
'fs_bigLITTLE.py'
|
||||
), LF,
|
||||
'--big-cpus', '2', LF,
|
||||
'--cpu-type', cpu_type, LF,
|
||||
'--disk', self.env['disk_image'], LF,
|
||||
@@ -529,7 +544,15 @@ Extra options to append at the end of the emulator command line.
|
||||
'--little-cpus', '2', LF,
|
||||
])
|
||||
if self.env['dtb']:
|
||||
cmd.extend(['--dtb', os.path.join(self.env['gem5_system_dir'], 'arm', 'dt', 'armv8_gem5_v1_big_little_2_2.dtb'), NL])
|
||||
cmd.extend([
|
||||
'--dtb',
|
||||
os.path.join(self.env['gem5_system_dir'],
|
||||
'arm',
|
||||
'dt',
|
||||
'armv8_gem5_v1_big_little_2_2.dtb'
|
||||
),
|
||||
LF
|
||||
])
|
||||
if self.env['gdb_wait']:
|
||||
# https://stackoverflow.com/questions/49296092/how-to-make-gem5-wait-for-gdb-to-connect-to-reliably-break-at-start-kernel-of-th
|
||||
cmd.extend(['--param', 'system.cpu[0].wait_for_remote_gdb = True', LF])
|
||||
@@ -570,7 +593,10 @@ Extra options to append at the end of the emulator command line.
|
||||
serial_monitor = ['-serial', serial, LF]
|
||||
if self.env['kvm']:
|
||||
extra_emulator_args.extend(['-enable-kvm', LF])
|
||||
extra_emulator_args.extend(['-serial', 'tcp::{},server,nowait'.format(self.env['extra_serial_port']), LF])
|
||||
extra_emulator_args.extend([
|
||||
'-serial',
|
||||
'tcp::{},server,nowait'.format(self.env['extra_serial_port']), LF
|
||||
])
|
||||
virtfs_data = [
|
||||
(self.env['p9_dir'], 'host_data'),
|
||||
(self.env['out_dir'], 'host_out'),
|
||||
|
||||
Reference in New Issue
Block a user