mirror of
https://github.com/apache/httpd.git
synced 2025-08-16 17:04:42 +00:00
.gdbinit: better dump_pool_and_children indentation [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1878262 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
23
.gdbinit
23
.gdbinit
@ -510,10 +510,11 @@ class DumpPoolAndChilds (gdb.Command):
|
|||||||
return kb
|
return kb
|
||||||
|
|
||||||
|
|
||||||
def _dump_one_pool(self, arg, indent):
|
def _dump_one_pool(self, arg, depth):
|
||||||
size = 0
|
size = 0
|
||||||
free = 0
|
free = 0
|
||||||
nodes = 0
|
nodes = 0
|
||||||
|
indent = depth * 4 + 1
|
||||||
darg = arg.dereference()
|
darg = arg.dereference()
|
||||||
active = darg['active']
|
active = darg['active']
|
||||||
node = active
|
node = active
|
||||||
@ -530,29 +531,39 @@ class DumpPoolAndChilds (gdb.Command):
|
|||||||
tag = darg['tag'].string()
|
tag = darg['tag'].string()
|
||||||
else:
|
else:
|
||||||
tag = "No tag"
|
tag = "No tag"
|
||||||
print("%sPool '%s' [%s]: %d/%d free (%d blocks) allocator: %s free blocks in allocator: %i kiB" % (indent, tag, arg, free, size, nodes, darg['allocator'], self._allocator_free_blocks(darg['allocator'])))
|
print("%*cPool '%s' [%s]: %d/%d free (%d blocks) allocator: %s free blocks in allocator: %i kiB" % \
|
||||||
|
(indent, ' ', tag, arg, free, size, nodes, darg['allocator'], \
|
||||||
|
self._allocator_free_blocks(darg['allocator'])))
|
||||||
self.free = self.free + free
|
self.free = self.free + free
|
||||||
self.size = self.size + size
|
self.size = self.size + size
|
||||||
self.nodes = self.nodes + nodes
|
self.nodes = self.nodes + nodes
|
||||||
c_num = 0
|
c_num = 0
|
||||||
c = darg['pre_cleanups']
|
c = darg['pre_cleanups']
|
||||||
|
if c:
|
||||||
|
print("%*cCleanups (pre):" % (indent + 1, ' '))
|
||||||
while c:
|
while c:
|
||||||
c_num = c_num + 1
|
c_num = c_num + 1
|
||||||
dc = c.dereference()
|
dc = c.dereference()
|
||||||
print("%s pre_cleanup #%.2i: data = %s, plain_cleanup_fn = %s" % (indent, c_num, dc['data'], dc['plain_cleanup_fn'].dereference()))
|
print("%*c%.3i: data = %s, plain_cleanup = %s" % \
|
||||||
|
(indent + 2, ' ', c_num, \
|
||||||
|
dc['data'], dc['plain_cleanup_fn'].dereference()))
|
||||||
c = dc['next']
|
c = dc['next']
|
||||||
c = darg['cleanups']
|
c = darg['cleanups']
|
||||||
|
if c:
|
||||||
|
print("%*cCleanups (post):" % (indent + 1, ' '))
|
||||||
while c:
|
while c:
|
||||||
c_num = c_num + 1
|
c_num = c_num + 1
|
||||||
dc = c.dereference()
|
dc = c.dereference()
|
||||||
print("%s pst_cleanup #%.2i: data = %s, plain_cleanup_fn = %s, child_cleanup_fn = %s" % (indent, c_num, dc['data'], dc['plain_cleanup_fn'].dereference(), dc['child_cleanup_fn'].dereference()))
|
print("%*c%.3i: data = %s, plain_cleanup = %s, child_cleanup = %s" % \
|
||||||
|
(indent + 2, ' ', c_num, \
|
||||||
|
dc['data'], dc['plain_cleanup_fn'].dereference(), \
|
||||||
|
dc['child_cleanup_fn'].dereference()))
|
||||||
c = dc['next']
|
c = dc['next']
|
||||||
|
|
||||||
def _dump(self, arg, depth):
|
def _dump(self, arg, depth):
|
||||||
pool = arg
|
pool = arg
|
||||||
indent = "%*c" % (depth * 4 + 1, " ")
|
|
||||||
while pool:
|
while pool:
|
||||||
self._dump_one_pool(pool, indent)
|
self._dump_one_pool(pool, depth)
|
||||||
if pool['child'] != 0:
|
if pool['child'] != 0:
|
||||||
self._dump(pool['child'], depth + 1)
|
self._dump(pool['child'], depth + 1)
|
||||||
pool = pool['sibling']
|
pool = pool['sibling']
|
||||||
|
Reference in New Issue
Block a user