0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

GDB connection: resource pools don't keep free pages

This commit is contained in:
Maria Matejka 2022-10-12 14:23:50 +02:00
parent ed7336e06e
commit a9fe913a41

View File

@ -396,17 +396,11 @@ class BIRDPoolResource(BIRDResource):
self.items = [] self.items = []
BIRDList(self.val["inside"]).walk(self.parse_inside) BIRDList(self.val["inside"]).walk(self.parse_inside)
def free_pages(self):
if str(self.val['pages']) == '0x0':
return 0
else:
return self.val['pages'].dereference()['free']
def memsize(self): def memsize(self):
if self.items is None: if self.items is None:
self.parse() self.parse()
sum = BIRDResourceSize(0, self.pooltype.sizeof, self.free_pages() * self.page_size) sum = BIRDResourceSize(0, self.pooltype.sizeof, 0)
# for i in self.items: # for i in self.items:
# sum += i.memsize() # sum += i.memsize()
@ -419,7 +413,7 @@ class BIRDPoolResource(BIRDResource):
# for i in self.items: # for i in self.items:
# print(i) # print(i)
return f"Resource pool {self.val.address} \"{self.val['name'].string()}\" containing {len(self.items)} items and {self.free_pages()} free pages" return f"Resource pool {self.val.address} \"{self.val['name'].string()}\" containing {len(self.items)} items"
BIRDResourceMap = { BIRDResourceMap = {
"mbl_memsize": BIRDMBResource, "mbl_memsize": BIRDMBResource,