IcedTea Java Virtual Machine User-Space Markers
Newer versions of the IcedTea Java Virtual Machine include support for SystemTap user-space markers. The IcedTea JVM user-space markers are enabled in Fedora 10 and Red Hat Enterprise Linux 6. The markers allow SystemTap to probe various JVM events including loading of classes, just-in-time translation of method, and garbage collection. The SystemTap user-space probe points for IcedTea JVM are based on match on the !DTrace markers for JVM. You can refer to the documentation in DTrace Probes in HotSpot VM (note DTrace arguments start at 0 and SystemTap arguments start at 1)
Using IcedTea JVM User-Space Markers
To use the IcedTea JVM user-space markers on a Fedora you will need:
- RPMs:
- java-1.6.0-openjdk
- java-1.6.0-openjdk-devel
- java-1.6.0-openjdk-debuginfo
- systemtap
- Membership to the stapdev group (or root access)
- A uprobes module built for the currently running kernel
(SystemTap will print instruction on how to build the uprobes module if one is not currently available)
Examples and Demonstrations of Markers
Some one liners SystemTap scripts:
- Trace what methods are being compiled on the JVM:
stap -e 'probe hotspot.method_compile_begin { log(probestr) }'
- Trace garbage collection on the JVM:
stap -e 'probe hotspot.gc_* {printf("%d %s\n", gettimeofday_us(), probestr)}'
- Trace what classes are loaded:
stap -e 'probe hotspot.class_loaded { log(probestr) }'
You can look at tapset files for more information about the probe points (replace x86_64 with the appropriate architecture):
/usr/share/systemtap/tapset/x86_64/hotspot.stp
/usr/share/systemtap/tapset/x86_64/hotspot_jni.stp
/usr/share/systemtap/tapset/x86_64/jstack.stp
A number of examples Java scripts are available at http://icedtea.classpath.org/~vanaltj/stapexamples/
A short video demonstration of the IcedTea user-space markers.