This location is being phased out. Please, continue with BTrace@GitHub
BTrace is a safe, dynamic tracing tool for the Java platform. BTrace can be used to dynamically trace a running Java program (similar to DTrace for OpenSolaris applications and OS). BTrace dynamically instruments the classes of the target application to inject tracing code ("bytecode tracing"). Tracing code is expressed in Java programming language. There is also integration with DTrace for the OpenSolaris platform.
You can enhance VisualVM with the BTrace plugin to be able to write and deploy BTrace scripts directly from VisualVM. Alternatively, if you'd prefer you can run BTrace from command line shells as well.
There is also a NetBeans integration that makes it easier to write and deploy BTrace scripts. For your convenience you can directly install the BTrace Update Center definition which gives you access to the integration modules right from within the IDE plugin manager.
BTrace is available under GNU Public License v.2 w/Classpath Exception.
Actual BTrace binary realease is available for download from Documents & files link.
BTrace binaries are available as Maven artifacts as well. You can get them here
BTrace sources are available from Mercurial repository. After checking out the sources, you can use NetBeans to build BTrace using the NetBeans project setup instructions. There is also a BTrace Developer's Guide.
- JVM crash: We have seen JVM crashes with BTrace. We have fixed few such crashes as well. JVM could crash due to the following reasons:
- BTrace submits invalid .class file to VM (bug in BTrace instrumentor)
- Hotswap bug in HotSpot JVM.
To enable debugging such scenarios, please turn on the following options in $BTRACE/bin/btrace (or btrace.bat) script. By default, the System properties com.sun.btrace.debug amd com.sun.btrace.dumpClasses are set to false in the scripts. Please change these to true. Also, you may want to add -verify:all option as well - which will force bytecode verification of all loaded classes. When you report a JVM crash with BTrace, please attach/send the following:
- BTrace trace class that caused the crash.
- hs_err_pidXXX log produced by JVM.
- *.class file(s) saved by BTrace setting the com.sun.btrace.dumpClasses option.
- debug output from BTrace by setting the com.sun.btrace.debug option.
If you like BTrace and want to contribute fixes/features to BTrace, your are always welcome! You (or your company) have to sign the Sun Contributor Agreement. Then, please join this project as "developer" using your kenai.com id.
- Who is calling this method?
- BTrace Script Concepts
- Using VisualVM, BTrace & Good Old Web Search
- Analysing Memory Leaks with BTrace
- btrace for performance tuning
- BTrace the ultimate JVM probe
- Socket Monitoring: Now Using BTrace
- BTrace Fix on the Mac
- Using BTrace in Java 6
- BTrace == DTrace for Java
- BTrace showing promises
- SailFin work and BTrace
- Runtime profiling and monitoring Java apps with btrace