mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 04:54:27 +01:00
run: generalize with main(), start porting trace-boot and qemu-trace2txt
This commit is contained in:
@@ -1,14 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
|
||||
while getopts "${common_getopts_flags}" OPT; do
|
||||
case "$OPT" in
|
||||
?)
|
||||
common_getopts_case "$OPT"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
common_setup
|
||||
./qemu/scripts/simpletrace.py \
|
||||
"${common_build_dir}/host-qemu-custom/trace-events-all" \
|
||||
"${common_qemu_run_dir}/trace.bin" \
|
||||
> "${common_trace_txt_file}"
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import common
|
||||
|
||||
def main():
|
||||
cmd = [
|
||||
os.path.join(common.qemu_src_dir, 'scripts/simpletrace.py'),
|
||||
os.path.join(common.qemu_build_dir, 'trace-events-all'),
|
||||
os.path.join(common.qemu_trace_file),
|
||||
]
|
||||
return common.run_cmd(
|
||||
cmd,
|
||||
cmd_file=os.path.join(common.run_dir, 'qemu-trace2txt'),
|
||||
out_file=common.qemu_trace_txt_file,
|
||||
show_stdout=False,
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = common.get_argparse(argparse_args={
|
||||
'description': 'Convert a QEMU `-trace exec_tb` to text form.'
|
||||
})
|
||||
args = common.setup(parser)
|
||||
sys.exit(main())
|
||||
|
||||
Reference in New Issue
Block a user