mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
fix run-toolchain, qemu-monitor, trace-boot, trace2line, bisect-linux-boot-gem5. Fixes part of #63
I'm sad no one reported qemu-monitor break, that one is kind of important. count.out arguments broke it as an init program, since the kernel adds trash parameters to every init. Is anyone using this repo, I wonder? Keep pushing, keep pushing. One day it gets good enough, and the whole world will see.
This commit is contained in:
43
trace2line
43
trace2line
@@ -8,27 +8,38 @@ now...
|
||||
'''
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import common
|
||||
from shell_helpers import LF
|
||||
|
||||
parser = self.get_argparse(argparse_args={
|
||||
'description': 'Convert an execution trace containing PC values into the Linux kernel linex executed'
|
||||
})
|
||||
args = self.setup(parser)
|
||||
sys.exit(subprocess.Popen([
|
||||
os.path.join(kwargs['root_dir'], 'trace2line.sh'),
|
||||
'true' if kwargs['emulator'] == 'gem5' else 'false',
|
||||
kwargs['trace_txt_file'],
|
||||
self.get_toolchain_tool('addr2line'),
|
||||
kwargs['vmlinux'],
|
||||
kwargs['run_dir'],
|
||||
]).wait())
|
||||
class Main(common.LkmcCliFunction):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
defaults = {
|
||||
'show_time': False,
|
||||
},
|
||||
description='''\
|
||||
Convert an execution trace containing PC values into the Linux kernel lines executed.
|
||||
''',
|
||||
)
|
||||
|
||||
# This was the full conversion attempt.
|
||||
def timed_main(self):
|
||||
self.sh.run_cmd([
|
||||
os.path.join(self.env['root_dir'], 'trace2line.sh'), LF,
|
||||
'true' if self.env['emulator'] == 'gem5' else 'false', LF,
|
||||
self.env['trace_txt_file'], LF,
|
||||
self.get_toolchain_tool('addr2line'), LF,
|
||||
self.env['vmlinux'], LF,
|
||||
self.env['run_dir'], LF,
|
||||
])
|
||||
|
||||
if __name__ == '__main__':
|
||||
Main().cli()
|
||||
|
||||
# This was the old full Python port attempt that was failing:
|
||||
|
||||
# import subprocess
|
||||
# import sys
|
||||
|
||||
# if kwargs['emulator'] == 'gem5':
|
||||
# def get_pc(line):
|
||||
|
||||
Reference in New Issue
Block a user