You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Perrin Harkins <pe...@elem.com> on 2003/04/22 20:07:39 UTC

Re: Apache::DProf with Apache 2.0

Mike Zelina wrote:
> Has anyone had any luck running DProf with mod_perl 1.99 and
> Apache 2.0 on Win32?

Apache::Dprof has not been ported for mod_perl 2 yet.  You could try 
using the regular Devel::Dprof module instead, by setting PERL5OPT as 
described here:
http://perl.apache.org/docs/1.0/guide/performance.html#Code_Profiling_Techniques

- Perrin


RE: Apache::DProf with Apache 2.0

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,

On Wed, 23 Apr 2003, Mike Zelina wrote:

> 5.8...  using the distribution from:
> 
> http://theoryx5.uwinnipeg.ca/pub/other/Perl-5.8-win32-bin.exe

You're using *Windoze* ??

73,
Ged.


RE: Apache::DProf with Apache 2.0

Posted by Mike Zelina <mi...@zdginc.com>.
5.8...  using the distribution from:

http://theoryx5.uwinnipeg.ca/pub/other/Perl-5.8-win32-bin.exe

Mike


> -----Original Message-----
> From: Ged Haywood [mailto:ged@www2.jubileegroup.co.uk]
> Sent: Wednesday, April 23, 2003 12:59 PM
> To: Mike Zelina
> Cc: Perrin Harkins; modperl@perl.apache.org
> Subject: RE: Apache::DProf with Apache 2.0
> 
> 
> Hi there,
> 
> On Wed, 23 Apr 2003, Mike Zelina wrote:
> 
> > it still crashes
> 
> What version of Perl are you using?
> 
> 73,
> Ged.
> 

RE: Apache::DProf with Apache 2.0

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,

On Wed, 23 Apr 2003, Mike Zelina wrote:

> it still crashes

What version of Perl are you using?

73,
Ged.


RE: Apache::DProf with Apache 2.0

Posted by Mike Zelina <mi...@zdginc.com>.
> 
> Apache::Dprof has not been ported for mod_perl 2 yet.  You could try 
> using the regular Devel::Dprof module instead, by setting PERL5OPT as 
> described here:
> http://perl.apache.org/docs/1.0/guide/performance.html#Code_Profiling_Techniques
> 

Thanks for the tip.  I tried that out and it still crashes in the same
spot.  Here's the Disassembly code if anyone wants to take a peek.  It
crashes at the last line:

475:          fprintf(fp, "#fOrTyTwO\n" );
010C241C   push        offset profstack_max+2BCh (010c66d4)
010C2421   mov         eax,[fp (010c69f8)]
010C2426   push        eax
010C2427   call        dword ptr [__imp__fprintf (010c721c)]
010C242D   add         esp,8

Here's the fp pointer dump:

-	fp	0x007a0a50
-	_ptr	0x007b7764 "Uii"
		-36 'U'
	_cnt	0
-	_base	0x00000000 ""
		CXX0030: Error: expression cannot be evaluated
	_flag	0
	_file	0
	_charbuf	0
	_bufsiz	0
-	_tmpfname	0x00000000 ""
		CXX0030: Error: expression cannot be evaluated

Should I take a stab at debugging Apache::DProf for 2.0?  Or is
that gonna be a huge can of worms that only someone who dreams in
XS can handle??

> -----Original Message-----
> From: Perrin Harkins [mailto:perrin@elem.com]
> Sent: Tuesday, April 22, 2003 11:08 AM
> To: Mike Zelina
> Cc: modperl@perl.apache.org
> Subject: Re: Apache::DProf with Apache 2.0
> 
> 
> Mike Zelina wrote:
> > Has anyone had any luck running DProf with mod_perl 1.99 and
> > Apache 2.0 on Win32?
> 
> Apache::Dprof has not been ported for mod_perl 2 yet.  You could try 
> using the regular Devel::Dprof module instead, by setting PERL5OPT as 
> described here:
> http://perl.apache.org/docs/1.0/guide/performance.html#Code_Profiling_Techniques
> 
> - Perrin
> 

RE: Apache::DProf with Apache 2.0 - some progress

Posted by Mike Zelina <mi...@zdginc.com>.
> Devel::DProf creates an END block that writes the actual content to that
> file.  Are END blocks working for you in general?
- I added some printf's in the END block to

>> I'm wondering if it's because I can't run Apache with -X on windows.
> Are you sure?  I thought that was an apache 1.x thing.
- Yep.  You are right.  Even though it's not listed as a valid
option, it does start Apache in single user mode on Win32 also...

Here's what I am now getting in the output file.  According to my
poor-mans-debugger printfs, I make it past the code where it should
be printing out the records.  My guess is that the "I/O operation"
warning below is the root of my problems.  I dug around for AcceptEx issues
but couldn't find anything related.  Ring any bells?

[notice] Child 1096: Exit event signaled. Child process is ending.
[warn] (720995)The I/O operation has been aborted because of either a thread exit or an application request.  :
winnt_accept: Asynchronous AcceptEx failed.
[notice] Child 1096: Released the start mutex
[notice] Child 1096: Waiting for 5 worker threads to exit.
[notice] Child 1096: All worker threads have exited.
[notice] Child 1096: Child process is exiting

Thanks for all the help!  Hopefully, I can figure this out and contribute
back a version of DProf for 2.0...

Mike

> -----Original Message-----
> From: Perrin Harkins [mailto:perrin@elem.com]
> Sent: Wednesday, April 23, 2003 7:26 PM
> To: Mike Zelina
> Cc: modperl@perl.apache.org
> Subject: RE: Apache::DProf with Apache 2.0 - some progress
>
>
> On Wed, 2003-04-23 at 22:06, Mike Zelina wrote:
> > from the command line, it also crashed.  So, I got brave and modified
> > the .xs code to use the new PerlIO stuff instead of fprintf for file
> > access.  Voila!  The command line now works like a champ...  However,
> > the PerlModule include still isn't working.  No more crashing... and
> > it actually creates the tmon.out with the initial header.
> > However, it never dumps any profiling info beyond the header.
>
> Devel::DProf creates an END block that writes the actual content to that
> file.  Are END blocks working for you in general?
>
> Also, you may want to get the latest source from CVS.
>
> > I'm wondering if it's because I can't run Apache with -X on windows.
>
> Are you sure?  I thought that was an apache 1.x thing.
>
> I expect strange things will happen if DProf starts profiling in
> multiple interpreters and then they all try to dump their results to
> that one file.  Maybe you could just limit it to a single thread by
> changing the conf file?
>
> - Perrin
>


RE: Apache::DProf with Apache 2.0 - some progress

Posted by Perrin Harkins <pe...@elem.com>.
On Wed, 2003-04-23 at 22:06, Mike Zelina wrote:
> from the command line, it also crashed.  So, I got brave and modified
> the .xs code to use the new PerlIO stuff instead of fprintf for file
> access.  Voila!  The command line now works like a champ...  However,
> the PerlModule include still isn't working.  No more crashing... and
> it actually creates the tmon.out with the initial header.
> However, it never dumps any profiling info beyond the header.

Devel::DProf creates an END block that writes the actual content to that
file.  Are END blocks working for you in general?

Also, you may want to get the latest source from CVS.

> I'm wondering if it's because I can't run Apache with -X on windows.

Are you sure?  I thought that was an apache 1.x thing.

I expect strange things will happen if DProf starts profiling in
multiple interpreters and then they all try to dump their results to
that one file.  Maybe you could just limit it to a single thread by
changing the conf file?

- Perrin


Re: Apache::DProf with Apache 2.0 - some progress

Posted by Stas Bekman <st...@stason.org>.
Mike Zelina wrote:
> Synopsis:
> - Perl v5.8.0 / Mod_perl 1.99 / Apache 2.0.43
> - Trying to get Apache::DProf to work by including:
> 
> PerlModule Apache::DProf
> 
>   in my httpd.conf.
> 
> Suggestions so far:
> - Use PERL5OPT on the command line instead.
> 
> Using PERL5OPT had the same crashing problems.  In addition, if I
> tried to run:
> 
> perl -d:DProf [script]

Also notice that mp2 has a new directive, PerlSwitches:
http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlSwitches_
which can be used to pass arguments just like you do at the command line.

> from the command line, it also crashed.  So, I got brave and modified
> the .xs code to use the new PerlIO stuff instead of fprintf for file
> access.  Voila!  The command line now works like a champ...  However,
> the PerlModule include still isn't working.  No more crashing... and
> it actually creates the tmon.out with the initial header.
> However, it never dumps any profiling info beyond the header.
> 
> I'm wondering if it's because I can't run Apache with -X on windows.
> Has anyone gotten DProf working on any version of Apache/mod_perl in
> Windows?
> 
> Is this discussion more appropriate for the development list??

It's fine here, I guess. I don't use winFU so I can't be much of help. Neither 
I have tried Apache::DProf with 2.0 yet. However I'll soon release 
Apache::Peek (once 1.99_09 is released), which uses perlio and non-perlio 
solutions, I can send it to you if you think it'll help. Remember that perlio 
is not always available.

And thanks for the porting efforts!

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


RE: Apache::DProf with Apache 2.0 - some progress

Posted by Mike Zelina <mi...@zdginc.com>.
Synopsis:
- Perl v5.8.0 / Mod_perl 1.99 / Apache 2.0.43
- Trying to get Apache::DProf to work by including:

PerlModule Apache::DProf

  in my httpd.conf.

Suggestions so far:
- Use PERL5OPT on the command line instead.

Using PERL5OPT had the same crashing problems.  In addition, if I
tried to run:

perl -d:DProf [script]

from the command line, it also crashed.  So, I got brave and modified
the .xs code to use the new PerlIO stuff instead of fprintf for file
access.  Voila!  The command line now works like a champ...  However,
the PerlModule include still isn't working.  No more crashing... and
it actually creates the tmon.out with the initial header.
However, it never dumps any profiling info beyond the header.

I'm wondering if it's because I can't run Apache with -X on windows.
Has anyone gotten DProf working on any version of Apache/mod_perl in
Windows?

Is this discussion more appropriate for the development list??

Thanks,
Mike

> -----Original Message-----
> From: Perrin Harkins [mailto:perrin@elem.com]
> Sent: Tuesday, April 22, 2003 11:08 AM
> To: Mike Zelina
> Cc: modperl@perl.apache.org
> Subject: Re: Apache::DProf with Apache 2.0
> 
> 
> Mike Zelina wrote:
> > Has anyone had any luck running DProf with mod_perl 1.99 and
> > Apache 2.0 on Win32?
> 
> Apache::Dprof has not been ported for mod_perl 2 yet.  You could try 
> using the regular Devel::Dprof module instead, by setting PERL5OPT as 
> described here:
> http://perl.apache.org/docs/1.0/guide/performance.html#Code_Profiling_Techniques
> 
> - Perrin
>