0N/A================================
0N/A'hotspot_jni' PROBES DESCRIPTION
0N/A================================
0N/A
0N/AThis directory contains D scripts which demonstrate usage of 'hotspot_jni'
0N/Aprovider probes.
0N/A
0N/AIn order to call from native code to Java code, due to embedding of the VM
0N/Ain an application or execution of native code within a Java application, the
0N/Anative code must make a call through the JNI interface. The JNI interface
0N/Aprovides a number of methods for invoking Java code and examining the state
0N/Aof the VM. DTrace probes are provided at the entry point and return point
0N/Afor each of these methods. The probes are provided by the hotspot_jni
0N/Aprovider. The name of the probe is the name of the JNI method, appended with
0N/A"-entry" for entry probes, and "-return" for return probes. The arguments
0N/Aavailable at each entry probe are the arguments that were provided to the
0N/Afunction (with the exception of the Invoke* methods, which omit the
0N/Aarguments that are passed to the Java method). The return probes have the
0N/Areturn value of the method as an argument (if available).
0N/A
0N/AYou can find more information about HotSpot probes here:
0N/Ahttp://java.sun.com/javase/6/docs/technotes/guides/vm/dtrace.html
0N/A
0N/A===========
0N/ATHE SCRIPTS
0N/A===========
0N/A
0N/AThe following scripts/samples which demonstrate hotspot_jni probes usage are
0N/Aavailable:
0N/A
0N/A- CriticalSection.d
0N/A Inspect a JNI application for Critical Section violations.
0N/A
0N/A- CriticalSection_slow.d
0N/A Do the same as CriticalSection.d but provide more debugging info.
0N/A
0N/A- hotspot_jni_calls_stat.d
0N/A This script collects statistics about how many times particular JNI method
0N/A has been called.
0N/A
0N/A- hotspot_jni_calls_tree.d
0N/A The script prints tree of JNI method calls.
0N/A
0N/ASee more details in the scripts.
0N/A
0N/A
0N/A==========
0N/AHOW TO RUN
0N/A==========
0N/ATo run any dscript from hotspot directory you can do either:
0N/A
0N/A # dscript.d -c "java ..."
0N/A
0N/A or if you don't have Solaris 10 patch which allows to specify probes that
0N/A don't yet exist ( Hotspot DTrace probes are defined in libjvm.so and as
0N/A result they could be not been yet loaded when you try to attach dscript to
0N/A the Java process) do:
0N/A
0N/A # ../helpers/dtrace_helper.d -c "java ..." dscript.d
0N/A
0N/A or if your application is already running you can just simply attach
0N/A the D script like:
0N/A
0N/A # dscript.d -p JAVA_PID