Devel-Trace-Fork

 view release on metacpan or  search on metacpan

lib/Devel/Trace/Fork/Stderr.pm  view on Meta::CPAN

=item *

a high-resolution timestamp for the time each statement
was executed

=item *

the process id of the process that executes each statement

=item * 

the current value of the L<$CHILD_ERROR|perlvar/"$CHILD_ERROR">
variable (C<$?>)

=back

This additional information
can be helpful for debugging programs that make use of the
L<< fork|perlfunc/fork >> system call to run. For example,
the C<Trace::Fork> output of this program:

    if (fork() == 0) {
        print "This is the child.\n";
        exit 0;
    }
    print "This is the parent.\n";

will be a file that looks something like:

    /usr/bin/perl test
    1268025451 1268025451.815
    >>    0.816214:7996:0:test:1: if (fork() == 0) {
    >>    0.826566:7996:0:test:5: print "This is the parent.\n";
    >>    0.826684:9572:0:test:2:     print "This is the child.\n";
    >>    0.826941:9572:0:test:3:     exit 0;

=head1 DETAILS

Like L<Devel::Trace>, debugging output is printed to
C<STDERR>. To redirect debugging output to a separate file,
see L<Devel::Trace::Fork>.

See L<Devel::Trace>. Use the C<$Devel::Trace::TRACE> variable
or the C<Devel::Trace::trace> function exactly the way you
would use them with the pure C<Devel::Trace> module. To import
the C<Devel::Trace::trace> function into your program's
namespace, include the line:

    use Devel::Trace 'trace';

somewhere in your program.

=head1 SUBROUTINES/METHODS

None

=head1 DEPENDENCIES

    Devel::Trace

=head1 BUGS AND LIMITATIONS

If there are child processes that exit later than the
parent process, then the final output will not be sorted.

There is almost enough information in the trace output
to use it for profiling. Almost.

=head1 SEE ALSO

L<Devel::Trace>, L<Devel::Trace::More>, L<Devel::Trace::Fork>

=head1 AUTHOR

Marty O'Brien, E<lt>mob@cpan.orgE<gt>

=head1 LICENSE AND COPYRIGHT

Copyright (c) 2010, Marty O'Brien

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.0 or,
at your option, any later version of Perl 5 you may have available.

=cut



( run in 1.174 second using v1.01-cache-2.11-cpan-800906f7e73 )