< prev index next >

core/org.openjdk.jmc.agent/README.md

Print this page


   1 # The JMC Agent
   2 The JMC agent is an agent currently under development to add JFR instrumentation declaratively to a running program. The agent can, for example, be used to add flight recorder events to third party code for which the source is not available.
   3 
   4 To build the agent you will need a JDK 7 or later. To run the agent, a JDK 7 or later will be needed as well.
   5 
   6 ## Building the agent
   7 To build the agent, simply use maven in the agent folder. Since the agent is not ready for prime time yet, it is not built with the rest of the core libraries.
   8 
   9 ```bash
  10 mvn clean package
  11 ```
  12 
  13 ## Running the agent
  14 The agent can be tried out using the included example program.
  15 
  16 Here is an example for running the example program with JDK 7 or JDK 8:
  17 
  18 ```bash
  19 java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -javaagent:target/org.openjdk.jmc.agent-1.0.0-SNAPSHOT.jar=target/test-classes/org/openjdk/jmc/agent/test/jfrprobes_template.xml -cp target/org.openjdk.jmc.agent-1.0.0-SNAPSHOT.jar:target/test-classes/ org.openjdk.jmc.agent.test.InstrumentMe
  20 ```
  21 






  22 ## Known Issues
  23 * The full converter support is still to be merged into the open source repo
  24 * Support for emitting an event only on exception has yet to be implemented
  25 * Support for reflective access to fields has yet to be implemented
  26 * Support for emitting event even though an exception was raised in a called method (try-finally)
  27 * XML probe definition validation (schema)
  28 * Support for redefinitions and controlling the agent over JMX is not yet completed
   1 # The JMC Agent
   2 The JMC agent is an agent currently under development to add JFR instrumentation declaratively to a running program. The agent can, for example, be used to add flight recorder events to third party code for which the source is not available.
   3 
   4 To build the agent you will need a JDK 7 or later. To run the agent, a JDK 7 or later will be needed as well.
   5 
   6 ## Building the agent
   7 To build the agent, simply use maven in the agent folder. Since the agent is not ready for prime time yet, it is not built with the rest of the core libraries.
   8 
   9 ```bash
  10 mvn clean package
  11 ```
  12 
  13 ## Running the agent
  14 The agent can be tried out using the included example program.
  15 
  16 Here is an example for running the example program with Oracle JDK 7 to Oracle JDK 10:

  17 
  18 ```bash
  19 java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -javaagent:target/org.openjdk.jmc.agent-1.0.0-SNAPSHOT.jar=target/test-classes/org/openjdk/jmc/agent/test/jfrprobes_template.xml -cp target/org.openjdk.jmc.agent-1.0.0-SNAPSHOT.jar:target/test-classes/ org.openjdk.jmc.agent.test.InstrumentMe
  20 ```
  21 
  22 Here is an example for running the example program with OpenJDK 11+:

  23 

  24 ```bash

  25 java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -XX:+FlightRecorder -javaagent:target/org.openjdk.jmc.agent-1.0.0-SNAPSHOT.jar=target/test-classes/org/openjdk/jmc/agent/test/jfrprobes_template.xml -cp target/org.openjdk.jmc.agent-1.0.0-SNAPSHOT.jar:target/test-classes/ org.openjdk.jmc.agent.test.InstrumentMe

  26 ```

  27 

  28 ## Known Issues
  29 * The full converter support is still to be merged into the open source repo
  30 * Support for emitting an event only on exception has yet to be implemented
  31 * Support for reflective access to fields has yet to be implemented
  32 * Support for emitting event even though an exception was raised in a called method (try-finally)
  33 * XML probe definition validation (schema)
  34 * Support for redefinitions and controlling the agent over JMX is not yet completed
< prev index next >