NAME

Devel::DTrace - Enable dtrace probes for subroutine entry, exit

SYNOPSIS

$ perl -MDevel::DTrace prog.pl
$ ps -af | grep perl
$ dtrace -p <PID> -s examples/subs-tree.d

$ cat examples/subs-tree.d
#pragma D option quiet

perlxs$target:::sub-entry, perlxs$target:::sub-return {
	printf("%s %s (%s:%d)\n", probename == "sub-entry" ? "->" : "<-",
            copyinstr(arg0), copyinstr(arg1), arg2);
}

DESCRIPTION

This module is alpha. Use with care. Expect problems. Report bugs.

Sun's dtrace tool is currently supplied with Solaris and Mac OS 10.5. It allows probes to be attached to a running executable so that debug information may be gathered.

This module provides probes for subroutine entry and exit. See examples/subs-tree.d for an small example D script that uses them.

Limitations

Note that dtrace can't find any probes in the Perl executable until after Devel::DTrace has loaded - because before then the probes don't exist. That means that you can't use dtrace to launch the perl executable. Perl must already be running and have loaded Devel::DTrace before you can connect to it with dtrace.

AUTHOR

Andy Armstrong <andy@hexten.net>

LICENCE AND COPYRIGHT

Copyright (c) 2008, Andy Armstrong <andy@hexten.net>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.