JDK-8146454 : Add support for module aware agents
  • Type: Task
  • Component: core-svc
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-01-05
  • Updated: 2017-01-18
  • Resolved: 2016-04-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8147465 :  
JDK-8147467 :  
Description
This task tracks the updates to JVM TI and java.lang.instrument to allow agents instrument code in named modules. Specifically it requires:

1. Adding support for an early JVM TI Start phase to allow agents get CFLH early during VM and module system initialisation.

2. Investigating whether the CompiledMethodLoad and DynamicCodeGenerated event can be sent in the Start phase.

3. Adding a new transform method to ClassFileTransformer that provides the transformer with the Module of the class that is being loaded/redefined.

4. Agents doing dynamic instrumentation cannot add class initializers and so will likely need a way to add arbitrary read edges. JVM TI agents can use the JNI functions to do that. Java agents will need further consideration.



Comments
We agreed with Alan to close this task as fixed. The comment from Alan above tells that most of the changes were already pushed. A couple of problems that we may need to fix are covered by the separate task: https://bugs.openjdk.java.net/browse/JDK-8155207 minor update for module aware agents
27-04-2016

Most of the support for module aware agents went into JDK 9 as part of the module system in jdk-9+111. JDK-8153749 is in progress to add an additional capability that will allow agents get the CFLH in the primordial phase. Remaining issues that need examination are: 1. There is currently isn't a way for agents to get the Module in a ClassFileLoadHook event for a class load (for a retransform then class_being_redefined is non-NULL and so the agent can use JNI GetModule). 2. Should the new transform method in ClassFileTransformer provide the ClassLoader in addition to the Module?
25-04-2016