develooper Front page | perl.perl5.porters | Postings from July 2008

Code review request for the perl guts vodoo in NYTProf v2

Tim Bunce
July 20, 2008 17:47
Code review request for the perl guts vodoo in NYTProf v2
Message ID:
In my headlong charge to get Devel::NYTProf v2 out before OSCON I've not
had much time to review the code I'd cooked up to dig around in perl

For example:

#if (PERL_VERSION < 8) || ((PERL_VERSION == 8) && (PERL_SUBVERSION < 8))
/* If we're using DB::DB() instead of opcode redirection with an old perl
 * then PL_curcop in DB() will refer to the DB() wrapper in Devel/
 * so we'd have to crawl the stack to find the right cop. However, for some
 * reason that I don't pretend to understand the following expression works:
#define PL_curcop_nytprof (use_db_sub ? ((cxstack + cxstack_ix)->blk_oldcop) : PL_curcop)
#define PL_curcop_nytprof PL_curcop

Others include the visit_contexts(), check_context(),
start_cop_of_context() and closest_cop() functions.

I've been playing with magic beyond my powers and have, so far, survived
unscathed (not counting too many late night hacking sessions).
I suspect that the code is suboptimal in places. Perhaps lots of places.
Any feedback gratefully recieved.

Tim. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About