AutoProfiler is a Perl module that will automatically profile subroutine calls in a Perl program.
The profiler module is completely automatic in its basic mode. You simply "use" the module at the top of you main script. The module will then automatically instrument all subroutines in the code, profile each subroutine call during the execution of the script, and print out a report of usage.
To use the AutoProfiler module in your program, just put this one line in your program:
everything else will happen automatically.
AutoProfiler 1.1 handles prototyped subroutines.
If you use a module that you do not want profiled, "use" that module before you "use" the AutoProfiler module.
When the program completes, the AutoProfiler module will automatically print out information about all subroutines that were profiled.
You can supply a callback which will be called at END time. This code reference will be passed a hash containing all the caller information in the form of a hash. Your callback routine can the do whatever it wishes with this information.
-command => sub
my (Úta) = @_;
print "this format provided by user callback
print Dumper Úta;
If you do not supply a callback command, AutoProfiler prints out the caller information in reverse order by total time spent in a particular subroutine. This means that at the end of execution, all the information is printed out, and the last item listed uses the most processor time during execution.