mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
run: --trace-insts-stdout
This commit is contained in:
17
README.adoc
17
README.adoc
@@ -3110,7 +3110,7 @@ where `build` builds the whole toolchain for us.
|
|||||||
|
|
||||||
`./run --userland` path resolution is analogous to <<baremetal-setup-getting-started,that of `./run --baremetal`>>.
|
`./run --userland` path resolution is analogous to <<baremetal-setup-getting-started,that of `./run --baremetal`>>.
|
||||||
|
|
||||||
`./build user-mode-qemu` first builds Buildroot, and then runs `./build-userland`, which is further documented at: <<userland-directory>>.
|
`./build user-mode-qemu` first builds Buildroot, and then runs `./build-userland`, which is further documented at: <<userland-directory>>. It also builds QEMU.
|
||||||
|
|
||||||
==== User mode simulation with glibc
|
==== User mode simulation with glibc
|
||||||
|
|
||||||
@@ -9057,12 +9057,23 @@ Output the trace to stdout instead of a file:
|
|||||||
--arch aarch64 \
|
--arch aarch64 \
|
||||||
--emulator gem5 \
|
--emulator gem5 \
|
||||||
--eval 'm5 exit' \
|
--eval 'm5 exit' \
|
||||||
--trace Exec \
|
--trace ExecAll \
|
||||||
--trace-stdout \
|
--trace-stdout \
|
||||||
;
|
;
|
||||||
....
|
....
|
||||||
|
|
||||||
This would produce a lot of output however, so you will likely not want that when tracing a Linux kernel boot instructions. But it can be very convenient for smaller traces.
|
We also have a shortcut for `--trace ExecAll -trace-stdout` with `--trace-insts-stdout`
|
||||||
|
|
||||||
|
....
|
||||||
|
./run \
|
||||||
|
--arch aarch64 \
|
||||||
|
--emulator gem5 \
|
||||||
|
--eval 'm5 exit' \
|
||||||
|
--trace-insts-stdout \
|
||||||
|
;
|
||||||
|
....
|
||||||
|
|
||||||
|
This would produce a lot of output however, so you will likely not want that when tracing a Linux kernel boot instructions. But it can be very convenient for smaller traces such as <<baremetal>>.
|
||||||
|
|
||||||
List all available debug flags:
|
List all available debug flags:
|
||||||
|
|
||||||
|
|||||||
16
run
16
run
@@ -160,9 +160,17 @@ rare and don't affect performance, because `./configure
|
|||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
self.add_argument(
|
self.add_argument(
|
||||||
'--trace-stdout', default=False,
|
'--trace-stdout',
|
||||||
|
default=False,
|
||||||
help='''\
|
help='''\
|
||||||
Output trace to stdout instead of a file. Only works for gem5 currently.
|
Output trace to stdout instead of a file. Only works for gem5 currently.
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
self.add_argument(
|
||||||
|
'--trace-insts-stdout',
|
||||||
|
default=False,
|
||||||
|
help='''\
|
||||||
|
Trace instructions run to stdout. Shortcut for --trace --trace-stdout.
|
||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
self.add_argument(
|
self.add_argument(
|
||||||
@@ -274,6 +282,12 @@ Run QEMU with VNC instead of the default SDL. Connect to it with:
|
|||||||
if kernel_cli_after_dash:
|
if kernel_cli_after_dash:
|
||||||
kernel_cli += " -{}".format(kernel_cli_after_dash)
|
kernel_cli += " -{}".format(kernel_cli_after_dash)
|
||||||
extra_env = {}
|
extra_env = {}
|
||||||
|
if self.env['trace_insts_stdout']:
|
||||||
|
if self.env['emulator'] == 'qemu':
|
||||||
|
extra_emulator_args.extend(['-d', 'in_asm', LF])
|
||||||
|
elif self.env['emulator'] == 'gem5':
|
||||||
|
self.env['trace_stdout'] = True
|
||||||
|
self.env['trace'] = 'ExecAll'
|
||||||
if self.env['trace'] is None:
|
if self.env['trace'] is None:
|
||||||
do_trace = False
|
do_trace = False
|
||||||
# A dummy value that is already turned on by default and does not produce large output,
|
# A dummy value that is already turned on by default and does not produce large output,
|
||||||
|
|||||||
Reference in New Issue
Block a user