RFR: 8257967: JFR: Events for loaded agents [v15]

Markus Grönlund mgronlun at openjdk.org
Wed Apr 5 09:48:23 UTC 2023


On Wed, 5 Apr 2023 06:55:16 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> I changed the names because I found it very hard to understand what the old names represented: "AgentLibrary" vs "Library"? "add_init_agent" vs "add_instrumentation_agent", or even "add_loaded_agent"? Also a bit confusing that "load_agent_library" would also include statically linked agents - no library is loaded there.
>
> Okay.
> Refactoring is usually not easy to review.
> With a renaming it becomes harder, so it is better to be conservative.
> 
> There are other side effects to consider:
> 
>   - back porting also becomes harder
>   - developers have to learn new names instead of already known
>   
> The good side is that your refactoring consolidates this code in a well known locations. :-)

Of course, I would not have changed this unless I believe it improves things. The abstraction is now better from the perspective of the rest of the VM. There are now only JVMTI agents, and they are kept in a list. Arguments.cpp adds agents to the list. The same thing for the diagnosticCommand.cpp for dynamically loaded agents. Threads.cpp loads the JVMTI agents, java.cpp unloads agents. All other sites take out an iterator of the subtypes they want to iterate.

There is no longer any separation between "agent" and "library"; the subtypes of the agents are now abstracted away.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/12923#discussion_r1158282424


More information about the serviceability-dev mailing list