You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2020/05/29 07:58:24 UTC
Re: svn commit: r1878247 - /httpd/httpd/trunk/.gdbinit
On 5/28/20 9:54 PM, ylavic@apache.org wrote:
> Author: ylavic
> Date: Thu May 28 19:54:02 2020
> New Revision: 1878247
>
> URL: http://svn.apache.org/viewvc?rev=1878247&view=rev
> Log:
> .gdbinit: dump pool (pre_)cleanups [skip ci]
>
> Modified:
> httpd/httpd/trunk/.gdbinit
Really nice one.
>
> Modified: httpd/httpd/trunk/.gdbinit
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/.gdbinit?rev=1878247&r1=1878246&r2=1878247&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/.gdbinit (original)
> +++ httpd/httpd/trunk/.gdbinit Thu May 28 19:54:02 2020
> @@ -530,16 +530,29 @@ class DumpPoolAndChilds (gdb.Command):
> tag = darg['tag'].string()
> else:
> tag = "No tag"
> - print("Pool '%s' [%s]: %d/%d free (%d blocks) allocator: %s free blocks in allocator: %i kiB" % (tag, arg, free, size, nodes, darg['allocator'], self._allocator_free_blocks(darg['allocator'])))
> + 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'])))
> self.free = self.free + free
> self.size = self.size + size
> self.nodes = self.nodes + nodes
> + c_num = 0
> + c = darg['pre_cleanups']
> + while c:
> + c_num = c_num + 1
> + dc = c.dereference()
> + print("%s pre_cleanup #%.2i: data = %s, plain_cleanup_fn = %s, child_cleanup_fn = %s" % (indent, c_num, dc['data'], dc['plain_cleanup_fn'].dereference(), dc['plain_cleanup_fn'].dereference()))
> + c = dc['next']
> + c = darg['cleanups']
Wouldn't it make sense to do a c_num = 0 here again?
> + while c:
> + c_num = c_num + 1
> + 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['plain_cleanup_fn'].dereference()))
> + c = dc['next']
>
> def _dump(self, arg, depth):
> pool = arg
> + indent = "%*c" % (depth * 4 + 1, " ")
> while pool:
> - print("%*c" % (depth * 4 + 1, " "), end="")
> - self._dump_one_pool(pool)
> + self._dump_one_pool(pool, indent)
> if pool['child'] != 0:
> self._dump(pool['child'], depth + 1)
> pool = pool['sibling']
>
>
Regards
Rüdiger
AW: svn commit: r1878247 - /httpd/httpd/trunk/.gdbinit
Posted by "Pluem, Ruediger, Vodafone Group" <ru...@vodafone.com>.
C2 General
> -----Ursprüngliche Nachricht-----
> Von: Yann Ylavic <yl...@gmail.com>
> Gesendet: Freitag, 29. Mai 2020 10:42
> An: httpd-dev <de...@httpd.apache.org>
> Betreff: Re: svn commit: r1878247 - /httpd/httpd/trunk/.gdbinit
>
> CYBER SECURITY WARNING: This email is from an external source - be
> careful of attachments and links. Please follow the Cyber Code and
> report suspicious emails.
>
> On Fri, May 29, 2020 at 9:58 AM Ruediger Pluem <rp...@apache.org>
> wrote:
> >
> > On 5/28/20 9:54 PM, ylavic@apache.org wrote:
> > > Author: ylavic
> > > Date: Thu May 28 19:54:02 2020
> > > New Revision: 1878247
> > >
> > > URL: http://svn.apache.org/viewvc?rev=1878247&view=rev
> > > Log:
> > > .gdbinit: dump pool (pre_)cleanups [skip ci]
> > >
> > > Modified:
> > > httpd/httpd/trunk/.gdbinit
> >
> > Really nice one.
>
> Thanks!
>
> >
> > >
> > > Modified: httpd/httpd/trunk/.gdbinit
> > > URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/.gdbinit?rev=1878247&r1=1
> 878246&r2=1878247&view=diff
> > >
> ========================================================================
> ======
> > > --- httpd/httpd/trunk/.gdbinit (original)
> > > +++ httpd/httpd/trunk/.gdbinit Thu May 28 19:54:02 2020
> >
> > > + c_num = 0
> > > + c = darg['pre_cleanups']
> > > + while c:
> > > + c_num = c_num + 1
> > > + dc = c.dereference()
> > > + print("%s pre_cleanup #%.2i: data = %s, plain_cleanup_fn =
> %s, child_cleanup_fn = %s" % (indent, c_num, dc['data'],
> dc['plain_cleanup_fn'].dereference(),
> dc['plain_cleanup_fn'].dereference()))
> > > + c = dc['next']
> > > + c = darg['cleanups']
> >
> > Wouldn't it make sense to do a c_num = 0 here again?
>
> I thought it could be easier, for debugging, to talk about some pool's
> cleanup number N with no ambiguity wrt pre or post cleanup.
> Not a strong opinion..
Fair enough. This is a valid point I haven't thought of.
Regards
Rüdiger
Re: svn commit: r1878247 - /httpd/httpd/trunk/.gdbinit
Posted by Yann Ylavic <yl...@gmail.com>.
On Fri, May 29, 2020 at 9:58 AM Ruediger Pluem <rp...@apache.org> wrote:
>
> On 5/28/20 9:54 PM, ylavic@apache.org wrote:
> > Author: ylavic
> > Date: Thu May 28 19:54:02 2020
> > New Revision: 1878247
> >
> > URL: http://svn.apache.org/viewvc?rev=1878247&view=rev
> > Log:
> > .gdbinit: dump pool (pre_)cleanups [skip ci]
> >
> > Modified:
> > httpd/httpd/trunk/.gdbinit
>
> Really nice one.
Thanks!
>
> >
> > Modified: httpd/httpd/trunk/.gdbinit
> > URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/.gdbinit?rev=1878247&r1=1878246&r2=1878247&view=diff
> > ==============================================================================
> > --- httpd/httpd/trunk/.gdbinit (original)
> > +++ httpd/httpd/trunk/.gdbinit Thu May 28 19:54:02 2020
>
> > + c_num = 0
> > + c = darg['pre_cleanups']
> > + while c:
> > + c_num = c_num + 1
> > + dc = c.dereference()
> > + print("%s pre_cleanup #%.2i: data = %s, plain_cleanup_fn = %s, child_cleanup_fn = %s" % (indent, c_num, dc['data'], dc['plain_cleanup_fn'].dereference(), dc['plain_cleanup_fn'].dereference()))
> > + c = dc['next']
> > + c = darg['cleanups']
>
> Wouldn't it make sense to do a c_num = 0 here again?
I thought it could be easier, for debugging, to talk about some pool's
cleanup number N with no ambiguity wrt pre or post cleanup.
Not a strong opinion..
Regards;
Yann.