summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-10-12 14:23:50 +0200
committerMaria Matejka <mq@ucw.cz>2022-10-12 14:23:50 +0200
commita9fe913a41a9eff33ce9d39a7e3a80c8498bae0e (patch)
tree9fae3a72df9c637c1bfac6b187fac243d0fb0ed3
parented7336e06e105b3ddc72b0b97e8372339a366174 (diff)
GDB connection: resource pools don't keep free pages
-rw-r--r--bird-gdb.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/bird-gdb.py b/bird-gdb.py
index dc1e54b2..c53a3b55 100644
--- a/bird-gdb.py
+++ b/bird-gdb.py
@@ -396,17 +396,11 @@ class BIRDPoolResource(BIRDResource):
self.items = []
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):
if self.items is None:
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:
# sum += i.memsize()
@@ -419,7 +413,7 @@ class BIRDPoolResource(BIRDResource):
# for i in self.items:
# 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 = {
"mbl_memsize": BIRDMBResource,