btraceio / btrace

BTrace - a safe, dynamic tracing tool for the Java platform
5.82k stars 959 forks source link
btrace java java-application java-platform

Dev build Download codecov.io huhu Join the chat at https://gitter.im/jbachorik/btrace Project Stats

btrace

A safe, dynamic tracing tool for the Java platform

Version

2.2.4

Quick Summary

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").

Credits

Building BTrace

Setup

You will need the following applications installed

Build

Gradle

cd <btrace>
./gradlew :btrace-dist:build

The binary dist packages can be found in <btrace>/btrace-dist/build/distributions as the .tar.gz, .zip, .rpm and .deb files. The exploded binary folder which can be used right away is located at <btrace>/btrace-dist/build/resources/main which serves as the __BTRACE_HOME__ location.

Using BTrace

Installation

Download a distribution file from the release page. Explode the binary distribution file (either .tar.gz or .zip) to a directory of your choice.

You may set the system environment variable __BTRACE_HOME__ to point to the directory containing the exploded distribution.

You may enhance the system environment variable PATH with __$BTRACE_HOME/bin__ for your convenience.

Or, alternatively, you may install one of the .rpm or .deb packages

Running

For the detailed user guide, please, check the Wiki.

Maven Integration

The maven plugin is providing easy compilation of BTrace scripts as a part of the build process. As a bonus you can utilize the BTrace Project Archetype to bootstrap developing BTrace scripts.

Contributing - !!! Important !!!

Pull requests can be accepted only from the signers of Oracle Contributor Agreement

Deb Repository

Using the command line, add the following to your /etc/apt/sources.list system config file:

echo "deb http://dl.bintray.com/btraceio/deb xenial universe" | sudo tee -a /etc/apt/sources.list

Or, add the repository URLs using the "Software Sources" admin UI:

deb http://dl.bintray.com/btraceio/deb xenial universe

RPM Repository

Grab the *.repo file wget https://bintray.com/btraceio/rpm/rpm -O bintray-btraceio-rpm.repo and use it.