Skip to content
Snippets Groups Projects
Commit a3d39b29 authored by Lingutla Chandrasekhar's avatar Lingutla Chandrasekhar
Browse files

lrdp_V2: Support to print task's affinity


Add support to print task's affinity in runqueue info and
task dump parsers.

Change-Id: I790a64764fdba7232b89beaa0c5bbbbfe5d5861f
Signed-off-by: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
parent 04117f03
No related branches found
No related tags found
No related merge requests found
...@@ -40,12 +40,14 @@ class RunQueues(RamParser): ...@@ -40,12 +40,14 @@ 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')
affinity_offset = self.ramdump.field_offset('struct task_struct', 'cpus_allowed')
if 0 < task_addr: if 0 < task_addr:
pid = self.ramdump.read_int(task_addr + pid_offset) pid = self.ramdump.read_int(task_addr + pid_offset)
taskname = self.ramdump.read_cstring(task_addr + comm_offset, 16) taskname = self.ramdump.read_cstring(task_addr + comm_offset, 16)
affinity = self.ramdump.read_u64(task_addr + affinity_offset)
self.print_out_str_with_tab( self.print_out_str_with_tab(
'{0}: {1}({2})'.format(status, taskname, pid)) '{0}: {1}({2}) [affinity={3:x}]'.format(status, taskname, pid, affinity))
else: else:
self.print_out_str_with_tab('{0}: None(0)'.format(status)) self.print_out_str_with_tab('{0}: None(0)'.format(status))
......
...@@ -61,6 +61,7 @@ def dump_thread_group(ramdump, thread_group, task_out, taskhighlight_out, check_ ...@@ -61,6 +61,7 @@ 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')
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
...@@ -74,6 +75,7 @@ def dump_thread_group(ramdump, thread_group, task_out, taskhighlight_out, check_ ...@@ -74,6 +75,7 @@ def dump_thread_group(ramdump, thread_group, task_out, taskhighlight_out, check_
next_thread_stack = next_thread_start + offset_stack next_thread_stack = next_thread_start + offset_stack
next_thread_state = next_thread_start + offset_state next_thread_state = next_thread_start + offset_state
next_thread_exit_state = next_thread_start + offset_exit_state next_thread_exit_state = next_thread_start + offset_exit_state
next_thread_affine = next_thread_start + offset_affine
next_thread_info = ramdump.get_thread_info_addr(next_thread_start) next_thread_info = ramdump.get_thread_info_addr(next_thread_start)
thread_task_name = cleanupString( thread_task_name = cleanupString(
ramdump.read_cstring(next_thread_comm, 16)) ramdump.read_cstring(next_thread_comm, 16))
...@@ -87,6 +89,9 @@ def dump_thread_group(ramdump, thread_group, task_out, taskhighlight_out, check_ ...@@ -87,6 +89,9 @@ def dump_thread_group(ramdump, thread_group, task_out, taskhighlight_out, check_
thread_task_pid = ramdump.read_int(next_thread_pid) thread_task_pid = ramdump.read_int(next_thread_pid)
if thread_task_pid is None: if thread_task_pid is None:
return return
thread_task_affine = ramdump.read_u64(next_thread_affine)
if thread_task_affine is None:
return
task_state = ramdump.read_word(next_thread_state) task_state = ramdump.read_word(next_thread_state)
if task_state is None: if task_state is None:
return return
...@@ -124,8 +129,8 @@ def dump_thread_group(ramdump, thread_group, task_out, taskhighlight_out, check_ ...@@ -124,8 +129,8 @@ def dump_thread_group(ramdump, thread_group, task_out, taskhighlight_out, check_
thread_line = ' ' + thread_line thread_line = ' ' + thread_line
if not first: if not first:
task_out.write('Process: {0}, cpu: {1} pid: {2} start: 0x{3:x}\n'.format( task_out.write('Process: {0}, [affinity: 0x{1:x}] cpu: {2} pid: {3} start: 0x{4:x}\n'.format(
thread_task_name, task_cpu, thread_task_pid, next_thread_start)) thread_task_name, thread_task_affine, task_cpu, thread_task_pid, next_thread_start))
task_out.write( task_out.write(
'=====================================================\n') '=====================================================\n')
first = 1 first = 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment