userland: get a bit closer to perfection

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent 85006363f8
commit b49ebb1c8a
5 changed files with 97 additions and 30 deletions

80
run
View File

@@ -99,7 +99,20 @@ timestamps.
'''
)
self.add_argument(
'--kdb', default=False,
'--graphic',
default=False,
help='''\
Run in graphic mode.
See: http://github.com/cirosantilli/linux-kernel-module-cheat#graphics
'''
)
self.add_argument(
'--kdb',
default=False,
help='''\
Setup KDB kernel CLI options.
See: http://github.com/cirosantilli/linux-kernel-module-cheat#kdb
'''
)
self.add_argument(
'--kernel-cli',
@@ -136,14 +149,26 @@ See: http://github.com/cirosantilli/linux-kernel-module-cheat#fatal-kernel-too-o
'''
)
self.add_argument(
'--kgdb', default=False,
'--kgdb',
default=False,
help='''\
Setup KGDB kernel CLI options.
See: http://github.com/cirosantilli/linux-kernel-module-cheat#kgdb
'''
)
self.add_argument(
'-K', '--kvm', default=False,
help='Use KVM. Only works if guest arch == host arch'
'-K',
'--kvm',
default=False,
help='''\
Use KVM. Only works if guest arch == host arch.
See: http://github.com/cirosantilli/linux-kernel-module-cheat#kvm
'''
)
self.add_argument(
'-m', '--memory', default='256M',
'-m',
'--memory',
default='256M',
help='''\
Set the memory size of the guest. E.g.: `-m 512M`. We try to keep the default
at the minimal ammount amount that boots all archs. Anything lower could lead
@@ -159,19 +184,25 @@ Setup a kernel init parameter that makes the emulator quit immediately after boo
'''
)
self.add_argument(
'-R', '--replay', default=False,
'-R',
'--replay',
default=False,
help='Replay a QEMU run record deterministically'
)
self.add_argument(
'-r', '--record', default=False,
'-r',
'--record',
default=False,
help='Record a QEMU run record for later replay with `-R`'
)
self.add_argument(
'--show-stdout', default=True,
'--show-stdout',
default=True,
help='''Show emulator stdout and stderr on the host terminal.'''
)
self.add_argument(
'--terminal', default=False,
'--terminal',
default=False,
help='''\
Output to the terminal, don't pipe to tee as the default.
Does not save the output to a file, but allows you to use debuggers.
@@ -180,13 +211,15 @@ gem5 Python scripts with pdb.
'''
)
self.add_argument(
'-T', '--trace',
'-T',
'--trace',
help='''\
Set trace events to be enabled. If not given, gem5 tracing is completely
disabled, while QEMU tracing is enabled but uses default traces that are very
rare and don't affect performance, because `./configure
--enable-trace-backends=simple` seems to enable some traces by default, e.g.
`pr_manager_run`, and I don't know how to get rid of them.
See: http://github.com/cirosantilli/linux-kernel-module-cheat#tracing
'''
)
self.add_argument(
@@ -204,7 +237,9 @@ Trace instructions run to stdout. Shortcut for --trace --trace-stdout.
'''
)
self.add_argument(
'-t', '--tmux', default=False,
'-t',
'--tmux',
default=False,
help='''\
Create a tmux split the window. You must already be inside of a `tmux` session
to use this option:
@@ -222,23 +257,28 @@ Parameters to pass to the program running on the tmux split. Implies --tmux.
'''
)
self.add_argument(
'-w', '--wait-gdb', default=False,
help='Wait for GDB to connect before starting execution'
'--wait-gdb',
default=False,
help='''\
Wait for GDB to connect before starting execution
See: https://github.com/cirosantilli/linux-kernel-module-cheat#gdb
'''
)
self.add_argument(
'-x', '--graphic', default=False,
help='Run in graphic mode. Mnemonic: X11'
)
self.add_argument(
'-V', '--vnc', default=False,
'--vnc',
default=False,
help='''\
Run QEMU with VNC instead of the default SDL. Connect to it with:
`vinagre localhost:5900`.
'''
)
self.add_argument(
'extra_emulator_args', nargs='*', default=[],
help='Extra options to append at the end of the emulator command line'
'extra_emulator_args',
nargs='*',
default=[],
help='''\
Extra options to append at the end of the emulator command line.
'''
)
def timed_main(self):