Skip to content

[GR-67833] Improve -XX:FlightRecorderLogging error message for unknown tag set #11733

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

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

graalvmbot
Copy link
Collaborator

A documentation issue in JRF.md indicated that we should improve our error messages for unknown tag sets for -XX:FlightRecorderLogging. Previously, we would have printed the following:

$ ./svmbuild/helloworld -XX:StartFlightRecording="filename=recording.jfr,dumponexit=true" -XX:FlightRecorderLogging=jfr,system=debug
Uncaught exception while running isolate initialization hooks:
java.lang.IllegalArgumentException: No tag set matches tag combination [system] for FlightRecorderLogging
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jfr.logging.JfrLogConfiguration.verifySelections(JfrLogConfiguration.java:96)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jfr.logging.JfrLogConfiguration.parse(JfrLogConfiguration.java:75)
...

For comparison, Hotspot prints the following warning:

$ java -Xlog:jfr,system=debug --version
[0.000s][warning][logging] No tag set matches selection: system. Did you mean any of the following? system* jfr+system* jfr+system+streaming jfr+system+metadata jfr+system+periodic
...

With this PR, we also suggest valid tag combinations. A few examples:

$ ./svmbuild/helloworld -XX:StartFlightRecording="filename=recording.jfr,dumponexit=true" -XX:FlightRecorderLogging=jfr,system=debug
Uncaught exception while running isolate initialization hooks:
java.lang.IllegalArgumentException: No tag set matches tag combination [system] for FlightRecorderLogging. Did you mean any of the following? jfr+system jfr+system+event jfr+system+setting jfr+system+bytecode jfr+system+parser jfr+system+metadata jfr+system+streaming jfr+system+throttle jfr+system+periodic jfr+system+sampling
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jfr.logging.JfrLogConfiguration.verifySelections(JfrLogConfiguration.java:113)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jfr.logging.JfrLogConfiguration.parse(JfrLogConfiguration.java:75)
...

We only print suggestions that match all provided tags:

$ ./svmbuild/helloworld -XX:StartFlightRecording="filename=recording.jfr,dumponexit=true" -XX:FlightRecorderLogging=jfr,system+periodic=debug
Uncaught exception while running isolate initialization hooks:
java.lang.IllegalArgumentException: No tag set matches tag combination [system, periodic] for FlightRecorderLogging. Did you mean any of the following? jfr+system+periodic
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jfr.logging.JfrLogConfiguration.verifySelections(JfrLogConfiguration.java:113)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jfr.logging.JfrLogConfiguration.parse(JfrLogConfiguration.java:75)
...

For completely unknown tags, we don't print any suggestions (same as before):

$ ./svmbuild/helloworld -XX:StartFlightRecording="filename=recording.jfr,dumponexit=true" -XX:FlightRecorderLogging=jfr,unknown_tag=debug
Uncaught exception while running isolate initialization hooks:
java.lang.IllegalArgumentException: Invalid log tag 'unknown_tag' for FlightRecorderLogging.
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jfr.logging.JfrLogConfiguration$JfrLogSelection.parse(JfrLogConfiguration.java:178)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jfr.logging.JfrLogConfiguration.parse(JfrLogConfiguration.java:72)
...

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 22, 2025
@zapster zapster self-assigned this Jul 22, 2025
Copy link
Collaborator

@roberttoyonaga roberttoyonaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice improvement. Looks good to me!

@zapster
Copy link
Member

zapster commented Jul 23, 2025

Thanks for the review, @roberttoyonaga!

@graalvmbot graalvmbot merged commit cb3987a into master Jul 23, 2025
13 checks passed
@graalvmbot graalvmbot deleted the je/svm-jfr-log-tags-error-message-GR-67833 branch July 23, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants