RE: assess what subroutines are currently being called

"Greg London" <[email protected]> Wed, 11 Apr 2007 16:10:52 -0400
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
What do you mean by "other subroutines"? 

If you are only interested in your own subroutines,

then that's probably do-able. If you want to know 

everything that's going on, then that might be a bit

more of a problem, because you have to hook into Tk

somehow.

 

If you just want to monitor all your callbacks, 

and all your callbacks are named subroutines,

you could use one of the profiling packages off

of CPAN to profile your subroutines, and then 

keep track of when each is getting called.

 

I wrote a profiling package called Devel::AutoProfiler

which will automatically find all your subroutines

in the symbol table and profile them for you. Someone

extended it and improved it, but the idea is the same:

pre- and post- process each subroutine to track when

it's called.

 

You might actually be able to use this to profile some of Tk itself,

just use autoprofiler, then use Tk, and see what it prints out.

(though it will slow things down)

 

If your callbacks are anonymous subs, then I think you'll

have to manually instrument them yourself. It's been a while

since I looked at autoprofiler, but i think it can only find

named subroutines.

 

Greg London

------------------------------------------------------------------------------

 

 

I have a top level widget event timer that calls a sub routine
periodically and does some checks.

I'd like to add some code, for specific reasons, to be able to assess
what other subroutines are currently being executed with the mainloop. 
Is this possible?  I'd expect the call to always indicate the event sub
to be running so any additional subs is what I am interested in.

--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk

--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk