I am using DTrace from time to time and it is really nice, you can do a lot with it.
This page is mostly a reminder to myself cause there are tons of pages out there if you google it, but I figured that why not share the knowledge 🙂
List all Probes available in a process
1 2 3 4 5 6 7 8 |
# <strong>dtrace -ln 'pid$target:::entry' -p 809</strong> ID PROVIDER MODULE FUNCTION NAME 62650 pid809 bash __fsr entry 62651 pid809 bash main entry 62652 pid809 bash exit_shell entry 62653 pid809 bash sh_exit entry 62654 pid809 bash shell_is_restricted entry [...6778 lines truncated...] |
 List all probes that has to do with the JAVA JVM Hotspot
dtrace -l | grep hotspot
Figure out WHO initiated the Garbage Collection (GC)
dtrace -n ‘hotspot$target:::gc-begin { jstack(); }’ -p 25736
1 2 3 4 5 6 7 8 9 |
dtrace: description 'hotspot$target:::gc-begin ' matched 4 probes CPU ID FUNCTION:NAME 0 54737 __1cRVM_GenCollectFullEdoit6M_v_:gc-begin libjvm.so`__1cRVM_GenCollectFullEdoit6M_v_+0x24 libjvm.so`__1cMVM_OperationIevaluate6M_v_+0x79 libjvm.so`__1cIVMThreadDrun6M_v_+0x548 libjvm.so`java_start+0x9d2 libc.so.1`_thr_setup+0x5b libc.so.1`_lwp_start |
JVM Probes
http://docs.oracle.com/javase/6/docs/technotes/guides/vm/dtrace.html
Figure out what objects are being allocated using DTrace
http://prefetch.net/blog/index.php/2007/10/31/using-the-dtrace-hotspot-provider-to-observe-java-object-allocations/
JVM: Unable to open door
1 2 |
$ <b>jinfo -flag +ExtendedDTraceProbes `pgrep java`</b> 590: Unable to open door: target process not responding or HotSpot VM not loaded |
The jinfo command needs to be run by the user the JVM runs as.