Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8354069

jcmd JVMTI.agent_load support on static JDK

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • None

      The issue was noticed by JDK-8353938. There are related context on both JDK-8353938 and https://github.com/openjdk/jdk/pull/24497 comments.

      From jcmd man page:
      ```
      JVMTI.agent_load [arguments]
      Loads JVMTI native agent.
        Impact: Low
      arguments:
        library path: Absolute path of the JVMTI agent to load. (STRING, no default value)
        agent option: (Optional) Option string to pass the agent. (STRING, no default value)
      ```

      With static JDK support, when an agent library is statically linked (built-in) with the launcher executable, the underlying JDK/VM is able to find/load the built-in native agent even though there is no lib<agent>.so available, if one specifies the command as below:

         JVMTI.agent_load lib<agent>.so

      In the above example, the native agent is specified without providing the absolute path.

      With the static support, when the agent is statically linked, specifying a native agent as a shared library for the `JVMTI.agent_load` command may trigger questions. It might be helpful to clarify the command argument for such usage and describe that the built-in agent library would be found and loaded in such a case. An alternative suggestion from [~alanb] is to provide a different command or argument so one could specify the native agent name instead of in path format.

            Unassigned Unassigned
            jiangli Jiangli Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: