forked from oracle/graal
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport "Enables parsing units for maxsize, fixes units for delay in JfrManager.java" #282
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes oracle#3638 Example: Unpatched --------- ``` $ export JAVA_HOME=/home/karm/X/JDKs/graalvm-ce-java11-21.2.0/;export PATH=${JAVA_HOME}/bin:${PATH} $ native-image --version GraalVM 21.2.0 Java 11 CE (Java Version 11.0.12+6-jvmci-21.2-b08) $ javac Main.java $ native-image -H:+AllowVMInspection Main $ java -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10M,filename=flight-java.jfr -Xlog:jfr Main [0.279s][info][jfr] Flight Recorder initialized [0.279s][info][jfr] Created repository /tmp/2021_07_30_15_11_00_295289 [0.309s][info][jfr] Creating thread sampler for java:20 ms, native 0 ms [0.309s][info][jfr] Enrolling thread sampler [0.309s][info][jfr] Enrolling thread sampler [0.309s][info][jfr] Updated thread sampler for java: 20 ms, native 0 ms [0.309s][info][jfr] Updated thread sampler for java: 20 ms, native 0 ms [0.309s][info][jfr] Updated thread sampler for java: 20 ms, native 20 ms [0.322s][info][jfr] Started recording "1" (1) {maxsize=10.0MB, dumponexit=true, filename=/tmp/rep/flight-java.jfr} Started recording 1. Use jcmd 295289 JFR.dump name=1 to copy recording data to file. Meh. [0.343s][info][jfr] Updated thread sampler for java: 0 ms, native 20 ms [0.344s][info][jfr] Disenrolling thread sampler [0.344s][info][jfr] Stopped recording "1" (1). Reason "Dump on exit". [0.382s][info][jfr] Wrote recording "1" (1) to /tmp/rep/flight-java.jfr [0.382s][info][jfr] Closed recording "1" (1) [0.383s][info][jfr] Removed repository /tmp/2021_07_30_15_11_00_295289 $ ./main -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10M,filename=flight-native.jfr -XX:FlightRecorderLogging=jfr Exception in thread "main" com.oracle.svm.core.util.UserError$UserException: Could not parse JFR argument 'maxsize=10M'. Expected a number. at com.oracle.svm.core.util.UserError.abort(UserError.java:68) at com.oracle.svm.jfr.JfrManager.parseLong(JfrManager.java:171) at com.oracle.svm.jfr.JfrManager.initRecording(JfrManager.java:107) at com.oracle.svm.jfr.JfrManager.setup(JfrManager.java:72) at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:125) at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:75) ``` Patched ------- ``` $ export JAVA_HOME=/home/karm/tmp/mandrel-java11-21.3-SNAPSHOT/;export PATH=${JAVA_HOME}/bin:${PATH} $ native-image --version native-image 21.3.0-deveab4c4ec5cb5 Mandrel Distribution (Java Version 11.0.12+7) $ native-image -H:+AllowVMInspection Main $ ./main -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10M,filename=flight-native.jfr -XX:FlightRecorderLogging=jfr [info][jfr] Flight Recorder initialized [info][jfr] Created repository /tmp/2021_07_30_15_13_28_295949 [info][jfr] Started recording "1" (1) {maxsize=10.0MB, dumponexit=true, filename=/tmp/rep/flight-native.jfr} Meh. <removed for brevity> $ ./main -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10m,filename=flight-native.jfr -XX:FlightRecorderLogging=jfr [info][jfr] Flight Recorder initialized [info][jfr] Created repository /tmp/2021_07_30_15_13_55_296117 [info][jfr] Started recording "1" (1) {maxsize=10.0MB, dumponexit=true, filename=/tmp/rep/flight-native.jfr} Meh. <removed for brevity> $ ./main -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10k,filename=flight-native.jfr -XX:FlightRecorderLogging=jfr [info][jfr] Flight Recorder initialized [info][jfr] Created repository /tmp/2021_07_30_15_14_00_296178 [info][jfr] Started recording "1" (1) {maxsize=10.0kB, dumponexit=true, filename=/tmp/rep/flight-native.jfr} Meh. <removed for brevity> $ ./main -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10K,filename=flight-native.jfr -XX:FlightRecorderLogging=jfr [info][jfr] Flight Recorder initialized [info][jfr] Created repository /tmp/2021_07_30_15_14_05_296238 [info][jfr] Started recording "1" (1) {maxsize=10.0kB, dumponexit=true, filename=/tmp/rep/flight-native.jfr} Meh. <removed for brevity> $ ./main -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10g,filename=flight-native.jfr -XX:FlightRecorderLogging=jfr [info][jfr] Flight Recorder initialized [info][jfr] Created repository /tmp/2021_07_30_15_14_11_296302 [info][jfr] Started recording "1" (1) {maxsize=10.0GB, dumponexit=true, filename=/tmp/rep/flight-native.jfr} Meh. <removed for brevity> $ ./main -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10G,filename=flight-native.jfr -XX:FlightRecorderLogging=jfr [info][jfr] Flight Recorder initialized [info][jfr] Created repository /tmp/2021_07_30_15_16_04_296529 [info][jfr] Started recording "1" (1) {maxsize=10.0GB, dumponexit=true, filename=/tmp/rep/flight-native.jfr} Meh. <removed for brevity> ``` Signed-off-by: Michal Karm Babacek <karm@redhat.com>
see: ``` java -XX:+FlightRecorder -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10000,maxage=10000m,delay=5f,filename=flight-native.jfr -Xlog:jfr Main java.lang.IllegalArgumentException: Integer parsing error nanotime value: illegal unit whereas java -XX:+FlightRecorder -XX:+FlightRecorder -XX:StartFlightRecording=maxsize=10000,maxage=10000m,delay=5d,filename=flight-native.jfr -Xlog:jfr Main [0.562s][info][jfr] Flight Recorder initialized [0.562s][info][jfr] Created repository /tmp/2021_08_03_01_16_07_454665 [0.567s][info][jfr] Scheduled recording "1" (1) to start at 2021-08-08T01:16:07.684825 ``` Signed-off-by: Michal Karm Babacek <karm@redhat.com>
zakkak
changed the title
Backport jfr fix2
Backport "Enables parsing units for maxsize, fixes units for delay in JfrManager.java"
Aug 17, 2021
jerboaa
approved these changes
Aug 18, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backports oracle#3639
"Enables parsing units for maxsize, fixes units for delay in JfrManager.java"