Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: NYTProf doesn't profile through a system or exec call

by kennethk (Abbot)
on Oct 21, 2013 at 19:33 UTC ( #1059158=note: print w/replies, xml ) Need Help??


in reply to NYTProf doesn't profile through a system or exec call

Not to be obtuse, but is there a reason you can't just profile scriptB independently? You could do this either by directly invoking it w/ perl -d:NYTProf scriptB, or if it needs internal parameters from the script, like

@commands = qw( perl -d:NYTProf scriptB val1 val2 ); exec(@commands);
I'm pretty sure that you'll get erroneous results if you try to profile both simultaneously.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: NYTProf doesn't profile through a system or exec call
by moritz (Cardinal) on Oct 22, 2013 at 07:11 UTC
    I'm pretty sure that you'll get erroneous results if you try to profile both simultaneously.

    But there's a simple solution to that: set the environment variable NYTPROF to addpid=1, then the profile for each process is written to a different file.

    Then one can either analyze each file separately with nytprofhtml -f nytprof.out.$PID, or run nytprofmerge -o nytprof.merged nytprof.out.*; nytprofhtml -f nytprof.merged to merge them all into one report.

    And to make sure that all perl processes are profiled, one can set the PERL5OPT environment variable to -d:NYTPProf.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059158]
help
Chatterbox?
[shmem]: stevieb: what you're doing sounds afwully complex. Too much for me this evening to provide brighter insight ;-)
[stevieb]: I don't even own a Windows computer. Both my girl and I have a laptop each with Linux. I'm supporting Windows in some of my projects and I can't even guage whether it's worth it or not.
[stevieb]: shmem It's something I desired to have years ago, which is why I took over berrybrew. Cross-platform build/test automation locally, or over the network Test::BrewBuild
[shmem]: sounds good.
[shmem]: but I'm crumbling smaller stones. remember...
[stevieb]: I'm working on it to fatten it up and make it more reliant so I can finalize my Raspberry Pi automated build system for that software :) It's all well and fun, until I try to make it work with Windows lol
[shmem]: "debugging a program is more difficult than to write it in the first place. If you code your program as smart as you are, you are, by definition, too dumb to debug it."

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2017-03-28 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (342 votes). Check out past polls.