Message from discussion
RT#54600
X-BeenThere: develnytprof-dev@googlegroups.com
Received: by 10.223.69.153 with SMTP id z25ls240951fai.2.p; Tue, 16 Feb 2010
09:50:46 -0800 (PST)
Received: by 10.223.4.206 with SMTP id 14mr182419fas.25.1266342645873;
Tue, 16 Feb 2010 09:50:45 -0800 (PST)
Received: by 10.223.4.206 with SMTP id 14mr182418fas.25.1266342645812;
Tue, 16 Feb 2010 09:50:45 -0800 (PST)
Return-Path: <tim.bu...@gmail.com>
Received: from mail-fx0-f213.google.com (mail-fx0-f213.google.com [209.85.220.213])
by gmr-mx.google.com with ESMTP id 11si844488fxm.10.2010.02.16.09.50.44;
Tue, 16 Feb 2010 09:50:44 -0800 (PST)
Received-SPF: pass (google.com: domain of tim.bu...@gmail.com designates 209.85.220.213 as permitted sender) client-ip=209.85.220.213;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of tim.bu...@gmail.com designates 209.85.220.213 as permitted sender) smtp.mail=tim.bu...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by mail-fx0-f213.google.com with SMTP id 6so443665fxm.35
for <develnytprof-dev@googlegroups.com>; Tue, 16 Feb 2010 09:50:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:received:sender:date:from:to:subject
:message-id:references:mime-version:content-type:content-disposition
:in-reply-to:user-agent;
bh=PDDTll74phSW6haUsQR8sx0SCvqUxhPlHVM5Z409Urc=;
b=UP7HLELBJK9zjHPOAoZTpynT0fM5hffLQZ6LGd4xWsMZM/sbT3OuUVqxTY7Ig2pkLP
JhD3iykaA/kmHD0By7bRrd5tMHbKNNyCNM3jwIKCIpBpEWsvJbSae1ysYzdz+2eRMj5V
+ulsPlpXpVkdP8pUoSJZZobbDS3lo1BMoLrmE=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=sender:date:from:to:subject:message-id:references:mime-version
:content-type:content-disposition:in-reply-to:user-agent;
b=FxeSspwtmttDp9kVpRYpQ3wu79g9Vox+BbYnwUJrHHGMcs94eDCuIs0woNmyfZ7DvA
rZgPHe6NVZ85s9kAvJQfDXTlLyEna6VKw/sx87EdrXHAgmkZu9S4mJWtCJFGXu3Yc8tM
w3tr8gg72KrP29ohlWmgjF8LVq1aXBX3Rd+Jo=
Received: by 10.223.63.20 with SMTP id z20mr3990165fah.98.1266342644662;
Tue, 16 Feb 2010 09:50:44 -0800 (PST)
Return-Path: <tim.bu...@gmail.com>
Received: from timac.local ([86.47.232.121])
by mx.google.com with ESMTPS id p9sm940568fkb.44.2010.02.16.09.50.42
(version=SSLv3 cipher=RC4-MD5);
Tue, 16 Feb 2010 09:50:42 -0800 (PST)
Sender: Tim Bunce <tim.bu...@gmail.com>
Date: Tue, 16 Feb 2010 17:50:40 +0000
From: Tim Bunce <Tim.Bu...@pobox.com>
To: develnytprof-dev@googlegroups.com
Subject: Re: [develnytprof-dev: 1676] RT#54600
Message-ID: <20100216175040.GO...@timac.local>
References: <000e0cd0eba25619ec047fb99...@google.com>
<20100216161200.GG49...@plum.flirble.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20100216161200.GG49...@plum.flirble.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Thanks for background detail and test Nick. Very helpful.
I'll give it some thought, hopefully tonight.
Tim.
On Tue, Feb 16, 2010 at 04:12:00PM +0000, Nicholas Clark wrote:
> On Tue, Feb 16, 2010 at 03:44:52PM +0000, codesite-nore...@google.com wrote:
> > Revision: 1056
> > Author: n...@ccl4.org
> > Date: Tue Feb 16 07:44:10 2010
> > Log: Better test for RT#54600
> >
> > The problem is caused by S_call_body() in 5.8.8 and earlier making a direct
> > call to Perl_pp_entersub(), rather than indirecting via
> > PL_ppaddr[OP_ENTERSUB].
> > Hence any calls made through it (such as DESTROY) never reach our
> > pp_subcall_profiler, and subr_entry_setup() is never called to initialse
> > subr_entry_ix. Hence if if the DESTROY routine (or an AUTOLOAD called in
> > lieu
> > of it) executes goto \&subname; that does reach pp_subcall_profiler, which
> > assumes that it must (already) be inside a subroutine.
> >
> > I don't (yet) know what the right fix (or work around) is.
> > http://code.google.com/p/perl-devel-nytprof/source/detail?r=1056
>
> Specifically, I can see this comment:
>
> /* goto &sub opcode acts like a return followed by a call all in one.
> * When this op starts executing, the 'current' subr_entry that was
> * pushed onto the savestack by pp_subcall_profiler will be 'already_counted'
> * so the profiling of that call will be handled naturally for us.
> * So far so good.
> * Before it gets destroyed we'll take a copy of the subr_entry.
> * Then tell subr_entry_setup() to use our copy as a template so it'll
> * seem like the sub we goto'd was called by the same sub that called
> * the one that executed the goto. Except that we do use the fid:line
> * of the goto statement. That way the call graph makes sense and the
> * 'calling location' make sense. Got all that?
> */
>
> I assume that the work around is that if we arrive at a goto &sub
> with subr_entry_ix 0, we skip the copy part, and treat it as an entersub
> (possibly at the line of the goto, given that we can infer that it won't
> be possible to merge the timing back to the location of the caller of
> the original subroutine).
>
> But I'm not sure of the right way to do that.
>
> Nicholas Clark
>
> --
> You've received this message because you are subscribed to
> the Devel::NYTProf Development User group.
>
> Group hosted at: http://groups.google.com/group/develnytprof-dev
> Project hosted at: http://perl-devel-nytprof.googlecode.com
> CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf
>
> To post, email: develnytprof-dev@googlegroups.com
> To unsubscribe, email: develnytprof-dev-unsubscribe@googlegroups.com
>