Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/solaris/sample/dtrace/hotspot/README.txt
32287 views
============================1'hotspot' PROBES DESCRIPTION2============================34This directory contains D scripts which demonstrate usage of 'hotspot' provider probes.56The 'hotspot' provider makes available probes that can be used to track the7lifespan of the VM, thread start and stop events, GC and memory pool8statistics, method compilations, and monitor activity. With a startup flag,9additional probes are enabled which can be used to monitor the running Java10program, such as method enter and return probes, and object allocations. All11of the hotspot probes originate in the VM library (libjvm.so), so they are12also provided from programs which embed the VM.1314Many of the probes in the provider have arguments that can be examined to15provide further details on the state of the VM. Many of these probes'16arguments are opaque IDs which can be used to link probe firings to each17other, however strings and other data are also provided. When string values18are provided, they are always present as a pair: a pointer to unterminated19modified UTF-8 data (see JVM spec: 4.4.7) , and a length value which20indicates the extent of that data. Because the string data (even when none21of the characters are outside the ASCII range) is not guaranteed to be22terminated by a NULL character, it is necessary to use the length-terminated23copyinstr() intrinsic to read the string data from the process.2425You can find more information about HotSpot probes here:26http://java.sun.com/javase/6/docs/technotes/guides/vm/dtrace.html272829===========30THE SCRIPTS31===========3233The following scripts/samples which demonstrate 'hotspot' probes usage are34available:3536- class_loading_stat.d37The script collects statistics about loaded and unloaded Java classes and38dump current state to stdout every N seconds.3940- gc_time_stat.d41The script measures the duration of a time spent in GC.42The duration is measured for every memory pool every N seconds.4344- hotspot_calls_tree.d45The script prints calls tree of fired 'hotspot' probes.4647- method_compile_stat.d48The script prints statistics about N methods with largest/smallest49compilation time every M seconds.5051- method_invocation_stat.d52The script collects statistics about Java method invocations.5354- method_invocation_stat_filter.d55The script collects statistics about Java method invocations.56You can specify package, class or method name to trace.5758- method_invocation_tree.d59The script prints tree of Java and JNI method invocations.6061- monitors.d62The script traces monitor related probes.6364- object_allocation_stat.d65The script collects statistics about N object allocations every M seconds.666768==========69HOW TO RUN70==========7172To run any D script from hotspot directory you can do either:7374# dscript.d -c "java ..."7576or if you don't have Solaris 10 patch which allows to specify probes that77don't yet exist ( Hotspot DTrace probes are defined in libjvm.so and as78result they could be not been yet loaded when you try to attach D script to79the Java process) do:8081# ../helpers/dtrace_helper.d -c "java ..." dscript.d8283or if your application is already running you can just simply attach84the D script like:8586# dscript.d -p JAVA_PID878889