/java-profiler

I wanted to add demangling, so I forked this bad boy

Primary LanguageC++Apache License 2.0Apache-2.0

Datadog Java Profiler Library

Based on async-profiler 2.8.3

Disclaimer

This is not a fork of async-profiler. This is a work derived from async-profiler but tailored very specifically for Datadog needs. If you need a full-fledged Java profiler head back to async-profiler

Usage

!TODO!

Build

Prerequisites

  1. This project contains Java code and is built by gradle, as such, you need to install a JDK in order to build it. Run brew install openjdk to install it on MacOS. If building and testing on Apple Silicon (M1+), be sure to install an aarch64 OpenJDK distribution, otherwise the architecture used for compilation and the JVM based test suite will not match, which means the tests will not be able to load the dynamic library at runtime.
  2. The build requires cmake, which is included in XCode, but can also be installed by running brew install cmake

Once prerequisites have been installed simple as ./gradlew build. The resulting artifact is located in ddprof-lib/build/libs/ddprof-<version>.jar

Consuming the artifact

For dd-trace-java you just need to set the java.profiler.jar project property. Eg. you can run the gradle build like this - ./gradlew clean -Pjava.profiler.jar=file://<path-to-artifact.jar> :dd-java-agent:shadowJar- which will result in a customdd-java-agent.jar` build containing your test version of Java profiler.