Skip to content
Snippets Groups Projects
Commit cfc6ef72 authored by Gopi Krishna Nedanuri's avatar Gopi Krishna Nedanuri
Browse files

lrdp-v2: Ignore negative RSS values

As RSS values are read as unsigned, will get a large possive value.

Change-Id: Ieedc4223293cce40c295c692d32b6bb8498bafa1
parent 33e9281e
No related branches found
No related tags found
No related merge requests found
...@@ -113,6 +113,13 @@ def get_rss(ramdump, task_struct): ...@@ -113,6 +113,13 @@ def get_rss(ramdump, task_struct):
anon_rss = ramdump.read_word(mm_struct + offset_rss_stat + offset_anon_rss) anon_rss = ramdump.read_word(mm_struct + offset_rss_stat + offset_anon_rss)
rss = ramdump.read_word(mm_struct + offset_rss_stat + offset_rss) rss = ramdump.read_word(mm_struct + offset_rss_stat + offset_rss)
file_rss = ramdump.read_word(mm_struct + offset_rss_stat + offset_file_rss) file_rss = ramdump.read_word(mm_struct + offset_rss_stat + offset_file_rss)
# Ignore negative RSS values
if anon_rss > 0x80000000:
anon_rss = 0
if rss > 0x80000000:
rss = 0
if file_rss > 0x80000000:
file_rss = 0
total_rss = rss + anon_rss + file_rss total_rss = rss + anon_rss + file_rss
return total_rss return total_rss
......
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