| 1 | package Devel::Agent::EveryThing; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Devel::Agent::EveryThing - Trace Eveything | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | perl -d:Agent -MDevel::Agent::EveryThing myscript.pl | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | This is a module that makes use of the agent debugger and writes the begining and ending of every frame to STDERR. | ||
| 14 | |||
| 15 | This module is similar to L<Devel::Trace>, but makes use of the L<Devel::Agent> deugger. This allows for tracing how long each method runs for and providing a noted stack depth along with of the execution order. | ||
| 16 | |||
| 17 | =head1 Notes and limitations | ||
| 18 | |||
| 19 | This class does not trace entry into control structures, just execution of Non-XS methods. | ||
| 20 | |||
| 21 | =cut | ||
| 22 | |||
| 23 | 1 | ▶ | use Modern::Perl; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | 1 | ▶ | use Devel::Agent; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | 1 | our $VERSION=$Devel::Agent::VERSION; | |
| 26 | 0 | ▶ | use Data::Dumper; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.4
| |||
| 27 | 0 | ▶ | use Devel::Agent::Util qw(flush_row); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.4
| |||
| 28 | |||
| 29 | 1 | STDERR->autoflush(1); | |
| 30 | 1 | my $last=0; | |
| 31 | 1 | my $self; | |
| 32 | |||
| 33 | 1 | $self=DB->new( | |
| 34 | on_frame_end=>\&flush_row, | ||
| 35 | ); | ||
| 36 | 1 | $self->start_trace; | |
| 37 | # it starts but never stops | ||
| 38 | |||
| 39 | |||
| 40 | END { | ||
| 41 | # hun, turns out we needed this! | ||
| 42 | $self->stop_trace; | ||
| 43 | } | ||
| 44 | |||
| 45 | 1 | 1; | |
| 46 | |||
| 47 | __END__ | ||