mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-30 05:24:25 +01:00
qemu-trace2txt: port to clifunction
This commit is contained in:
@@ -1,13 +1,19 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import common
|
import common
|
||||||
from shell_helpers import LF
|
from shell_helpers import LF
|
||||||
|
|
||||||
def main():
|
class Main(common.LkmcCliFunction):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__(
|
||||||
|
description='''\
|
||||||
|
Convert a QEMU `-trace exec_tb` to text form.
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
|
||||||
|
def timed_main(self):
|
||||||
return self.sh.run_cmd(
|
return self.sh.run_cmd(
|
||||||
[
|
[
|
||||||
os.path.join(self.env['qemu_source_dir'], 'scripts/simpletrace.py'), LF,
|
os.path.join(self.env['qemu_source_dir'], 'scripts/simpletrace.py'), LF,
|
||||||
@@ -20,8 +26,4 @@ def main():
|
|||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = self.get_argparse(argparse_args={
|
Main().cli_exit()
|
||||||
'description': 'Convert a QEMU `-trace exec_tb` to text form.'
|
|
||||||
})
|
|
||||||
args = self.setup(parser)
|
|
||||||
sys.exit(main())
|
|
||||||
|
|||||||
@@ -169,6 +169,9 @@ class ShellHelpers:
|
|||||||
|
|
||||||
:param extra_env: extra environment variables to add when running the command
|
:param extra_env: extra environment variables to add when running the command
|
||||||
:type extra_env: Dict[str,str]
|
:type extra_env: Dict[str,str]
|
||||||
|
|
||||||
|
:return: exit status of the command
|
||||||
|
:rtype: int
|
||||||
'''
|
'''
|
||||||
if out_file is not None:
|
if out_file is not None:
|
||||||
stdout = subprocess.PIPE
|
stdout = subprocess.PIPE
|
||||||
|
|||||||
Reference in New Issue
Block a user