Well, if THAT'S all you want to do,
it's already available with my module
AutoProfiler.pm
look in my account on CPAN.
For some reason, I was reading the original
request as parsing all possible calls,
versus tracking actual calls during execution.
AutoProfiler munges the symbol table for all
subroutines so that it can insert timestamping
code, then during execution of a script,
AutoProfiler will keep track of how much time
is spent inside each script.
I believe it tracks it by way of who called
the subroutine, which means you get the information
that you wanted, plus some timing information.
The entire data structure is stored as a hash,
and you can provide your own callback to
format it as you wish.
It might be a good place to start, at least.
Greg London
David Turner wrote:
> It seems like you could grovel through the symbol table and replace each
> func with a new sub which marks down the call in a hash somewhere and
> then calls the original sub. I saw an example of something similar on
> Perlmonks, but I can't find it now. The advantage of doing it at
> runtime is it deals with evals and the like, and it doesn't capture
> things that look like calls but aren't like: foo ('bar') if (0);
>
> On Mon, 2002-05-13 at 11:28, James Freeman wrote:
> > Hi Folks,
> >
> > I am wondering what toolkit's (preferably open source) folks use out
> > there to visualize the calling structure of source code before I roll my
> > own. This might be something like this:
> >
> > main:
> > || |
> > || ---->sub 1
> > || ||
> > || |----->sub 1a
> > || ----->sub 1b
> > ||---->sub 2
> > ---->sub 3
> > |
> > ------->sub 3a
> >
> > Or something more visually pretty. The best version would have a
> > language arguement so that I could use it for Perl, Python, Java, etc.
> >
> > Thanks for any help you can provide,
> >
> > Jim
> --
> -Dave Turner Stalk Me: 617 441 0668
> "Don't insult mathematics." -DJB
--
Greg London
x7541
\|/ ____ \|/
~@-/ oO \-@~
/_( \__/ )_\
\__U_/