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

Fix runqueue parser kernel greater than v5.2


From kernel v5.2 task_struct member cpus_allowed is changed
to cpus_mask. Add a change to read cpus_mask in case kernel
version is greater than 5.2.

Change-Id: I82e1aa3e6a36d32659cb30554b70cfd06e4f0a2f
Signed-off-by: default avatarShivendra Pratap <spratap@codeaurora.org>
parent 10b7d1f5
No related branches found
No related tags found
No related merge requests found
# Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. # Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 and # it under the terms of the GNU General Public License version 2 and
...@@ -40,6 +40,9 @@ class RunQueues(RamParser): ...@@ -40,6 +40,9 @@ class RunQueues(RamParser):
def print_task_state(self, status, task_addr): def print_task_state(self, status, task_addr):
pid_offset = self.ramdump.field_offset('struct task_struct', 'pid') pid_offset = self.ramdump.field_offset('struct task_struct', 'pid')
comm_offset = self.ramdump.field_offset('struct task_struct', 'comm') comm_offset = self.ramdump.field_offset('struct task_struct', 'comm')
if self.ramdump.kernel_version > (5, 2, 0):
affinity_offset = self.ramdump.field_offset('struct task_struct', 'cpus_mask')
else:
affinity_offset = self.ramdump.field_offset('struct task_struct', 'cpus_allowed') affinity_offset = self.ramdump.field_offset('struct task_struct', 'cpus_allowed')
if 0 < task_addr: if 0 < task_addr:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment