You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2017/10/09 12:16:00 UTC
svn commit: r1811557 - /httpd/httpd/branches/2.4.x/.gdbinit
Author: rpluem
Date: Mon Oct 9 12:16:00 2017
New Revision: 1811557
URL: http://svn.apache.org/viewvc?rev=1811557&view=rev
Log:
* The calculation of the sizes was flawed:
The index tells us the size of the node in 4096 byte pages minus 1.
Hence we need to multiply back with 4096 aka << 12 (plus adding the
missing page).
Modified:
httpd/httpd/branches/2.4.x/.gdbinit
Modified: httpd/httpd/branches/2.4.x/.gdbinit
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/.gdbinit?rev=1811557&r1=1811556&r2=1811557&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/.gdbinit (original)
+++ httpd/httpd/branches/2.4.x/.gdbinit Mon Oct 9 12:16:00 2017
@@ -374,8 +374,8 @@ define dump_allocator
if $node != 0
printf " #%2d: ", $i
while $node != 0
- printf "%d, ", 4096 << $node->index
- set $kb = $kb + (4 << $node->index)
+ printf "%d, ", ($node->index + 1) << 12
+ set $kb = $kb + (($node->index + 1) << 2)
set $node = $node->next
end
printf "ends.\n"
@@ -396,7 +396,7 @@ define dump_one_pool
set $node = $arg0->active
set $done = 0
while $done == 0
- set $size = $size + (4096 << $node->index)
+ set $size = $size + (($node->index + 1) << 12)
set $free = $free + ($node->endp - $node->first_avail)
set $nodes = $nodes + 1
set $node = $node->next
@@ -444,7 +444,7 @@ class DumpPoolAndChilds (gdb.Command):
if node != 0:
while node != 0:
noded = node.dereference()
- kb = kb + (4 << int(node['index']))
+ kb = kb + ((int(noded['index']) + 1) << 2)
node = noded['next']
i = i + 1
self.total_free_blocks[salloc] = kb
@@ -461,7 +461,7 @@ class DumpPoolAndChilds (gdb.Command):
done = 0
while done == 0:
noded = node.dereference()
- size = size + (4096 << noded['index'])
+ size = size + ((int(noded['index']) + 1) << 12)
free = free + (noded['endp'] - noded['first_avail'])
nodes = nodes + 1
node = noded['next']