Skip to content
Snippets Groups Projects
Commit 6833176e authored by Shivendra Pratap's avatar Shivendra Pratap
Browse files

Fix kconfig/Tasks parsing for kernel > 5.x


1. Fix kconfig extraction for kernel > 5.0.0.
2. Fix task call stack extraction for kernel > 5.2.0

Change-Id: Ic0d450ee6197f6fc7010b50884dea4d4855d5c1a
Signed-off-by: default avatarShivendra Pratap <spratap@codeaurora.org>
parent 10b7d1f5
Branches
No related tags found
No related merge requests found
...@@ -61,7 +61,11 @@ def dump_thread_group(ramdump, thread_group, task_out, taskhighlight_out, check_ ...@@ -61,7 +61,11 @@ def dump_thread_group(ramdump, thread_group, task_out, taskhighlight_out, check_
offset_stack = ramdump.field_offset('struct task_struct', 'stack') offset_stack = ramdump.field_offset('struct task_struct', 'stack')
offset_state = ramdump.field_offset('struct task_struct', 'state') offset_state = ramdump.field_offset('struct task_struct', 'state')
offset_prio = ramdump.field_offset('struct task_struct', 'prio') offset_prio = ramdump.field_offset('struct task_struct', 'prio')
if ramdump.kernel_version > (5, 2, 0):
offset_affine = ramdump.field_offset('struct task_struct', 'cpus_mask')
else:
offset_affine = ramdump.field_offset('struct task_struct', 'cpus_allowed') offset_affine = ramdump.field_offset('struct task_struct', 'cpus_allowed')
offset_exit_state = ramdump.field_offset( offset_exit_state = ramdump.field_offset(
'struct task_struct', 'exit_state') 'struct task_struct', 'exit_state')
orig_thread_group = thread_group orig_thread_group = thread_group
......
...@@ -768,9 +768,19 @@ class RamDump(): ...@@ -768,9 +768,19 @@ class RamDump():
kconfig_addr = self.address_of('kernel_config_data') kconfig_addr = self.address_of('kernel_config_data')
if kconfig_addr is None: if kconfig_addr is None:
return return
if self.kernel_version > (5, 0, 0):
kconfig_addr_end = self.address_of('kernel_config_data_end')
if kconfig_addr_end is None:
return
kconfig_size = kconfig_addr_end - kconfig_addr
# magic is 8 bytes before kconfig_addr and data
# starts at kconfig_addr for kernel > 5.0.0
kconfig_addr = kconfig_addr - 8
else:
kconfig_size = self.sizeof('kernel_config_data') kconfig_size = self.sizeof('kernel_config_data')
# size includes magic, offset from it # size includes magic, offset from it
kconfig_size = kconfig_size - 16 - 1 kconfig_size = kconfig_size - 16 - 1
zconfig = NamedTemporaryFile(mode='wb', delete=False) zconfig = NamedTemporaryFile(mode='wb', delete=False)
# kconfig data starts with magic 8 byte string, go past that # kconfig data starts with magic 8 byte string, go past that
s = self.read_cstring(kconfig_addr, 8) s = self.read_cstring(kconfig_addr, 8)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment