jbachorik/btrace2

语言: Java

git: https://github.com/jbachorik/btrace2

README.md (中文)

BTrace

2.0

重要

2.0版是增强BTrace模块化的概念证明。它已经蛰伏了相当长的一段时间,并且没有时间估计它的工作何时会持续下去。请注意,可能存在严重错误或遗漏,导致此版本不适合在生产中使用。

快速摘要

BTrace是Java平台的安全,动态跟踪工具。

BTrace可用于动态跟踪正在运行的Java程序(类似于OpenSolaris应用程序和操作系统的DTrace)。 BTrace动态检测目标应用程序的类以注入跟踪代码(“字节码跟踪”)。

建立BTrace

建立

您将需要安装以下应用程序

  • JDK(首选JDK8)
  • 水银
  • Maven3

建立

cd <btrace>
mvn --also-make --projects dist install verify

二进制dist包可以在<btrace> / dist / target中找到.tar.gz和.zip文件

使用BTrace

安装

将二进制分发文件(.tar.gz或.zip)分解到您选择的目录

您可以将系统环境变量BTRACE_HOME设置为指向包含爆炸分布的目录。

为方便起见,您可以使用$ BTRACE_HOME / bin增强系统环境变量PATH。

运行

  • <btrace> / bin / btrace <PID> <trace_script>将附加到具有给定PID的java应用程序并编译并提交跟踪脚本
  • <btrace> / bin / btracec <trace_script>将编译提供的跟踪脚本
  • <btrace> / bin / btracer <compiled_script> <args启动java app>将启动指定的java应用程序,运行btrace代理并且之前由btracec编译的脚本已加载

有关详细的用户指南,请查看Wiki。

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

BTrace

Version

2.0

Important

Version 2.0 is a proof of concept for enhanced BTrace modularization. It has been dormant for quite a long time and there is no time estimate when the work on it would continue. Please note that there might be severe errors or omissions making this version not suitable for usage in production.

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

Building BTrace

Setup

You will need the following applications installed

Build

cd <btrace>
mvn --also-make --projects dist install verify

The binary dist packages can be found in <btrace>/dist/target as the .tar.gz and .zip files

Using BTrace

Installation

Explode a 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.

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.