https://github.com/mlopatkin/jdk-instrument
https://github.com/mlopatkin/jdk-instrument
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mlopatkin/jdk-instrument
- Owner: mlopatkin
- Archived: true
- Created: 2022-01-11T16:31:18.000Z (over 3 years ago)
- Default Branch: trunk
- Last Pushed: 2022-01-20T15:39:37.000Z (over 3 years ago)
- Last Synced: 2025-02-08T21:11:54.284Z (3 months ago)
- Language: Java
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Intercepting JDK method calls with agent-based instrumentation
==============================================================This project investigates how to use ByteBuddy to instrument core JDK classes and signed JARs to intercept certain
"interesting" methods.Run `./gradlew run` to see it in action.
The project is structured as follows:
- `agent` - the Java agent implemented with ByteBuddy that performs instrumentation.
- `buildSrc` - a set of convention plugins to set up stuff.
- `interceptor` - a library that goes into bootclasspath. The instrumented code calls into it. The code that wants to
observe the instrumented calls registers callbacks into it too.
- `interceptor-advices` - ByteBuddy advices used to declare how to instrument classes. These are used in both agent
based and classloader-based instrumentations, though the latter cannot instrument JDK classes.
- `test-app-classloader-instrument` - an implementaton that uses a custom classloader to instrument classes as they
are loaded.
- `test-app-premain-init` - a launcher that configures agent and bootclasspath with command-line switches.
- `test-app-runtime-init` - a launcher that installs agent and bootclasspath at runtime.
- `test-app-ondisk-instument` - instruments JAR files on disk and then loads them at runtime. As the signed JAR is
instrumented, the run fails with `SecurityException`.
- `test-core` - a core implementation of the launcher, independent of the way agent is set up.