httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: [PATCH] debugging aids for threaded.c
Date Thu, 09 Aug 2001 16:00:58 GMT
Ian Holsman <ianh@cnet.com> writes:

> On 09 Aug 2001 08:37:23 -0400, Jeff Trawick wrote:
> > It is frustrating to try to guess what worker threads are doing at a
> > given instance.  You can get a bit of info out of the ps output (at
> > least on some platforms) but I'm generally left making a lot of
> > assumptions (and am often wrong :) ), so I wrote some code to tell me
> > exactly what the worker threads are doing.
> > 
> 
> my 2c
> 
> would it be worthwile adding these extra states to the scoreboard?
> and then you could use something like mod-status to see what is going on
> (maybe have a newcommand to enable them like ExtendedStatus does)

Well, I'd be happy for there to be extra states iff MPM_DEBUG is
defined.  I think it is fair to put code like that in the core
distribution now.

  scoreboard.h
    define a worker-state enum iff MPM_DEBUG
    worker_score as worker-state field iff MPM_DEBUG
    define a set-worker-state macro to something interesting iff
    MPM_DEBUG else define it to a noop

  threaded.c, prefork.c, worker.c
    put invocations of the set-worker-state macro at critical points

  mod_status.c
    put the state in extended status output iff MPM_DEBUG

> I'd like to see this patch as a seperate module. so if I include it then
> a new process will be spawned an I can get status like info out of it.

I would too!!, but it would be nice to see people try to use the patch
pretty much as-is and give feedback before investing much time in it.
Long-term the core distribution needs to be modified as described
above.  Without that, it is a waste of time spending the time to
implement a module.

I just learned the SIGSTOP trick and wrote the debug process code
yesterday; it is unclear now if/how my own uses will  evolve the
code.

> BTW there is a hook (get_mgmt_items) which each of the MPM's could
> implement to dump MPM specific info to mod-status

didn't know that... cool...  I don't see any example uses of it.  I
guess mod_status would need to be modified too.

Thanks for the feedback!
-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message