Support `aot_training` mode to be used when creating AOT caches by mcculls · Pull Request #10166 · DataDog/dd-trace-java

PerfectSlayer

manuel-alvarez-alvarez

amarziali

@mcculls mcculls changed the title Support 'classpath' mode to be used when creating AOT caches Support aot_training mode to be used when creating AOT caches

Dec 13, 2025
In this mode only the agent jar is added to the boot classpath, no services are started.

Also workaround potential AOT bug where TraceInterceptor is mistakenly restored from the
system class-loader in production, even though it was visible from the boot class-loader
during training, resulting in LinkageErrors.

Any call to Tracer.addTraceInterceptor from application code in the system class-loader
appears to trigger this bug. The workaround is to replace these calls during training
with opcodes that pop the tracer and argument, and push the expected return value.

This transformation is not persisted, so in production the original method is invoked.

@mcculls

@mcculls

PerfectSlayer

PerfectSlayer

@mcculls

@mcculls mcculls deleted the mcculls/support-classpath-only-mode branch

December 15, 2025 10:28

This was referenced

Dec 15, 2025