Skip to content

Commit

Permalink
Merge pull request #20358 from JasonFengJ9/jfrnatives
Browse files Browse the repository at this point in the history
JFR jcmd commands: JFR.start, JFR.dump, JFR.stop
  • Loading branch information
tajila authored Oct 28, 2024
2 parents 1320353 + eac33e1 commit 806ea70
Show file tree
Hide file tree
Showing 18 changed files with 2,823 additions and 158 deletions.
35 changes: 35 additions & 0 deletions jcl/src/java.base/share/classes/com/ibm/oti/vm/VM.java
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,41 @@ public static Properties internalGetProperties() {
}

/*[IF JFR_SUPPORT]*/
/**
* Check if a JFR recording has been started.
*
* @return true if a JFR recording is in progress, false otherwise
*/
public static native boolean isJFRRecordingStarted();

/**
* JFR.dump - Flush all the thread buffers and write out the global buffer.
*
*/
public static native void jfrDump();

/**
* Set JFR recording file name.
*
* @param fileName the file name for new JFR recording
*
* @return true on success, false on failure
*/
public static native boolean setJFRRecordingFileName(String fileName);

/**
* Start JFR assuming this is after VM startup.
*
* @return 0 on success, -1 on failure
*/
public static native int startJFR();

/**
* Shut down JFR.
*
*/
public static native void stopJFR();

/**
* Trigger ExecutionSample JFR event on all Java threads.
*/
Expand Down
Loading

0 comments on commit 806ea70

Please sign in to comment.