The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

dip - Dynamic instrumentation like DTrace, using aspects

VERSION

version 1.111890

SYNOPSIS

    $ dip -e 'aspect Profiled => call qr/^Person::set_/' myapp.pl
    $ dip -s toolkit/count_new.dip -- -S myapp.pl
    $ dip -e 'before { count("constructor", ARGS(1), ustack(5)); $c{total}++ }
        call qr/URI::new$/' test.pl

    # quantize transaction handling time both in total and grouped by request type
    $ dip -e '
        before { $ts_start = [gettimeofday] } call qr/MyApp::handle_request$/;
        after { quantize [ "all", ARGS(1) ] => 10**6*tv_interval($ts_start) }
            call qr/MyApp::handle_request$/;
      ' myapp.pl

COMMANDS

-s, --script

Takes a path to the dip script that should be run.

-e, --exec

Expects a dip script to be passed inline, much like perl -e expects an inline program.

-d, --delay

Tells dip not to activate the instrumentation at the beginning of the program. Instead the program to be instrumented should activate it manually using:

    $dip::dip && $dip::dip->();

This is useful if your program loads other code that should be instrumented at runtime. For example, to test a web application that uses Plack you might use:

    use Plack::Util;
    use Plack::Test;
    use HTTP::Request;

    test_psgi
        app => Plack::Util::load_psgi('mywebapp.pl'),
        client => sub {
            my $cb = shift;
            # now we're sure that mywebapp.pl has been loaded
            $dip::dip && $dip::dip->();
            # ... now make requests and test the responses ...
        };
-v, --verbose

The command-line options given to dip are used to call the program to be instrumented in a special way. Using the --verbose option tells dip to print that command-line.

SEE ALSO

dip

INSTALLATION

See perlmodinstall for information and options on installing Perl modules.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=dip.

AVAILABILITY

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/dip/.

The development version lives at http://github.com/hanekomu/dip and may be cloned from git://github.com/hanekomu/dip.git. Instead of sending patches, please fork this project using the standard git and github infrastructure.

AUTHOR

Marcel Gruenauer <marcel@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Marcel Gruenauer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.