You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2001/07/14 00:55:13 UTC

Re: env MOD_PERL_TRACE doesn't take an effect and other trace issues

On Sat, 30 Jun 2001, Stas Bekman wrote:

> modperl_trace_level_set gets called from modperl_cmd.c only if you have
> PerlTrace in httpd.conf. Of course this case ignores the env var, but
> there is no other place in the code that calls this func to check for the
> env setting of MOD_PERL_TRACE.

right, because we have PerlTrace now.  not that we can't support
MOD_PERL_TRACE too.
 
> On the related note the following would be very useful when debugging
> configuration sections and possibly from the code as well, if we provide a
> hook to change the trace level from code as well:
>   $s->trace_level('d');

that would be useful.  though at runtime with threaded mpm, it is not
threadsafe.  but we could make a per-request trace level that overrides
the per-server.
 
> Now what would be nice to have is to allow the negation of the level, so
> in httpd.conf one can do:
> 
>   PerlTrace d
>   PerlModule CGI
>   PerlTrace !d
> 
> Here I want to have a 'd' trace only for a section between two PerlTrace
> directives.

'PerlTrace !d' looks like it should remove 'd' tracing.  if you only want
'd', then use 'PerlTrace d'

> I think also that this can be improved as well: Currently
> 
>   PerlTrace d
> 
> followed by
> 
>   PerlTrace g
> 
> turns off 'd' and turns on 'g' instead of appending 'g'.

why not just use 'PerlTrace dg' then?

> To summarize I suggest to have:
> 
> PerlTrace [!]all | [!]d[!]f[!]g[!]h[!]i[!]m[!]s | off
> 
>   all turn all on
>   off turn all off
>   d   directive processing
>   f   filters
>   g   Perl runtime interaction
>   h   handlers
>   i   interpreter pool management
>   m   memory allocations
>   s   perl sections
> 
> !, before the letter, turns off the setting for this level, so one can
> have:
> 
>   PerlTrace dh       #level = dh
>   PerlTrace !dg!h    #level = g

i'm not seeing how this is useful, why wouldn't you just say 'PerlTrace g'? 
 
> well if we have !, we can also do: !all (instead of adding 'off' level).

why not just stick with 'off' ?

> (but if we have off would be nice to replace all with on (or alias) but I
> understand that it'll break the convention with normal Perl tracing)

an alias would be fine i guess.
 
> and of course being able to turn levels on and off via $server.

how about something similar to Perl's $^D?
then you can do:

local $ModPerl::Trace = 1|4; #dg

or

local $ModPerl::Trace &= ~4; #remove 'g'

or

local $ModPerl::Trace |= 4; #append 'g'

there could be constants for the numbers.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: env MOD_PERL_TRACE doesn't take an effect and other trace issues

Posted by Doug MacEachern <do...@covalent.net>.
On Mon, 16 Jul 2001, Stas Bekman wrote:
 
> you can end up with a long file with various PerlTrace settings. Instead
> of scrolling back and forth and remembering what bits very set before, why
> not just switching off the unwanted bits?

i guess this is what i'm having trouble seeing.  personally i never had
the need to set it more than once and would just set it based on what i
was debugging at that moment.  the volume of modperl trace info isn't that
high, unlike, say, perl -Dmx.  but if you really see the need, it should
be implemented using the existing modperl_options.c stuff, like:
PerlTrace +d -f

rather than a new !df syntax.  if you want to allow per-dir configuration,
MP_debug_level will need to live in tls (thread local storage) for
threaded mpms (see modperl_global.c)




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: env MOD_PERL_TRACE doesn't take an effect and other trace issues

Posted by Stas Bekman <st...@stason.org>.
On Fri, 13 Jul 2001, Doug MacEachern wrote:

> On Sat, 30 Jun 2001, Stas Bekman wrote:
>
> > modperl_trace_level_set gets called from modperl_cmd.c only if you have
> > PerlTrace in httpd.conf. Of course this case ignores the env var, but
> > there is no other place in the code that calls this func to check for the
> > env setting of MOD_PERL_TRACE.
>
> right, because we have PerlTrace now.  not that we can't support
> MOD_PERL_TRACE too.

ok

> > On the related note the following would be very useful when debugging
> > configuration sections and possibly from the code as well, if we provide a
> > hook to change the trace level from code as well:
> >   $s->trace_level('d');
>
> that would be useful.  though at runtime with threaded mpm, it is not
> threadsafe.  but we could make a per-request trace level that overrides
> the per-server.

cool!

> > Now what would be nice to have is to allow the negation of the level, so
> > in httpd.conf one can do:
> >
> >   PerlTrace d
> >   PerlModule CGI
> >   PerlTrace !d
> >
> > Here I want to have a 'd' trace only for a section between two PerlTrace
> > directives.
>
> 'PerlTrace !d' looks like it should remove 'd' tracing.

true.

> if you only want 'd', then use 'PerlTrace d'

see below

> > I think also that this can be improved as well: Currently
> >
> >   PerlTrace d
> >
> > followed by
> >
> >   PerlTrace g
> >
> > turns off 'd' and turns on 'g' instead of appending 'g'.
>
> why not just use 'PerlTrace dg' then?

you can end up with a long file with various PerlTrace settings. Instead
of scrolling back and forth and remembering what bits very set before, why
not just switching off the unwanted bits?

> > To summarize I suggest to have:
> >
> > PerlTrace [!]all | [!]d[!]f[!]g[!]h[!]i[!]m[!]s | off
> >
> >   all turn all on
> >   off turn all off
> >   d   directive processing
> >   f   filters
> >   g   Perl runtime interaction
> >   h   handlers
> >   i   interpreter pool management
> >   m   memory allocations
> >   s   perl sections
> >
> > !, before the letter, turns off the setting for this level, so one can
> > have:
> >
> >   PerlTrace dh       #level = dh
> >   PerlTrace !dg!h    #level = g
>
> i'm not seeing how this is useful, why wouldn't you just say 'PerlTrace g'?

see above

> > well if we have !, we can also do: !all (instead of adding 'off' level).
>
> why not just stick with 'off' ?

fine

> > (but if we have off would be nice to replace all with on (or alias) but I
> > understand that it'll break the convention with normal Perl tracing)
>
> an alias would be fine i guess.
>
> > and of course being able to turn levels on and off via $server.
>
> how about something similar to Perl's $^D?
> then you can do:
>
> local $ModPerl::Trace = 1|4; #dg
>
> or
>
> local $ModPerl::Trace &= ~4; #remove 'g'
>
> or
>
> local $ModPerl::Trace |= 4; #append 'g'
>
> there could be constants for the numbers.

sounds cool, but this is only for the Perl side. It should be parallel
with PerlTrace.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org