mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-24 18:51:36 +01:00
userland: freestanding gem5 checkpoint restore examples
This commit is contained in:
12
run
12
run
@@ -497,6 +497,12 @@ Extra options to append at the end of the emulator command line.
|
||||
] +
|
||||
gem5_exe_args
|
||||
)
|
||||
if self.env['gem5_restore'] is not None:
|
||||
# https://cirosantilli.com/linux-kernel-module-cheat#gem5-checkpoint-internals
|
||||
cpt_dirs = self.gem5_list_checkpoint_dirs()
|
||||
cpt_dir = cpt_dirs[-self.env['gem5_restore']]
|
||||
cpt_dirs_sorted_by_tick = sorted(cpt_dirs, key=lambda x: int(x.split('.')[1]))
|
||||
extra_emulator_args.extend(['-r', str(cpt_dirs_sorted_by_tick.index(cpt_dir) + 1)])
|
||||
if self.env['userland'] is not None:
|
||||
cmd.extend([
|
||||
self.env['gem5_se_file'], LF,
|
||||
@@ -524,12 +530,6 @@ Extra options to append at the end of the emulator command line.
|
||||
cmd.extend(['--interp-dir', self.env['userland_library_dir'], LF])
|
||||
else:
|
||||
if self.env['gem5_script'] == 'fs':
|
||||
if self.env['gem5_restore'] is not None:
|
||||
# https://cirosantilli.com/linux-kernel-module-cheat#gem5-checkpoint-internals
|
||||
cpt_dirs = self.gem5_list_checkpoint_dirs()
|
||||
cpt_dir = cpt_dirs[-self.env['gem5_restore']]
|
||||
cpt_dirs_sorted_by_tick = sorted(cpt_dirs, key=lambda x: int(x.split('.')[1]))
|
||||
extra_emulator_args.extend(['-r', str(cpt_dirs_sorted_by_tick.index(cpt_dir) + 1)])
|
||||
cmd.extend([
|
||||
self.env['gem5_fs_file'], LF,
|
||||
'--kernel', self.env['image'], LF,
|
||||
|
||||
Reference in New Issue
Block a user