Skip to content
Snippets Groups Projects
Commit 311d9e0a authored by Charan Teja Reddy's avatar Charan Teja Reddy
Browse files

lrdp: slab: read proper fields in page for allocated objects

ankban reported issue with slabsummary.txt showing wrong values in
ALLOCATED column. Read proper counter values from the slab page so that
values are reflected properly.

Change-Id: Id67d30f8e8af03785e35bb1ac2c0e440e841c0a6
parent 6c353fe0
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ class Slabinfo_summary(RamParser):
if page == 0:
return totalfree
seen = []
mapcount = 0
count = 0
total_objects = 0
inuse = 0
while page != start:
......@@ -43,10 +43,14 @@ class Slabinfo_summary(RamParser):
return totalfree
seen.append(page)
page = page - slab_lru_offset
mapcount = self.ramdump.read_structure_field(
page, 'struct page', '_mapcount')
inuse = mapcount & 0x0000FFFF
total_objects = (mapcount >> 16) & 0x00007FFF
if (self.ramdump.kernel_version <= (4, 14)):
count = self.ramdump.read_structure_field(
page, 'struct page', '_mapcount')
else:
count = self.ramdump.read_structure_field(
page, 'struct page', 'counters')
inuse = count & 0x0000FFFF
total_objects = (count >> 16) & 0x00007FFF
freeobj = total_objects - inuse
totalfree = totalfree + freeobj
page = self.ramdump.read_word(page + slab_lru_offset)
......
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