SPUG: NYTProf for October 2010 meeting

Joshua ben Jore twists at gmail.com
Mon Oct 11 08:42:40 PDT 2010


On Fri, Oct 8, 2010 at 5:27 PM, Andrew Sweger <andrew at sweger.net> wrote:
> Sounds great. You got my vote, though I probably won't make it.
>
> Why y'all so quiet? Is NYTProf boring? It just saved my bacon today. I
> threw some of my ugliest code at the latest version and it kindly pointed
> out that some code was causing PL_sawampersand* to be set and where it was
> probably happening. (I've been having trouble getting Devel::FindAmpersand
> to work.)
>
> * From Devel::SawAmpersand:

I found it easier to write a plugin runloop and effectively have a
"watch" expression running to find when PL_sawampersand is flipped.
The stock runloop is:


    while ( PL_op = PL_op->invoke() ) {
        handle_signals;
    }

It's trivial to replace that with:

    while ( ... ) {

        /* Notice if the variable fllips */
        if ( ! saw_ampersand_before
            && PL_sawampersand ) {

            saw_ampersand = 1;
            call_carp_cluck("Found it!");
        }
    }

and get a stack trace that shows you exactly where the badness is.


More information about the spug-list mailing list