Skip to content
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

8257872: UL: -Xlog does not check number of options #1685

Closed
wants to merge 2 commits into from

Conversation

jyukutyo
Copy link
Contributor

@jyukutyo jyukutyo commented Dec 8, 2020

In Unified Logging options can be specified up to four (-Xlog[:[selections][:[output][:[decorators][:output-options]]]]).
But it’s possible to specify options with more colons like java -Xlog:::::.
It’s better to show a message when more options are specified than maximum number.

By this PR a warning message is outputted when options are specified more than the max number.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8257872: UL: -Xlog does not check number of options

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1685/head:pull/1685
$ git checkout pull/1685

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 8, 2020

👋 Welcome back ksakata! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 8, 2020

@jyukutyo The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Dec 8, 2020
@jyukutyo jyukutyo marked this pull request as ready for review December 8, 2020 04:48
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 8, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 8, 2020

Webrevs

break;
}
}

if (str != NULL) {
log_warning(logging)("Options are specified more than the max number in -Xlog.");
Copy link
Member

Choose a reason for hiding this comment

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

Might I suggest:
log_warning(logging)("Ignoring excess -Xlog options: \"%s\"", str);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your suggestion. This message is clear for everyone. I changed the warning message.

@iklam
Copy link
Member

iklam commented Dec 9, 2020

Should this be a warning or an error? The behavior seems inconsistent:

$ java -Xlog:gc=error:::foo -version
[0.000s][warning][logging] Output options for existing outputs are ignored.
java version "16-internal" 2021-03-16
Java(TM) SE Runtime Environment (build 16-internal+0-adhoc.iklam.open)
Java HotSpot(TM) 64-Bit Server VM (build 16-internal+0-adhoc.iklam.open, mixed mode, sharing)

$ java -Xlog:gc=error::foo -version
[0.000s][error][logging] Invalid decorator 'foo'.
Invalid -Xlog option '-Xlog:gc=error::foo', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

@jyukutyo
Copy link
Contributor Author

jyukutyo commented Dec 9, 2020

In this PR I chose a warning level to ignore the invalid option and run a application. It isn't serious thing and some people might run with invalid option already.

The fourth option is for output-option and can be described relatively free. So I suspect that it is ignored even when it is invalid.

@dholmes-ora
Copy link
Member

I think a warning is okay in this context.

@openjdk
Copy link

openjdk bot commented Dec 10, 2020

@jyukutyo This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8257872: UL: -Xlog does not check number of options

Reviewed-by: dholmes, iklam, ysuenaga

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 89 new commits pushed to the master branch:

  • 6847bbb: 8255918: XMLStreamFilterImpl constructor consumes XMLStreamException
  • d2f9e31: 8257638: Update usage of "type" terminology in javax.lang.model
  • f631a99: 8256888: Client manual test problem list update
  • eb1c8a1: 8257924: Use full path when running external executable from jpackage
  • 1ce2a36: 8257539: tools/jpackage/windows/WinL10nTest.java unpack.bat failed with Exit code: 1618
  • 53e537c: 8255387: Japanese characters were printed upside down on AIX
  • 0a3e446: 8257993: vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine/TestDescription.java crash intermittently
  • 46c9a86: 8245956: JavaCompiler still uses File API instead of Path API in a specific case
  • baf4c1a: 8257917: [JVMCI] crash when materializing boxed values under -Xcomp
  • fd5f6e2: 8257986: [JVMCI] ProblemList 2 reprofile JVMCI tests
  • ... and 79 more: https://git.openjdk.java.net/jdk/compare/d3ac1bf16c2e6ffc1f5b1759631750cb7eac2e17...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dholmes-ora, @iklam, @YaSuenag) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 10, 2020
Copy link
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

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

Agree that warning is OK.

@jyukutyo
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Dec 10, 2020
@openjdk
Copy link

openjdk bot commented Dec 10, 2020

@jyukutyo
Your change (at version ed882ea) is now ready to be sponsored by a Committer.

Copy link
Member

@YaSuenag YaSuenag left a comment

Choose a reason for hiding this comment

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

Looks good! I will sponsor you.

@YaSuenag
Copy link
Member

/sponsor

@openjdk openjdk bot closed this Dec 10, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 10, 2020
@openjdk
Copy link

openjdk bot commented Dec 10, 2020

@YaSuenag @jyukutyo Since your change was applied there have been 89 commits pushed to the master branch:

  • 6847bbb: 8255918: XMLStreamFilterImpl constructor consumes XMLStreamException
  • d2f9e31: 8257638: Update usage of "type" terminology in javax.lang.model
  • f631a99: 8256888: Client manual test problem list update
  • eb1c8a1: 8257924: Use full path when running external executable from jpackage
  • 1ce2a36: 8257539: tools/jpackage/windows/WinL10nTest.java unpack.bat failed with Exit code: 1618
  • 53e537c: 8255387: Japanese characters were printed upside down on AIX
  • 0a3e446: 8257993: vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine/TestDescription.java crash intermittently
  • 46c9a86: 8245956: JavaCompiler still uses File API instead of Path API in a specific case
  • baf4c1a: 8257917: [JVMCI] crash when materializing boxed values under -Xcomp
  • fd5f6e2: 8257986: [JVMCI] ProblemList 2 reprofile JVMCI tests
  • ... and 79 more: https://git.openjdk.java.net/jdk/compare/d3ac1bf16c2e6ffc1f5b1759631750cb7eac2e17...master

Your commit was automatically rebased without conflicts.

Pushed as commit 34650f5.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants