Based on async-profiler 2.8.3
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
!TODO!
- 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. - The build requires make, which is included in XCode, but can also be installed by running
brew install make
- The build supports googletest for unit testing. To install it, run
brew install googletest
orsudo apt install libgtest-dev
orapk add gtest-dev
depending on your platform. - The build is applying consistent formatting using 'spotless' Gradle plugin. For C/C++ files it will use
clang-format
version 11. To install it, runbrew install clang-format-11
orsudo apt install clang-format-11
orapk add clang-format-11
depending on your platform. If the installed version does not provide/usr/bin/clang-format
executable create a link likesudo ln -s /usr/bin/clang-format-11 /usr/bin/clang-format
in order for the 'spotles' pluging to function correctly.
Once prerequisites have been installed simple as ./gradlew assembleAll
. The resulting artifact is located in ddprof-lib/build/libs/ddprof-<version>.jar
For dd-trace-java you just need to set the ddprof.jar
project property.
Eg. you can run the gradle build like this - ./gradlew clean -Pddprof.jar=file://<path-to-artifact.jar> :dd-java-agent:shadowJar- which will result in a custom
dd-java-agent.jar` build containing your test version of Java profiler.