Guy With Question
2008-Aug-05 16:19 UTC
[dtrace-discuss] How to install DTrace/JVMPI for WebLogic 8.1/Java
Hi, ? Thanks for your reply. I downloaded the DVM. I''m trying to run dtrace on a standalone, looping, "Hello World!" application, but I get the error "dtrace: no probes specified". Do you have any idea about this error? ? This is what I do to run the trace - ? 1. I have a script file I run before running dtrace (please see below). The libdvmpi.so file is in the path LD_LIBRARY_PATH. ___________________________________________________ #!/bin/sh LD_LIBRARY_PATH=/usr/home/wluser/dvm/ JAVA_TOOL_OPTIONS=-Xrundvmpi:all export LD_LIBRARY_PATH export JAVA_TOOL_OPTIONS ___________________________________________________ ? 2. I run the "Hello World" application in a loop. ? 3. I have a dtrace script as follows - ______________________________________________________ #!/usr/sbin/dtrace -s dvm$target:::method-entry { self->ts[copyinstr(arg0),copyinstr(arg1)] = vtimestamp; } dvm$target:::method-return { @ts[copyinstr(arg0),copyinstr(arg1)] = sum(vtimestamp - self->ts[copyinstr(arg0),copyinstr(arg1)]); printf("className %s method name %s", copyinstr(arg0), copyinstr(arg1)); } ______________________________________________________ ? I run the above script by executing the command - $> sudo dtrace ./<above_script>.d 4. I get the following error message - "dtrace: no probes specified" ? Could you please help me in finding out the solution to this problem? ? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20080805/84007dd1/attachment.html>
Kelly O''Hair
2008-Aug-05 17:03 UTC
[dtrace-discuss] How to install DTrace/JVMPI for WebLogic
Since libjvm.so is dlopen''d, and the agent is then dlopen''d by libjvm.so, you need to attach to a PID. -kto -- This message posted from opensolaris.org
Adam Leventhal
2008-Aug-05 17:17 UTC
[dtrace-discuss] How to install DTrace/JVMPI for WebLogic
Alteratively, you specify the -Z option to dtrace(1M) which will cause it to ignore enablings that match no probes. Those probes will later be enabled once libjvm.so is loaded. Adam On Tue, Aug 05, 2008 at 10:03:27AM -0700, Kelly O''Hair wrote:> Since libjvm.so is dlopen''d, and the agent is then dlopen''d by libjvm.so, you need to attach to a PID. > > -kto > > > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
Guy With Question
2008-Aug-05 19:23 UTC
[dtrace-discuss] How to install DTrace/JVMPI for WebLogic
Hi Adam, ? I tried the -Z option ? $> sudo dtrace -Z ./<script>.d ? Where <script>.d is ? _______________________________________________ #!/usr/sbin/dtrace -s dvm$target:::method-entry { self->ts[copyinstr(arg0),copyinstr(arg1)] = vtimestamp; } dvm$target:::method-return { @ts[copyinstr(arg0),copyinstr(arg1)] = sum(vtimestamp - self->ts[copyinstr(arg0),copyinstr(arg1)]); printf("className %s method name %s", copyinstr(arg0), copyinstr(arg1)); } _______________________________________________ The command never returns! ? I''m no good at D language. I do know C but I need to brush up on my pointers concepts. The script above was sent to me by another user on the forum and I do not know if it is correct. Can you please tell me what this program is doing? ? I actully need to set up a working POC. I need to get the number of times an API is?called and the total execution time of that API. I need to do this for boht a stand alone Java application as well as a J2EE app running on WebLogic 8.1 (JDK 1.4.2). ? Thanks! --- On Tue, 8/5/08, Adam Leventhal <ahl at eng.sun.com> wrote: From: Adam Leventhal <ahl at eng.sun.com> Subject: Re: [dtrace-discuss] How to install DTrace/JVMPI for WebLogic To: "Kelly O''Hair" <Kelly.Ohair at Sun.COM> Cc: dtrace-discuss at opensolaris.org Date: Tuesday, August 5, 2008, 10:17 AM Alteratively, you specify the -Z option to dtrace(1M) which will cause it to ignore enablings that match no probes. Those probes will later be enabled once libjvm.so is loaded. Adam On Tue, Aug 05, 2008 at 10:03:27AM -0700, Kelly O''Hair wrote:> Since libjvm.so is dlopen''d, and the agent is then dlopen''d bylibjvm.so, you need to attach to a PID.> > -kto > > > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl _______________________________________________ dtrace-discuss mailing list dtrace-discuss at opensolaris.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20080805/e044eeba/attachment.html>
Sean McGrath - Sun Microsystems Ireland
2008-Aug-06 10:12 UTC
[dtrace-discuss] How to install DTrace/JVMPI for WebLogic
Guy With Question stated: < Hi Adam, < < I tried the -Z option < < $> sudo dtrace -Z ./<script>.d you just need the -s option here, so run like: sudo dtrace -Z -s ./<script>.d Or have ''#!/usr/sbin/dtrace -Zs'' as the first line of the script. Assuming the script is executable and run like ./<script>.d Regards, Sean. . < < Where <script>.d is < < _______________________________________________ < #!/usr/sbin/dtrace -s < dvm$target:::method-entry < { < self->ts[copyinstr(arg0),copyinstr(arg1)] = vtimestamp; < } < dvm$target:::method-return < { < @ts[copyinstr(arg0),copyinstr(arg1)] = sum(vtimestamp - < self->ts[copyinstr(arg0),copyinstr(arg1)]); < printf("className %s method name %s", copyinstr(arg0), copyinstr(arg1)); < } < _______________________________________________ < The command never returns! < < I''m no good at D language. I do know C but I need to brush up on my pointers < concepts. The script above was sent to me by another user on the forum and I < do not know if it is correct. Can you please tell me what this program is < doing? < < I actully need to set up a working POC. I need to get the number of times an < API is called and the total execution time of that API. I need to do this for < boht a stand alone Java application as well as a J2EE app running on WebLogic < 8.1 (JDK 1.4.2). < < Thanks! < --- On Tue, 8/5/08, Adam Leventhal <ahl at eng.sun.com> wrote: < < From: Adam Leventhal <ahl at eng.sun.com> < Subject: Re: [dtrace-discuss] How to install DTrace/JVMPI for WebLogic < To: "Kelly O''Hair" <Kelly.Ohair at Sun.COM> < Cc: dtrace-discuss at opensolaris.org < Date: Tuesday, August 5, 2008, 10:17 AM < < Alteratively, you specify the -Z option to dtrace(1M) which will cause it to < ignore enablings that match no probes. Those probes will later be enabled < once libjvm.so is loaded. < < Adam < < On Tue, Aug 05, 2008 at 10:03:27AM -0700, Kelly O''Hair wrote: < > Since libjvm.so is dlopen''d, and the agent is then dlopen''d by < libjvm.so, you need to attach to a PID. < > < > -kto < > < > < > -- < > This message posted from opensolaris.org < > _______________________________________________ < > dtrace-discuss mailing list < > dtrace-discuss at opensolaris.org < < -- < Adam Leventhal, Fishworks http://blogs.sun.com/ahl < _______________________________________________ < dtrace-discuss mailing list < dtrace-discuss at opensolaris.org < _______________________________________________ < dtrace-discuss mailing list < dtrace-discuss at opensolaris.org -- Sean. .
Vicky Li
2008-Aug-06 11:23 UTC
[dtrace-discuss] How to install DTrace/JVMPI for WebLogic8.1/Java
Hi, $target is special, it is replaced by a pid following "-p". You don''t specify pid using "-p". try sudo dtrace ./<above_script>.d -p [the pid of your app]. Vicky ----- Original Message ----- From: Guy With Question To: dtrace-discuss at opensolaris.org Sent: Wednesday, August 06, 2008 12:19 AM Subject: Re: [dtrace-discuss] How to install DTrace/JVMPI for WebLogic8.1/Java Hi, Thanks for your reply. I downloaded the DVM. I''m trying to run dtrace on a standalone, looping, "Hello World!" application, but I get the error "dtrace: no probes specified". Do you have any idea about this error? This is what I do to run the trace - 1. I have a script file I run before running dtrace (please see below). The libdvmpi.so file is in the path LD_LIBRARY_PATH. ___________________________________________________ #!/bin/sh LD_LIBRARY_PATH=/usr/home/wluser/dvm/ JAVA_TOOL_OPTIONS=-Xrundvmpi:all export LD_LIBRARY_PATH export JAVA_TOOL_OPTIONS ___________________________________________________ 2. I run the "Hello World" application in a loop. 3. I have a dtrace script as follows - ______________________________________________________ #!/usr/sbin/dtrace -s dvm$target:::method-entry { self->ts[copyinstr(arg0),copyinstr(arg1)] = vtimestamp; } dvm$target:::method-return { @ts[copyinstr(arg0),copyinstr(arg1)] = sum(vtimestamp - self->ts[copyinstr(arg0),copyinstr(arg1)]); printf("className %s method name %s", copyinstr(arg0), copyinstr(arg1)); } ______________________________________________________ I run the above script by executing the command - $> sudo dtrace ./<above_script>.d 4. I get the following error message - "dtrace: no probes specified" Could you please help me in finding out the solution to this problem? Thanks in advance! ------------------------------------------------------------------------------ _______________________________________________ dtrace-discuss mailing list dtrace-discuss at opensolaris.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20080806/2ff74e0b/attachment.html>