From mitch at ncsa.uiuc.edu Fri Nov 7 15:33:50 2003 From: mitch at ncsa.uiuc.edu (Mitch Kutzko) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl Debugger and finding CPU Usage Message-ID: <3.0.5.32.20031107153350.03433788@pop.ncsa.uiuc.edu> Hi, folks -- I have a question about the Perl debugger, which I've essentially never actually used. How do I go about using it to find out where CPU usage is occurring? I've got a very large, very complex script that's soaking up *way* too much CPU (but not leaking memory -- already checked for that) for what it's doing, but I can't figure out where/how it's happening. Any ideas on how to get the debugger to show me where all the CPU is going? Mitch -- Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 http://hobbes.ncsa.uiuc.edu/ From brandon at ojctech.com Fri Nov 7 16:28:27 2003 From: brandon at ojctech.com (Brandon Bowersox) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl Debugger and finding CPU Usage Message-ID: <5.2.0.9.0.20031107162759.02ccbc20@localhost> Mitch, The Perl Profiler is the tool for you and it is distributed with Perl. See http://search.cpan.org/~nwclark/perl-5.8.2/ext/Devel/DProf/DProf.pm http://search.cpan.org/~nwclark/perl-5.8.2/utils/dprofpp.PL Basically, to create a profile file, run your code like: perl -d:DProf script.pl (on the command line) OR #!/usr/bin/perl -d:DProf (at the top of your script) Then the dprofpp command will give you a report. My favorite reports are: dprofpp tmon.out (the basic report including CPU time) dprofpp -S tmon.out (merged subroutine tree) Brandon -- Brandon Bowersox brandon@ojctech.com OJC Technologies, Inc. www.ojctech.com, 217-278-3933 At 03:33 PM 11/7/2003 -0600, Mitch Kutzko wrote: >Hi, folks -- I have a question about the Perl debugger, which I've >essentially never actually used. > >How do I go about using it to find out where CPU usage is occurring? I've >got a very large, very complex script that's soaking up *way* too much CPU >(but not leaking memory -- already checked for that) for what it's doing, >but I can't figure out where/how it's happening. > >Any ideas on how to get the debugger to show me where all the CPU is going? > >Mitch >-- >Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 >http://hobbes.ncsa.uiuc.edu/ >_______________________________________________ >Champaign-Urbana mailing list >Champaign-Urbana@mail.pm.org >http://mail.pm.org/mailman/listinfo/champaign-urbana From mitch at ncsa.uiuc.edu Fri Nov 7 16:44:52 2003 From: mitch at ncsa.uiuc.edu (Mitch Kutzko) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl Debugger and finding CPU Usage Message-ID: <3.0.5.32.20031107164452.035c5d60@pop.ncsa.uiuc.edu> Wow -- What quick, excellent responses! Thank you, all! Ok -- Have found and played with the profiler and gotten results. I was mildly concerned that it wouldn't work properly with this script, as it's actually one that doesn't have an ending -- It's designed to run open-endedly for literally months on end. Had problems with profiling via: $ perl -d:DProf beacon.pl and then trying to run the profiler via: $ /usr/bin/dprofpp -u That gave back: Garbled profile, unexpected exit time stamp at /usr/bin/dprofpp line 704, line 680. However, was able to run things just fine via: $ /usr/bin/dprofpp -u -p beacon.pl and got the output below back. Now, can anyone tell me if there's an obvious way to tell where wasted (idle? No obvious -sleep- traps in the code, but you never know...) CPU is going? I can see that I spend most of my time in Net::RTP::rtp_recv, but that's correct, since this is an RTP client, and spends almost all of its time talking to the other RTP clients -- It just shouldn't be soaking up 60-80% of my CPU doing it, that's all. This is literally the same library that underlies vic and rat, if anybody here has done any videoconferencing stuff... If you've used either of those, you know they can send and receive *LOTS* more data than this without even being particularly noticeable. Thanks again! Mitch ---------------------- Total Elapsed Time = 257.3488 Seconds User Time = 124.1104 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 82.4 102.2 118.95 5489 0.0186 0.0217 Net::RTP::rtp_recv 7.73 9.589 9.582 5318 0.0018 0.0018 Net::RTP::rtp_free_rtp_packet 3.55 4.401 17.075 49029 0.0001 0.0003 main::rtp_event_handler 2.60 3.228 3.514 131 0.0246 0.0268 Net::RTP::rtp_send_ctrl 1.80 2.229 2.309 5358 0.0004 0.0004 Net::RTP::rtp_update 0.39 0.480 1.548 5396 0.0001 0.0003 IO::Socket::new 0.31 0.390 0.331 39145 0.0000 0.0000 Net::RTP::rtp_get_rr 0.28 0.350 1.882 5396 0.0001 0.0003 IO::Socket::INET::new 0.27 0.330 0.256 49029 0.0000 0.0000 Net::RTP::rtp_event_type_get 0.26 0.320 0.320 6 0.0533 0.0533 main::output_data_as_web_page 0.25 0.310 0.302 5396 0.0001 0.0001 Symbol::gensym 0.23 0.290 2.156 5391 0.0001 0.0004 IO::Socket::accept 0.23 0.280 2.408 5318 0.0001 0.0005 main::receive_tcp_reports 0.21 0.260 0.563 5396 0.0000 0.0001 IO::Handle::autoflush 0.19 0.240 0.276 5396 0.0000 0.0001 SelectSaver::new -- Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 http://hobbes.ncsa.uiuc.edu/ From mitch at ncsa.uiuc.edu Fri Nov 7 19:44:46 2003 From: mitch at ncsa.uiuc.edu (Mitch Kutzko) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Re: Perl Debugger and finding CPU Usage Message-ID: <3.0.5.32.20031107194446.00fb8b38@pop.ncsa.uiuc.edu> Hi again -- Ok, here's output collected for a bit more than 36 minutes, using the -r and -I options. Does anything here leap right out and grab anybody as particularly meaningful? It appears this is just telling me where the script spends its time, and not so much about how much CPU is being used in various places. I *know* where it spends its time -- I just don't know why it's using so much CPU. Thoughts? Mitch -------------------------------- Total Elapsed Time = 2202.757 Seconds User Time = 2202.757 Seconds Inclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 63.4 0.510 1398.5 1 0.5100 1398.5 main::rxtx_loop 60.7 1171. 1337.9 44955 0.0261 0.0298 Net::RTP::rtp_recv 7.63 41.93 168.06 445634 0.0001 0.0004 main::rtp_event_handler 4.08 89.96 89.960 44105 0.0020 0.0020 Net::RTP::rtp_free_rtp_packet 1.66 35.30 36.500 770 0.0458 0.0474 Net::RTP::rtp_send_ctrl 1.00 3.750 21.950 44105 0.0001 0.0005 main::receive_tcp_reports 0.90 19.53 19.830 44185 0.0004 0.0004 Net::RTP::rtp_update 0.81 2.200 17.770 44719 0.0000 0.0004 IO::Socket::accept 0.71 2.870 15.610 44734 0.0001 0.0003 IO::Socket::INET::new 0.58 3.330 12.740 44734 0.0001 0.0003 IO::Socket::new 0.23 1.910 5.060 44734 0.0000 0.0001 IO::Handle::autoflush 0.17 1.300 3.670 44734 0.0000 0.0001 IO::Handle::new 0.16 3.420 3.420 445634 0.0000 0.0000 Net::RTP::rtp_event_type_get 0.13 2.860 2.860 363428 0.0000 0.0000 Net::RTP::rtp_get_rr 0.12 2.340 2.660 44734 0.0001 0.0001 SelectSaver::new -- Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 http://hobbes.ncsa.uiuc.edu/ From bhalla at uiuc.edu Fri Nov 7 21:35:43 2003 From: bhalla at uiuc.edu (Arun Bhalla) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Re: Perl Debugger and finding CPU Usage In-Reply-To: <3.0.5.32.20031107194446.00fb8b38@pop.ncsa.uiuc.edu> Message-ID: <200311080335.hA83Zh15003385@a-night-at-the-opera.cu.groogroo.com> Well, I think now it's time to look at the code. I've never seen Net::RTP before. It looks like rtp_recv is either inefficient or is being used incorrectly. Perhap you can look through the Net::RTP code and figure out what's going on. You could use a line-level profiler like Devel::SmallProf to see which lines are getting called the most or take the longest. This may or may not help you. One major note is that SmallProf will slow down the execution of your program, so you can expect the runtime to be much longer than usual. Arun Mitch Kutzko writes: > Hi again -- Ok, here's output collected for a bit more than 36 minutes, > using the -r and -I options. > > Does anything here leap right out and grab anybody as particularly > meaningful? It appears this is just telling me where the script spends its > time, and not so much about how much CPU is being used in various places. > I *know* where it spends its time -- I just don't know why it's using so > much CPU. > > Thoughts? > > Mitch > > > -------------------------------- > > Total Elapsed Time = 2202.757 Seconds > User Time = 2202.757 Seconds > Inclusive Times > %Time ExclSec CumulS #Calls sec/call Csec/c Name > 63.4 0.510 1398.5 1 0.5100 1398.5 main::rxtx_loop > 60.7 1171. 1337.9 44955 0.0261 0.0298 Net::RTP::rtp_recv > 7.63 41.93 168.06 445634 0.0001 0.0004 main::rtp_event_handler > 4.08 89.96 89.960 44105 0.0020 0.0020 Net::RTP::rtp_free_rtp_packet > 1.66 35.30 36.500 770 0.0458 0.0474 Net::RTP::rtp_send_ctrl > 1.00 3.750 21.950 44105 0.0001 0.0005 main::receive_tcp_reports > 0.90 19.53 19.830 44185 0.0004 0.0004 Net::RTP::rtp_update > 0.81 2.200 17.770 44719 0.0000 0.0004 IO::Socket::accept > 0.71 2.870 15.610 44734 0.0001 0.0003 IO::Socket::INET::new > 0.58 3.330 12.740 44734 0.0001 0.0003 IO::Socket::new > 0.23 1.910 5.060 44734 0.0000 0.0001 IO::Handle::autoflush > 0.17 1.300 3.670 44734 0.0000 0.0001 IO::Handle::new > 0.16 3.420 3.420 445634 0.0000 0.0000 Net::RTP::rtp_event_type_get > 0.13 2.860 2.860 363428 0.0000 0.0000 Net::RTP::rtp_get_rr > 0.12 2.340 2.660 44734 0.0001 0.0001 SelectSaver::new > > -- > Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 > http://hobbes.ncsa.uiuc.edu/ > _______________________________________________ > Champaign-Urbana mailing list > Champaign-Urbana@mail.pm.org > http://mail.pm.org/mailman/listinfo/champaign-urbana > -- Arun Bhalla From mitch at ncsa.uiuc.edu Fri Nov 7 22:24:30 2003 From: mitch at ncsa.uiuc.edu (Mitch Kutzko) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Re: Perl Debugger and finding CPU Usage In-Reply-To: <200311080335.hA83Zh15003385@a-night-at-the-opera.cu.groogr oo.com> References: <3.0.5.32.20031107194446.00fb8b38@pop.ncsa.uiuc.edu> Message-ID: <3.0.5.32.20031107222430.00fb8b38@pop.ncsa.uiuc.edu> At 09:35 PM 11/7/2003 -0600, Arun Bhalla wrote: > Well, I think now it's time to look at the code. I've never seen Net::RTP > before. It looks like rtp_recv is either inefficient or is being > used incorrectly. Perhap you can look through the Net::RTP code and > figure out what's going on. Hi, Arun.... The Net::RTP code is the RAT (Robust Audio Tool) rtp.c common library (v1.2.14) run through SWIG to make it available to Perl. It should be pretty solid, since it's recent, and it's been pounded on a bunch for a long time by lots of folks. However, I'm wondering about my call to it. I had trouble with the socket stuff earlier on, where I wasn't getting all the data from the connection -- This seemed to clear it up, but now I wonder if it's not hanging up somewhere. Does this look clean to you? # Continue to loop until rtp_recv returns FALSE -- Read # *all* the data, not just one packet's worth. # Args: What are we listening to, how long can we block, and when did we get it? while (rtp_recv($session, $timeout, $rtp_ts)) { rtp_update($session); } Thanks again! Mitch -- Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 http://hobbes.ncsa.uiuc.edu/ From bhalla at uiuc.edu Fri Nov 7 23:15:57 2003 From: bhalla at uiuc.edu (Arun Bhalla) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Re: Perl Debugger and finding CPU Usage In-Reply-To: <3.0.5.32.20031107222430.00fb8b38@pop.ncsa.uiuc.edu> Message-ID: <200311080515.hA85Fv15004197@a-night-at-the-opera.cu.groogroo.com> Mitch Kutzko writes: > At 09:35 PM 11/7/2003 -0600, Arun Bhalla wrote: > > Well, I think now it's time to look at the code. I've never seen Net::RTP > > before. It looks like rtp_recv is either inefficient or is being > > used incorrectly. Perhap you can look through the Net::RTP code and > > figure out what's going on. > > Hi, Arun.... > > The Net::RTP code is the RAT (Robust Audio Tool) rtp.c common library > (v1.2.14) run through SWIG to make it available to Perl. It should be > pretty solid, since it's recent, and it's been pounded on a bunch for a > long time by lots of folks. > > However, I'm wondering about my call to it. I had trouble with the socket > stuff earlier on, where I wasn't getting all the data from the connection > -- This seemed to clear it up, but now I wonder if it's not hanging up > somewhere. Does this look clean to you? > > > > # Continue to loop until rtp_recv returns FALSE -- Read > # *all* the data, not just one packet's worth. > # Args: What are we listening to, how long can we block, and when did we > get it? > while (rtp_recv($session, $timeout, $rtp_ts)) { > rtp_update($session); > } Given that information ;-), my best guess is that the timeout may be too short, causing for rtp_recv to be called too frequently. However, it would appear that rtp_recv is never timing out -- I would assume that rtp_recv would return false on timeout, and thus the while loop would end. Also, I imagine that your client has certain constraints on proper timeouts. Still, I suppose it's worth a shot trying to change the timeout, seeing if it improves performance and doesn't break your code. Otherwise maybe you need to check other aspects, such as how your socket/session are initialized and seeing which parameters are set and which are not. Arun From lewart at uiuc.edu Mon Nov 10 12:33:59 2003 From: lewart at uiuc.edu (Daniel S. Lewart) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Meeting Tue Nov 11 19:00 @ Manzella's in Champaign Message-ID: <20031110123358.B20140@staff1.cso.uiuc.edu> Champaign-Urbana Perl Mongers, Our next meeting shall be: * Tue Nov 11 19:00-21:00 * Manzella's Italian Patio * 115 S First St / Champaign Hey, that's tomorrow night! I'm happy to see the mailing list being used for something besides these announcements! :) We'll be in the non-smoking (NE) section of the restaurant again. I suppose we can celebrate the release of Perl 5.8.2: http://use.perl.org/articles/03/11/07/117238.shtml Cheers, Dan http://cmi.pm.org/ From sigfried at ojctech.com Fri Nov 7 15:53:20 2003 From: sigfried at ojctech.com (Sigfried Gold) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl Debugger and finding CPU Usage In-Reply-To: <3.0.5.32.20031107153350.03433788@pop.ncsa.uiuc.edu> References: <3.0.5.32.20031107153350.03433788@pop.ncsa.uiuc.edu> Message-ID: <20031107215320.GD1202@che.ojctech.com> i've done this. the perl profiler is pretty easy to use. from perldoc perldebug: The Perl Profiler If you wish to supply an alternative debugger for Perl to run, just invoke your script with a colon and a package argument given to the -d flag. The most popular alternative debuggers for Perl is the Perl profiler. Devel::DProf is now included with the standard Perl distribution. To profile your Perl program in the file mycode.pl, just type: $ perl -d:DProf mycode.pl When the script terminates the profiler will dump the profile information to a file called tmon.out. A tool like dprofpp, also supplied with the standard Perl distribution, can be used to interpret the information in that profile. * Mitch Kutzko : > Hi, folks -- I have a question about the Perl debugger, which I've > essentially never actually used. > > How do I go about using it to find out where CPU usage is occurring? I've > got a very large, very complex script that's soaking up *way* too much CPU > (but not leaking memory -- already checked for that) for what it's doing, > but I can't figure out where/how it's happening. > > Any ideas on how to get the debugger to show me where all the CPU is going? > > Mitch > -- > Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 > http://hobbes.ncsa.uiuc.edu/ > _______________________________________________ > Champaign-Urbana mailing list > Champaign-Urbana@mail.pm.org > http://mail.pm.org/mailman/listinfo/champaign-urbana -- Sigfried Gold Home: 212-568-3549 Cell: 718-781-6991 Work: 212-304-7210 http://www.sigfried.org mailto:sigfried@sigfried.org From brandon at ojctech.com Fri Nov 7 15:54:21 2003 From: brandon at ojctech.com (Brandon Bowersox) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl Debugger and finding CPU Usage In-Reply-To: <3.0.5.32.20031107153350.03433788@pop.ncsa.uiuc.edu> Message-ID: <5.2.0.9.0.20031107155024.02cd1dd8@localhost> Mitch, The Perl Profiler is the tool for you and it is distributed with Perl. See http://search.cpan.org/~nwclark/perl-5.8.2/ext/Devel/DProf/DProf.pm http://search.cpan.org/~nwclark/perl-5.8.2/utils/dprofpp.PL Basically, to create a profile file, run your code like: perl -d:DProf script.pl (on the command line) OR #!/usr/bin/perl -d:DProf (at the top of your script) Then the dprofpp command will give you a report. My favorite reports are: dprofpp tmon.out (the basic report including CPU time) dprofpp -S tmon.out (merged subroutine tree) Brandon -- Brandon Bowersox brandon@ojctech.com OJC Technologies, Inc. www.ojctech.com, 217-278-3933 At 03:33 PM 11/7/2003 -0600, Mitch Kutzko wrote: >Hi, folks -- I have a question about the Perl debugger, which I've >essentially never actually used. > >How do I go about using it to find out where CPU usage is occurring? I've >got a very large, very complex script that's soaking up *way* too much CPU >(but not leaking memory -- already checked for that) for what it's doing, >but I can't figure out where/how it's happening. > >Any ideas on how to get the debugger to show me where all the CPU is going? > >Mitch >-- >Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 >http://hobbes.ncsa.uiuc.edu/ >_______________________________________________ >Champaign-Urbana mailing list >Champaign-Urbana@mail.pm.org >http://mail.pm.org/mailman/listinfo/champaign-urbana From ryddler at cu-online.com Tue Nov 11 10:19:19 2003 From: ryddler at cu-online.com (ryddler) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl Debugger and finding CPU Usage In-Reply-To: <5.2.0.9.0.20031107155024.02cd1dd8@localhost> References: <5.2.0.9.0.20031107155024.02cd1dd8@localhost> Message-ID: <1068567559.1252.7.camel@bprice2kl.atgf.com> With all this talk about the profiler, does anyone know how to invoke it in a CGI environment, say with mod_perl, and more to the point for me, from within Apache::ASP? On Fri, 2003-11-07 at 15:54, Brandon Bowersox wrote: > Mitch, > > The Perl Profiler is the tool for you and it is distributed with Perl. See > http://search.cpan.org/~nwclark/perl-5.8.2/ext/Devel/DProf/DProf.pm > http://search.cpan.org/~nwclark/perl-5.8.2/utils/dprofpp.PL > > Basically, to create a profile file, run your code like: > perl -d:DProf script.pl (on the command line) > OR > #!/usr/bin/perl -d:DProf (at the top of your script) > > Then the dprofpp command will give you a report. My favorite reports are: > dprofpp tmon.out (the basic report including CPU time) > dprofpp -S tmon.out (merged subroutine tree) > > Brandon > > -- > Brandon Bowersox > brandon@ojctech.com > OJC Technologies, Inc. > www.ojctech.com, 217-278-3933 > > > At 03:33 PM 11/7/2003 -0600, Mitch Kutzko wrote: > >Hi, folks -- I have a question about the Perl debugger, which I've > >essentially never actually used. > > > >How do I go about using it to find out where CPU usage is occurring? I've > >got a very large, very complex script that's soaking up *way* too much CPU > >(but not leaking memory -- already checked for that) for what it's doing, > >but I can't figure out where/how it's happening. > > > >Any ideas on how to get the debugger to show me where all the CPU is going? > > > >Mitch > >-- > >Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 > >http://hobbes.ncsa.uiuc.edu/ > >_______________________________________________ > >Champaign-Urbana mailing list > >Champaign-Urbana@mail.pm.org > >http://mail.pm.org/mailman/listinfo/champaign-urbana > > _______________________________________________ > Champaign-Urbana mailing list > Champaign-Urbana@mail.pm.org > http://mail.pm.org/mailman/listinfo/champaign-urbana -- Keep the turbo spooled! ryddler http://www.starquestclub.com From mitch at ncsa.uiuc.edu Tue Nov 11 11:00:44 2003 From: mitch at ncsa.uiuc.edu (Mitch Kutzko) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl installable for Win2K/XP? Message-ID: <3.0.5.32.20031111110044.037723e8@pop.ncsa.uiuc.edu> Hi, folks -- Another question for you.... I'm looking for a free version of Perl for Win2K/WinXP systems. Something recent, stable, and compatable with CPAN, preferably. What recommendations does anyone have? The last time I had to solve this problem, I got lucky and someone had a licensed copy of the MKS Utilities version of Perl, which is now *way* too old to be useful in this context. Thanks in advance! Mitch PS - Still working on that CPU usage problem -- I'll keep you posted when I figure it out. ;-) -- Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 http://hobbes.ncsa.uiuc.edu/ From bhalla at uiuc.edu Tue Nov 11 11:13:58 2003 From: bhalla at uiuc.edu (Arun Bhalla) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl Debugger and finding CPU Usage In-Reply-To: <1068567559.1252.7.camel@bprice2kl.atgf.com> Message-ID: <200311111713.hABHDw15030427@a-night-at-the-opera.cu.groogroo.com> I saw Apache::DProf and Apache::SmallProf listed on CPAN, and I can only guess that they are the mod_perl versions of the same. Worth checking out. Arun ryddler writes: > With all this talk about the profiler, does anyone know how to invoke it > in a CGI environment, say with mod_perl, and more to the point for me, > from within Apache::ASP? > > On Fri, 2003-11-07 at 15:54, Brandon Bowersox wrote: > > Mitch, > > > > The Perl Profiler is the tool for you and it is distributed with Perl. See > > http://search.cpan.org/~nwclark/perl-5.8.2/ext/Devel/DProf/DProf.pm > > http://search.cpan.org/~nwclark/perl-5.8.2/utils/dprofpp.PL > > > > Basically, to create a profile file, run your code like: > > perl -d:DProf script.pl (on the command line) > > OR > > #!/usr/bin/perl -d:DProf (at the top of your script) > > > > Then the dprofpp command will give you a report. My favorite reports are: > > dprofpp tmon.out (the basic report including CPU time) > > dprofpp -S tmon.out (merged subroutine tree) > > > > Brandon > > > > -- > > Brandon Bowersox > > brandon@ojctech.com > > OJC Technologies, Inc. > > www.ojctech.com, 217-278-3933 > > > > > > At 03:33 PM 11/7/2003 -0600, Mitch Kutzko wrote: > > >Hi, folks -- I have a question about the Perl debugger, which I've > > >essentially never actually used. > > > > > >How do I go about using it to find out where CPU usage is occurring? I've > > >got a very large, very complex script that's soaking up *way* too much CPU > > >(but not leaking memory -- already checked for that) for what it's doing, > > >but I can't figure out where/how it's happening. > > > > > >Any ideas on how to get the debugger to show me where all the CPU is going > ? > > > > > >Mitch > > >-- > > >Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 > > >http://hobbes.ncsa.uiuc.edu/ > > >_______________________________________________ > > >Champaign-Urbana mailing list > > >Champaign-Urbana@mail.pm.org > > >http://mail.pm.org/mailman/listinfo/champaign-urbana > > > > _______________________________________________ > > Champaign-Urbana mailing list > > Champaign-Urbana@mail.pm.org > > http://mail.pm.org/mailman/listinfo/champaign-urbana > -- > Keep the turbo spooled! > ryddler > http://www.starquestclub.com > > _______________________________________________ > Champaign-Urbana mailing list > Champaign-Urbana@mail.pm.org > http://mail.pm.org/mailman/listinfo/champaign-urbana > -- Arun Bhalla From mitch at ncsa.uiuc.edu Tue Nov 11 11:16:21 2003 From: mitch at ncsa.uiuc.edu (Mitch Kutzko) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl installable for Win2K/XP? In-Reply-To: <006301c3a876$e311aea0$0e07a8c0@researchpress.com> References: <3.0.5.32.20031111110044.037723e8@pop.ncsa.uiuc.edu> Message-ID: <3.0.5.32.20031111111621.037723e8@pop.ncsa.uiuc.edu> Not yet, but this: http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl Looks like exactly what I need. Thanks! Mitch At 11:11 AM 11/11/2003 -0600, you wrote: > Tried ActiveState's Perl? > > - jeff > > > -- > Jeff Helgesen > http://www.shout.net/~jmh/ > > > ----- Original Message ----- > From: "Mitch Kutzko" > To: "CU Perlmongers" > Sent: Tuesday, November 11, 2003 11:00 AM > Subject: [CMI.PM] Perl installable for Win2K/XP? > > > > Hi, folks -- Another question for you.... > > > > I'm looking for a free version of Perl for Win2K/WinXP systems. Something > > recent, stable, and compatable with CPAN, preferably. > > > > What recommendations does anyone have? The last time I had to solve this > > problem, I got lucky and someone had a licensed copy of the MKS Utilities > > version of Perl, which is now *way* too old to be useful in this context. > > > > Thanks in advance! > > > > Mitch > > > > PS - Still working on that CPU usage problem -- I'll keep you posted when > I > > figure it out. ;-) > > -- > > Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 > > http://hobbes.ncsa.uiuc.edu/ > > _______________________________________________ > > Champaign-Urbana mailing list > > Champaign-Urbana@mail.pm.org > > http://mail.pm.org/mailman/listinfo/champaign-urbana > > > > -- Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 http://hobbes.ncsa.uiuc.edu/ From ethomson at ravecomm.com Tue Nov 11 11:16:30 2003 From: ethomson at ravecomm.com (Ed Thomson) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl installable for Win2K/XP? In-Reply-To: <3.0.5.32.20031111110044.037723e8@pop.ncsa.uiuc.edu> References: <3.0.5.32.20031111110044.037723e8@pop.ncsa.uiuc.edu> Message-ID: <20031111171630.GA23949@mail.ravecomm.com> Mitch Kutzko wrote: > Hi, folks -- Another question for you.... > > I'm looking for a free version of Perl for Win2K/WinXP systems. Something > recent, stable, and compatable with CPAN, preferably. > > What recommendations does anyone have? The last time I had to solve this > problem, I got lucky and someone had a licensed copy of the MKS Utilities > version of Perl, which is now *way* too old to be useful in this context. I always install cygwin on windows boxes. It helps ease the pain of... well, windows. It includes a recent version of Perl. I don't know how well it deals with CPAN, but I've never had any problems with it. -Ed From mcovingt at ux1.cso.uiuc.edu Tue Nov 11 11:16:42 2003 From: mcovingt at ux1.cso.uiuc.edu (Maiko Covington) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl installable for Win2K/XP? In-Reply-To: <3.0.5.32.20031111110044.037723e8@pop.ncsa.uiuc.edu> Message-ID: Hiya. On Tue, 11 Nov 2003, Mitch Kutzko wrote: > Hi, folks -- Another question for you.... > > I'm looking for a free version of Perl for Win2K/WinXP systems. Something > recent, stable, and compatable with CPAN, preferably. > > What recommendations does anyone have? The last time I had to solve this > problem, I got lucky and someone had a licensed copy of the MKS Utilities > version of Perl, which is now *way* too old to be useful in this context. I've had good luck with ActiveState perl, at www.activestate.com. It just installs in the usual windows fashion, and comes with a perl package manager to get modules. The version I have is perl 5.8. I've found the modules I need there from active state and in the perl package manager myself, all recent, but YMMV. Maiko Covington From ryddler at cu-online.com Tue Nov 11 15:04:48 2003 From: ryddler at cu-online.com (ryddler) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Mongering tonight? Message-ID: <1068584688.1252.41.camel@bprice2kl.atgf.com> Hey Dan, Does all this traffic on the list mean we're going to have more people at the meeting tonight? There is that usage fee, right? ;) -- Keep the turbo spooled! ryddler http://www.starquestclub.com From cclausen at acm.org Tue Nov 11 15:21:33 2003 From: cclausen at acm.org (Christopher D. Clausen) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Perl installable for Win2K/XP? References: <3.0.5.32.20031111110044.037723e8@pop.ncsa.uiuc.edu> <20031111171630.GA23949@mail.ravecomm.com> Message-ID: <025301c3a89a$244d9500$8d0f15ac@ad.uiuc.edu> Ed Thomson wrote: > Mitch Kutzko wrote: >> Hi, folks -- Another question for you.... >> >> I'm looking for a free version of Perl for Win2K/WinXP systems. >> Something recent, stable, and compatable with CPAN, preferably. >> >> What recommendations does anyone have? The last time I had to solve >> this problem, I got lucky and someone had a licensed copy of the MKS >> Utilities version of Perl, which is now *way* too old to be useful >> in this context. > > I always install cygwin on windows boxes. > It helps ease the pain of... well, windows. It includes a recent > version of Perl. I don't know how well it deals with CPAN, but I've > never had any problems with it. I strongly recommend against using cygwin on anything but personal, single user systems. The readme states that cygwin uses shared memory spaces for data storage and there is the possibility that processes can access memory of another application. < Hi again! Different question today: What's the best way you recommend to reliably get an authoritative Fully Qualified Domain Name for a given machine? I've been using gethostbyaddr() and doing a reverse lookup on the IP address, but sometimes that comes back with "woof" instead of "woof.uiuc.edu" if the /etc/hosts file isn't set up correctly. On the machine itself, I can use the Net::Domain::getfqdn() call, but that sometimes gives spurious results depending on the contents of /etc/resolv.conf. And in any event, if other folks are doing a gethostbyaddr(), the name they each come back with for the same machine may not agree with each other. So. Any thoughts? Mitch -- Mitch Kutzko | mitch@dast.nlanr.net | mitch@ncsa.uiuc.edu | 217-333-1199 http://hobbes.ncsa.uiuc.edu/ From lewart at uiuc.edu Wed Nov 12 14:49:24 2003 From: lewart at uiuc.edu (Daniel S. Lewart) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] Authoritative hostname? In-Reply-To: <3.0.5.32.20031112144521.0106cde8@pop.ncsa.uiuc.edu>; from mitch@ncsa.uiuc.edu on Wed, Nov 12, 2003 at 02:45:21PM -0600 References: <3.0.5.32.20031112144521.0106cde8@pop.ncsa.uiuc.edu> Message-ID: <20031112144923.A14063@staff1.cso.uiuc.edu> Mitch, > Different question today: What's the best way you recommend to reliably > get an authoritative Fully Qualified Domain Name for a given machine? perldoc -q hostname Cheers, Dan http://cmi.pm.org/ From brandon at ojctech.com Sat Nov 15 13:48:34 2003 From: brandon at ojctech.com (Brandon Bowersox) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] block STDERR from a CPAN module implemented in C? Message-ID: <20031115194834.GA21042@che.ojctech.com> Since we've had such lively support lately... How can I trap or block STDERR output from the XML::GDOME module which is an XS module that uses a C implementation? Pretend Solution #1------------------------------------------ close STDERR; XML::GDOME->foo; #call that generates STDERR Pretend Solution #2------------------------------------------ local *STDERR; open (STDERR, ">".File::Spec->devnull()); XML::GDOME->foo; #call that generates STDERR #1 works but stops me from getting any of the helpful output from any part of my program below. #2 does not work because the XML::GDOME calls are in a different scope where "local *STDERR" no longer applies. Why do I want to do this? XML::GDOME gives "critical" error messages on STDERR even when it works correctly and produces the right output. The implementation seems to have trouble with reference counting and it hates when, for example, a document object is garbage collected when there are still node objects of that doc that have not been garbage collected. XML::GDOME is no longer being actively improved, but I want to use it because it works and supports the DOM methods I need, including importNode(). And I want to capture the STDERR so all these messages do not fill up or overwhelm the Apache mod_perl CGI environment from which I'm calling XML::GDOME. Brandon Bowersox From mepstein at uiuc.edu Sat Nov 15 18:16:44 2003 From: mepstein at uiuc.edu (Milt Epstein) Date: Mon Aug 2 21:27:36 2004 Subject: [CMI.PM] block STDERR from a CPAN module implemented in C? In-Reply-To: <20031115194834.GA21042@che.ojctech.com> Message-ID: On Sat, 15 Nov 2003, Brandon Bowersox wrote: > Since we've had such lively support lately... > > How can I trap or block STDERR output from the XML::GDOME module > which is an XS module that uses a C implementation? > > Pretend Solution #1------------------------------------------ > close STDERR; > XML::GDOME->foo; #call that generates STDERR > > Pretend Solution #2------------------------------------------ > local *STDERR; > open (STDERR, ">".File::Spec->devnull()); > XML::GDOME->foo; #call that generates STDERR > > #1 works but stops me from getting any of the helpful output from any > part of my program below. #2 does not work because the XML::GDOME > calls are in a different scope where "local *STDERR" no longer > applies. [ ... ] Did you try it without the "local *STDERR"? (You can save and restore it before and after as needed -- there's an example on the perlfunc man page.) Milt Epstein Research Programmer Integration and Software Engineering (ISE) Campus Information Technologies and Educational Services (CITES) University of Illinois at Urbana-Champaign (UIUC) mepstein@uiuc.edu