• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

btraceio/btrace: BTrace - a safe, dynamic tracing tool for the Java platform

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

btraceio/btrace

开源软件地址:

https://github.com/btraceio/btrace

开源编程语言:

Java 99.1%

开源软件介绍:

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.2

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

  • Git
  • JDKs - JDK 8, Java 9 and Java 11 are required to be available
  • (optionally, the default launcher is the bundled gradlew wrapper) Gradle

In order to ease the pre-build config the config_build.sh script is provided. You should run it first as source config_build.sh to automatically download all required JDKs and set up the corresponding JAVA_*_HOME env variables.

Build

Java

Your JAVA_HOME must point to JDK 11 (eg. JAVA_11_HOME)

Gradle

cd <btrace>
./gradlew build
./gradlew buildDistributions

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

  • <btrace>/bin/btrace <PID> <trace_script> will attach to the java application with the given PID and compile and submit the trace script
  • <btrace>/bin/btracec <trace_script> will compile the provided trace script
  • <btrace>/bin/btracer <compiled_script> <args to launch a java app> will start the specified java application with the btrace agent running and the script previously compiled by btracec loaded

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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap