0N/A============================
0N/A'hotspot' PROBES DESCRIPTION
0N/A============================
0N/A
0N/AThis directory contains D scripts which demonstrate usage of 'hotspot' provider probes.
0N/A
0N/AThe 'hotspot' provider makes available probes that can be used to track the
0N/Alifespan of the VM, thread start and stop events, GC and memory pool
0N/Astatistics, method compilations, and monitor activity. With a startup flag,
0N/Aadditional probes are enabled which can be used to monitor the running Java
0N/Aprogram, such as method enter and return probes, and object allocations. All
0N/Aof the hotspot probes originate in the VM library (libjvm.so), so they are
0N/Aalso provided from programs which embed the VM.
0N/A
0N/AMany of the probes in the provider have arguments that can be examined to
0N/Aprovide further details on the state of the VM. Many of these probes'
0N/Aarguments are opaque IDs which can be used to link probe firings to each
0N/Aother, however strings and other data are also provided. When string values
0N/Aare provided, they are always present as a pair: a pointer to unterminated
0N/Amodified UTF-8 data (see JVM spec: 4.4.7) , and a length value which
0N/Aindicates the extent of that data. Because the string data (even when none
0N/Aof the characters are outside the ASCII range) is not guaranteed to be
0N/Aterminated by a NULL character, it is necessary to use the length-terminated
0N/Acopyinstr() intrinsic to read the string data from the process.
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/A===========
0N/ATHE SCRIPTS
0N/A===========
0N/A
0N/AThe following scripts/samples which demonstrate 'hotspot' probes usage are
0N/Aavailable:
0N/A
0N/A- class_loading_stat.d
0N/A The script collects statistics about loaded and unloaded Java classes and
0N/A dump current state to stdout every N seconds.
0N/A
0N/A- gc_time_stat.d
0N/A The script measures the duration of a time spent in GC.
0N/A The duration is measured for every memory pool every N seconds.
0N/A
0N/A- hotspot_calls_tree.d
0N/A The script prints calls tree of fired 'hotspot' probes.
0N/A
0N/A- method_compile_stat.d
0N/A The script prints statistics about N methods with largest/smallest
0N/A compilation time every M seconds.
0N/A
0N/A- method_invocation_stat.d
0N/A The script collects statistics about Java method invocations.
0N/A
0N/A- method_invocation_stat_filter.d
0N/A The script collects statistics about Java method invocations.
0N/A You can specify package, class or method name to trace.
0N/A
0N/A- method_invocation_tree.d
0N/A The script prints tree of Java and JNI method invocations.
0N/A
0N/A- monitors.d
0N/A The script traces monitor related probes.
0N/A
0N/A- object_allocation_stat.d
0N/A The script collects statistics about N object allocations every M seconds.
0N/A
0N/A
0N/A==========
0N/AHOW TO RUN
0N/A==========
0N/A
0N/ATo run any D script 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 D script 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