On Thu, Apr 23, 2009 at 02:56:30PM +0900, Chia-liang Kao wrote:
>
> Hi,
>
> Consider the following script:
>
> 1: #!/usr/bin/perl -w
> 2:
> 3: sub func1 {
> 4: func2(sub { func3();'wtf'});
> 5: }
> 6:
> 7: sub func2 { shift->() }
> 8:
> 9: sub func3 {}
> 10: warn func1();
>
> can devel::nytprof tell that func2 and func3 are called by different
> callers? it seems the fileinfo/subinfo only stores the caller line
> (line 4 in this case), from which the caller sub is derived. in the
> html output the caller would be "func2 or __ANON__[sciprt.pl:4].
> However for constructing the call tree it wouldn't be sufficient
> though. is the information stored somehow during profiling?
No, not yet. It's certainly needed though, not least for Moose/Class::MOP.
The HACKING file has this entry:
Could save 'current subname' in sub profiler so we can say A was called by B
and not just A was called by line X of file Y. (Will need to SAVE* a link to
previous current subname and restore it on return from sub.)
This would free us from the perils of trying to guess the calling sub from
the
line numbers (which is risky normally but is pure FAIL for
Moose/Class::MOP).
Tim.
--~--~---------~--~----~------------~-------~--~----~
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: [email protected]
To unsubscribe, email: [email protected]
-~----------~----~----~----~------~----~------~--~---