Matthew.Hitchens at ubs.com
2006-Aug-29 21:29 UTC
[dtrace-discuss] Where am I going wrong?
I''m new to DTrace as of yesterday, and I''ve had good luck working with the standard set of probes. I''m learning it to profile our java software though, so I''ve gotten/built/loaded the dvmti agent for JDK 5.0. I read somewhere that the probes become available when then agent loads. That''s fine. I wrote a little Java program. public class Test { public static void main(String[] args) throws Exception { for(;;) { System.out.println("WE ARE NOT A CULT."); Thread.sleep(1000); } } } Making sure that libdvmti.so and dvmti.jar are in the same directory and in LD_LIBRARY_PATH, I run: # java -Xrundvmti:all Test ..and once every second I''m reassured that me and cults are not an item. Then, from another terminal, I run: # dtrace -P "dvm*" dtrace: invalid probe specifier dvm*: probe description dvm*::: does not match any probes And if 7308 is the JVM PID... # dtrace -n "dvm7308:::" dtrace: invalid probe specifier dvm7308:::: probe description dvm7308::: does not match any probes Alas, I feel like I''m so close! Take pity on an out of touch Java developer! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20060829/f79cddab/attachment.html> -------------- next part -------------- Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.
Hi Matthew, Can you try setting DTRACE_DOF_INIT_DEBUG=1 in your environment and then running Java? If the dvmti module is being loaded you should see some output on the command line. You can also try running pmap `pgrep java` and confirm that the libdvmti.so object is loaded. Adam On Tue, Aug 29, 2006 at 05:29:20PM -0400, Matthew.Hitchens at ubs.com wrote:> I''m new to DTrace as of yesterday, and I''ve had good luck working with > the standard set of probes. I''m learning it to profile our java software > though, so I''ve gotten/built/loaded the dvmti agent for JDK 5.0. I read > somewhere that the probes become available when then agent loads. That''s > fine. > > I wrote a little Java program. > > public class Test { > public static void main(String[] args) throws Exception { > for(;;) { > System.out.println("WE ARE NOT A CULT."); > Thread.sleep(1000); > } > } > } > > Making sure that libdvmti.so and dvmti.jar are in the same directory and > in LD_LIBRARY_PATH, I run: > > # java -Xrundvmti:all Test > > ..and once every second I''m reassured that me and cults are not an item. > > Then, from another terminal, I run: > > # dtrace -P "dvm*" > dtrace: invalid probe specifier dvm*: probe description dvm*::: does not > match any probes > > And if 7308 is the JVM PID... > > # dtrace -n "dvm7308:::" > dtrace: invalid probe specifier dvm7308:::: probe description dvm7308::: > does not match any probes > > Alas, I feel like I''m so close! Take pity on an out of touch Java > developer!Content-Description: Legal Disclaimer> > Visit our website at http://www.ubs.com > > This message contains confidential information and is intended only > for the individual named. If you are not the named addressee you > should not disseminate, distribute or copy this e-mail. Please > notify the sender immediately by e-mail if you have received this > e-mail by mistake and delete this e-mail from your system. > > E-mail transmission cannot be guaranteed to be secure or error-free > as information could be intercepted, corrupted, lost, destroyed, > arrive late or incomplete, or contain viruses. The sender therefore > does not accept liability for any errors or omissions in the contents > of this message which arise as a result of e-mail transmission. If > verification is required please request a hard-copy version. This > message is provided for informational purposes and should not be > construed as a solicitation or offer to buy or sell any securities or > related financial instruments.> _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
Matthew.Hitchens at ubs.com
2006-Aug-30 18:26 UTC
[dtrace-discuss] Where am I going wrong?
Thanks for the advice! When I set DTRACE_DOF_INIT_DEBUG=1 and start the JVM (then interrupt after a few iterations), I see this: $ java -agentlib:dvmti=all Test dtrace DOF libjvm.so: DTrace ioctl succeeded for DOF at fefaf780 dtrace DOF libdvmti.so: DTrace ioctl succeeded for DOF at fe6968a0 WE ARE NOT A CULT. WE ARE NOT A CULT. WE ARE NOT A CULT. WE ARE NOT A CULT. ^Cdtrace DOF libdvmti.so: DTrace ioctl removed DOF (0) dtrace DOF libjvm.so: DTrace ioctl removed DOF (0) And ''pmap `pgrep java`|grep dvmti'' while it''s running yields: FE690000 32K r-x-- /home/hitchema/build/dvm/build/sparc/lib/libdvmti.so FE6A6000 16K rwx-- /home/hitchema/build/dvm/build/sparc/lib/libdvmti.so Does that look kosher so far? -----Original Message----- From: Adam Leventhal [mailto:ahl at eng.sun.com] Sent: Tuesday, August 29, 2006 6:30 PM To: Hitchens, Matthew Cc: dtrace-discuss at opensolaris.org Subject: Re: [dtrace-discuss] Where am I going wrong? Hi Matthew, Can you try setting DTRACE_DOF_INIT_DEBUG=1 in your environment and then running Java? If the dvmti module is being loaded you should see some output on the command line. You can also try running pmap `pgrep java` and confirm that the libdvmti.so object is loaded. Adam On Tue, Aug 29, 2006 at 05:29:20PM -0400, Matthew.Hitchens at ubs.com wrote:> I''m new to DTrace as of yesterday, and I''ve had good luck working with> the standard set of probes. I''m learning it to profile our java > software though, so I''ve gotten/built/loaded the dvmti agent for JDK > 5.0. I read somewhere that the probes become available when then agent> loads. That''s fine. > > I wrote a little Java program. > > public class Test { > public static void main(String[] args) throws Exception { > for(;;) { > System.out.println("WE ARE NOT A CULT."); > Thread.sleep(1000); > } > } > } > > Making sure that libdvmti.so and dvmti.jar are in the same directory > and in LD_LIBRARY_PATH, I run: > > # java -Xrundvmti:all Test > > ..and once every second I''m reassured that me and cults are not anitem.> > Then, from another terminal, I run: > > # dtrace -P "dvm*" > dtrace: invalid probe specifier dvm*: probe description dvm*::: does > not match any probes > > And if 7308 is the JVM PID... > > # dtrace -n "dvm7308:::" > dtrace: invalid probe specifier dvm7308:::: probe descriptiondvm7308:::> does not match any probes > > Alas, I feel like I''m so close! Take pity on an out of touch Java > developer!Content-Description: Legal Disclaimer> > Visit our website at http://www.ubs.com > > This message contains confidential information and is intended only > for the individual named. If you are not the named addressee you > should not disseminate, distribute or copy this e-mail. Please notify> the sender immediately by e-mail if you have received this e-mail by > mistake and delete this e-mail from your system. > > E-mail transmission cannot be guaranteed to be secure or error-free as> information could be intercepted, corrupted, lost, destroyed, arrive > late or incomplete, or contain viruses. The sender therefore does not> accept liability for any errors or omissions in the contents of this > message which arise as a result of e-mail transmission. If > verification is required please request a hard-copy version. This > message is provided for informational purposes and should not be > construed as a solicitation or offer to buy or sell any securities or > related financial instruments.> _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.
Matt and I solved the problem off the alias: the issue was that he had the dtrace_user privilege (which gives him access to the syscall and profile providers), but not the dtrace_proc privilege (needed for the pid provider and any USDT providers). After asking his admin to give him that privilege, Matt was able to see the dvm provider probes. If someone (Matt?) wants to add a note to the DTrace FAQ, I''m sure it would be appreciated by people who hit this in the future. http://www.genunix.org/wiki/index.php/DTrace_FAQ Adam On Tue, Aug 29, 2006 at 05:29:20PM -0400, Matthew.Hitchens at ubs.com wrote:> I''m new to DTrace as of yesterday, and I''ve had good luck working with > the standard set of probes. I''m learning it to profile our java software > though, so I''ve gotten/built/loaded the dvmti agent for JDK 5.0. I read > somewhere that the probes become available when then agent loads. That''s > fine. > > I wrote a little Java program. > > public class Test { > public static void main(String[] args) throws Exception { > for(;;) { > System.out.println("WE ARE NOT A CULT."); > Thread.sleep(1000); > } > } > } > > Making sure that libdvmti.so and dvmti.jar are in the same directory and > in LD_LIBRARY_PATH, I run: > > # java -Xrundvmti:all Test > > ..and once every second I''m reassured that me and cults are not an item. > > Then, from another terminal, I run: > > # dtrace -P "dvm*" > dtrace: invalid probe specifier dvm*: probe description dvm*::: does not > match any probes > > And if 7308 is the JVM PID... > > # dtrace -n "dvm7308:::" > dtrace: invalid probe specifier dvm7308:::: probe description dvm7308::: > does not match any probes > > Alas, I feel like I''m so close! Take pity on an out of touch Java > developer!Content-Description: Legal Disclaimer> > Visit our website at http://www.ubs.com > > This message contains confidential information and is intended only > for the individual named. If you are not the named addressee you > should not disseminate, distribute or copy this e-mail. Please > notify the sender immediately by e-mail if you have received this > e-mail by mistake and delete this e-mail from your system. > > E-mail transmission cannot be guaranteed to be secure or error-free > as information could be intercepted, corrupted, lost, destroyed, > arrive late or incomplete, or contain viruses. The sender therefore > does not accept liability for any errors or omissions in the contents > of this message which arise as a result of e-mail transmission. If > verification is required please request a hard-copy version. This > message is provided for informational purposes and should not be > construed as a solicitation or offer to buy or sell any securities or > related financial instruments.> _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
Matthew.Hitchens at ubs.com
2006-Sep-05 17:45 UTC
[dtrace-discuss] Where am I going wrong?
Done. The FAQ now has a section called "Do I need privileges to use DTrace?" Feel free to sharpen it up if necessary. Thanks again for the help. matt -----Original Message----- From: Adam Leventhal [mailto:ahl at eng.sun.com] Sent: Tuesday, September 05, 2006 11:33 AM To: Hitchens, Matthew Cc: dtrace-discuss at opensolaris.org Subject: Re: [dtrace-discuss] Where am I going wrong? Matt and I solved the problem off the alias: the issue was that he had the dtrace_user privilege (which gives him access to the syscall and profile providers), but not the dtrace_proc privilege (needed for the pid provider and any USDT providers). After asking his admin to give him that privilege, Matt was able to see the dvm provider probes. If someone (Matt?) wants to add a note to the DTrace FAQ, I''m sure it would be appreciated by people who hit this in the future. http://www.genunix.org/wiki/index.php/DTrace_FAQ Adam On Tue, Aug 29, 2006 at 05:29:20PM -0400, Matthew.Hitchens at ubs.com wrote:> I''m new to DTrace as of yesterday, and I''ve had good luck working with> the standard set of probes. I''m learning it to profile our java > software though, so I''ve gotten/built/loaded the dvmti agent for JDK > 5.0. I read somewhere that the probes become available when then agent> loads. That''s fine. > > I wrote a little Java program. > > public class Test { > public static void main(String[] args) throws Exception { > for(;;) { > System.out.println("WE ARE NOT A CULT."); > Thread.sleep(1000); > } > } > } > > Making sure that libdvmti.so and dvmti.jar are in the same directory > and in LD_LIBRARY_PATH, I run: > > # java -Xrundvmti:all Test > > ..and once every second I''m reassured that me and cults are not anitem.> > Then, from another terminal, I run: > > # dtrace -P "dvm*" > dtrace: invalid probe specifier dvm*: probe description dvm*::: does > not match any probes > > And if 7308 is the JVM PID... > > # dtrace -n "dvm7308:::" > dtrace: invalid probe specifier dvm7308:::: probe descriptiondvm7308:::> does not match any probes > > Alas, I feel like I''m so close! Take pity on an out of touch Java > developer!Content-Description: Legal Disclaimer> > Visit our website at http://www.ubs.com > > This message contains confidential information and is intended only > for the individual named. If you are not the named addressee you > should not disseminate, distribute or copy this e-mail. Please notify> the sender immediately by e-mail if you have received this e-mail by > mistake and delete this e-mail from your system. > > E-mail transmission cannot be guaranteed to be secure or error-free as> information could be intercepted, corrupted, lost, destroyed, arrive > late or incomplete, or contain viruses. The sender therefore does not> accept liability for any errors or omissions in the contents of this > message which arise as a result of e-mail transmission. If > verification is required please request a hard-copy version. This > message is provided for informational purposes and should not be > construed as a solicitation or offer to buy or sell any securities or > related financial instruments.> _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.