dip - Dynamic instrumentation like DTrace, using aspects
version 1.111890
$ 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
Takes a path to the dip script that should be run.
Expects a dip script to be passed inline, much like perl -e expects an inline program.
perl -e
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 ... };
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.
dip
--verbose
See perlmodinstall for information and options on installing Perl modules.
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.
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.
Marcel Gruenauer <marcel@cpan.org>
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.
To install dip, copy and paste the appropriate command in to your terminal.
cpanm
cpanm dip
CPAN shell
perl -MCPAN -e shell install dip
For more information on module installation, please visit the detailed CPAN module installation guide.