Hi, perl-5.12.0 has apparently integrated Alan Burlison and Richard Dave''s patches to add sub-entry and sub-return probes. I''m so far unable to get this to work. I compiled Perl-5.12.0 with -Dusedtrace and tried all the default example programs. Andy Armstrong in the perl5-porters http://www.nntp.perl.org/group/perl.perl5.porters/2010/04/msg159223.html thread claims this all works for him. In ~/src/perl but using the newly installed copy of perl in /usr/local/perl-5.12.0/bin/perl. $ cat script.pl #!/usr/local/perl-5.12.0/bin/perl foo() for 1 .. 5; sub foo { print BAD_HANDLE "In foo\n"; } $ cat script.d perl$target::sub-entry, perl$target::sub-return { printf("%s %s (%s:%d)\n", probename == "sub-entry" ? "->" : "<-", copyinstr(arg0), copyinstr(arg1), arg2); } $ sudo dtrace -c ./script.pl -s script.d dtrace: failed to compile script script.d: line 1: probe description :perl31479::sub-entry does not match any probes $ for d in ~/src/DTraceToolkit-0.99/Perl/*.d;do sudo dtrace -c ./script.pl -s $d;done dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_calldist.d: line 49: probe description perl*:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_calltime.d: line 47: probe description perl*:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_cpudist.d: line 49: probe description perl*:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_cputime.d: line 47: probe description perl*:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_flow.d: line 58: probe description perl*:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_flowinfo.d: line 61: probe description perl*:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_flowtime.d: line 63: probe description perl*:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_malloc.d: line 44: probe description perl31429:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_subcalls.d: line 46: probe description perl*:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_syscalls.d: line 49: probe description perl31433:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_syscolors.d: line 65: probe description perl31435:::sub-entry does not match any probes dtrace: failed to compile script /Users/jbenjore/src/DTraceToolkit-0.99/Perl/pl_who.d: line 47: probe description perl*:::sub-entry does not match any probes -- This message posted from opensolaris.org
On Apr 20, 2010, at 7:31 AM, Josh ben Jore wrote:> Hi, > > perl-5.12.0 has apparently integrated Alan Burlison and Richard Dave''s patches to add sub-entry and sub-return probes. I''m so far unable to get this to work. I compiled Perl-5.12.0 with -Dusedtrace and tried all the default example programs. Andy Armstrong in the perl5-porters http://www.nntp.perl.org/group/perl.perl5.porters/2010/04/msg159223.html thread claims this all works for him. > > In ~/src/perl but using the newly installed copy of perl in /usr/local/perl-5.12.0/bin/perl.Josh, Its possible you''re seeing some timing issues. Try launching a perl script that runs forever. In another shell, as root, look up the pid of your running perl script. Now run: dtrace -l -P perl$pid I''m using the $pid here as an email variable :-), your actual command line will look like: dtrace -l -P perl183 Does this show any probes? If the answer is no, the next experiment to try is asking dyld to tell you what probes it is registering with dtrace. In your root shell, set the DYLD_PRINT_DOFS environment variable to 1. setenv DYLD_PRINT_DOFS 1 Now run your perl script in that shell. You''re looking for output like this: [Ika:~] root# setenv DYLD_PRINT_DOFS 1 [Ika:~] root# ls dyld: registering DOF section 0x0x7fff8c939f38 in libcache.dylib with dtrace, ID=0x00000001 dyld: registering DOF section 0x0x7fff8c13e6ed in libSystem.B.dylib with dtrace, ID=0x00000002 dyld: registering DOF section 0x0x7fff8c13ee1b in libSystem.B.dylib with dtrace, ID=0x00000003 .CFUserTextEncoding .forward Library Do you see anything from a perl executable or library registering with dtrace? James M
My problem was I''ve apparently been invoking DTrace incorrectly. When I look at the shebang line on the DTraceToolkit-0.99/Perl/pl_*.d scripts, I see -Z and -s but I was often invoking my programs without -Z. I think I''ve got to go back and just update Perl''s own DTrace documentation with some usage info. Thanks ever so much for the hints though. I''ve been trying to read all the various bits of relevant documentation and hadn''t run across those diagnostics yet. -- This message posted from opensolaris.org