Attach to a running production Java process and trace specific method calls without restarting the application.
Capture method arguments and return values in real time to diagnose a performance or correctness issue in production.
Pre-compile a BTrace script with btracec to validate it before attaching it to a live application.
Scripts must follow BTrace's safety restrictions and the app must expose a JVM attach port, attaching to production may require explicit JVM flags.
BTrace is a tool that lets you inspect a running Java application without stopping or modifying it. You write a small script that describes what you want to trace (for example, which methods to watch, what data to capture, or when to print output), then point BTrace at the process ID of a running Java application. BTrace injects the tracing instructions directly into the running application's bytecode, gathers the information, and returns it to you, all without restarting the application or changing its source code. The concept is similar to DTrace, a system-level tracing tool available on some Unix-based operating systems. BTrace brings the same general idea to the Java Virtual Machine layer: observe what a program is doing in production without interrupting it. The tool is designed to be safe by limiting what a tracing script can do, so it cannot crash or permanently alter the application it is attached to. Using BTrace involves three command-line tools. The btrace command attaches to a running process by its process ID, compiles your script on the spot, and starts the trace. The btracec command pre-compiles a script to a class file if you prefer to validate it separately. The btracer command starts a new Java application with the trace agent already loaded from the beginning. A Maven plugin is also available for projects that want to compile BTrace scripts as part of their build. The README is brief and points readers to the project's Wiki for a full user guide. Contributing code requires signing the Oracle Contributor Agreement before a pull request can be accepted.
← btraceio on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.