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.

Hi, This is NOT btrace's official site, the official site is:, but I'd like to introduce btrace to everyone.

BTrace 2 is also on the way:


btrace [-I <include-path>] [-p <port>] [-cp <classpath>] <pid> <btrace-script> [<args>]


btracec [-I <include-path>] [-cp <classpath>] [-d <directory>] <>

Run on startup:

java -javaagent:btrace-agent.jar=script=<pre-compiled-btrace-script1>[,<pre-compiled-btrace-script1>]* <MainClass> <AppArguments>



Signed by: 6FAF C0E0 1709 85AA 7154 5483 C794 B164 6A88 6CD6, my keybase profile:

More versions download:


This is my simple btrace script generator:

BTrace with OSGI

Similar tool:Byteman