Skip to content
Snippets Groups Projects
Commit 8ac66a6f authored by Ankur Bansal's avatar Ankur Bansal
Browse files

lrdp_V2 : Fix for broken memusage.py

Fix for broken memusage.py

Change-Id: Idcc5dc7f313b5e35c22cc80f39aa972817483ea8
parent eebb35d0
No related branches found
No related tags found
No related merge requests found
......@@ -69,12 +69,7 @@ def do_dump_process_memory(ramdump):
next_thread_pid = task_struct + offset_pid
thread_task_pid = ramdump.read_int(next_thread_pid)
signal_struct = ramdump.read_word(task_struct + offset_signal)
adj = ramdump.read_u16(signal_struct + offset_adj)
if adj & 0x8000:
adj = adj - 0x10000
rss, swap = get_rss(ramdump, task_struct)
if rss != 0:
task_info.append([thread_task_name, thread_task_pid, rss, swap, rss + swap, adj])
next_task = ramdump.read_word(init_next_task)
if next_task is None:
break
......@@ -92,6 +87,16 @@ def do_dump_process_memory(ramdump):
if init_next_task == orig_init_next_task:
break
if signal_struct == 0 or signal_struct == None :
continue
adj = ramdump.read_u16(signal_struct + offset_adj)
if adj & 0x8000:
adj = adj - 0x10000
rss, swap = get_rss(ramdump, task_struct)
if rss != 0:
task_info.append([thread_task_name, thread_task_pid, rss, swap, rss + swap, adj])
task_info = sorted(task_info, key=lambda l: l[4], reverse=True)
str = '{0:<17s}{1:>8s}{2:>19s}{3:>12s}{4:>8}\n'.format(
'Task name', 'PID', 'RSS in kB', 'SWAP in kB', 'ADJ')
......
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