OpenJDK has everything needed for such tracing. There are JVMTI MethodEntry/MethodExit events, `-XX:+DTraceMethodProbes` for tracing with DTrace/SystemTap, Instrumentation API to inject tracing calls into the bytecode (that's how AspectJ works).
– apanginOct 30 '18 at 07:33