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

8265047: Inconsistent warning message in jcmd VM.log #3448

Closed

Conversation

jyukutyo
Copy link
Contributor

@jyukutyo jyukutyo commented Apr 13, 2021

When reconfiguring log output options of an existing log setting with jcmd VM.log and the file name, a warning message is shown. However, when reconfiguring them with jcmd VM.log and the output index, the message is not shown.

$ java -Xlog::sample.log:: Sample
$ jcmd 4976 VM.log list
Log output configuration:
 #0: stdout all=warning uptime,level,tags
 #1: stderr all=off uptime,level,tags
 #2: file=sample.log all=info uptime,level,tags filecount=5,filesize=20480K

$ jcmd 4976 VM.log output="sample.log" output_options="filecount=100"
4976:
Output options for existing outputs are ignored.

$ jcmd 4976 VM.log output="#2" output_options="filecount=100"
4976:
Command executed successfully

It's better to show the same message also in the latter case, I think. Because the output options is not updated in both cases.

$ jcmd 4976 VM.log list
 #0: stdout all=warning uptime,level,tags
 #1: stderr all=off uptime,level,tags
 #2: file=sample.log all=info uptime,level,tags filecount=5,filesize=20480K (reconfigured)

This pull request enable to show the warning message when specifying the output index.

$ java -Xlog::sample.log:: Sample
$ jcmd 5054 VM.log output="sample.log" output_options="filecount=100"
5054:
Output options for existing outputs are ignored.

$ jcmd 5054 VM.log output="#2" output_options="filecount=100"
5054:
Output options for existing outputs are ignored.

gtest result

$ ./build/linux-x86_64-server-fastdebug/hotspot/variant-server/libjvm/gtest/gtestLauncher -jdk:./build/linux-x86_64-server-fastdebug/jdk --gtest_filter=LogConfigurationTest.\*
Note: Google Test filter = LogConfigurationTest.*
[==========] Running 15 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 15 tests from LogConfigurationTest
[ RUN      ] LogConfigurationTest.describe_vm
[       OK ] LogConfigurationTest.describe_vm (1 ms)
[ RUN      ] LogConfigurationTest.update_output_vm
[       OK ] LogConfigurationTest.update_output_vm (0 ms)
[ RUN      ] LogConfigurationTest.add_new_output_vm
[       OK ] LogConfigurationTest.add_new_output_vm (0 ms)
[ RUN      ] LogConfigurationTest.disable_logging_vm
[       OK ] LogConfigurationTest.disable_logging_vm (1 ms)
[ RUN      ] LogConfigurationTest.disable_output_vm
[       OK ] LogConfigurationTest.disable_output_vm (0 ms)
[ RUN      ] LogConfigurationTest.reconfigure_decorators_vm
[       OK ] LogConfigurationTest.reconfigure_decorators_vm (0 ms)
[ RUN      ] LogConfigurationTest.invalid_configure_options_vm
[       OK ] LogConfigurationTest.invalid_configure_options_vm (0 ms)
[ RUN      ] LogConfigurationTest.parse_empty_command_line_arguments_vm
[0.462s][warning][logging] Ignoring excess -Xlog options: ""
[       OK ] LogConfigurationTest.parse_empty_command_line_arguments_vm (0 ms)
[ RUN      ] LogConfigurationTest.parse_command_line_arguments_vm
[       OK ] LogConfigurationTest.parse_command_line_arguments_vm (1 ms)
[ RUN      ] LogConfigurationTest.parse_log_arguments_vm
[       OK ] LogConfigurationTest.parse_log_arguments_vm (188 ms)
[ RUN      ] LogConfigurationTest.configure_stdout_vm
[       OK ] LogConfigurationTest.configure_stdout_vm (2 ms)
[ RUN      ] LogConfigurationTest.subscribe_vm
[       OK ] LogConfigurationTest.subscribe_vm (2 ms)
[ RUN      ] LogConfigurationTest.parse_invalid_tagset_vm
[       OK ] LogConfigurationTest.parse_invalid_tagset_vm (0 ms)
[ RUN      ] LogConfigurationTest.output_name_normalization_vm
[       OK ] LogConfigurationTest.output_name_normalization_vm (1 ms)
[ RUN      ] LogConfigurationTest.suggest_similar_selection_vm
[       OK ] LogConfigurationTest.suggest_similar_selection_vm (1 ms)
[----------] 15 tests from LogConfigurationTest (658 ms total)

[----------] Global test environment tear-down
[==========] 15 tests from 1 test case ran. (659 ms total)
[  PASSED  ] 15 tests.

Progress

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

Issue

  • JDK-8265047: Inconsistent warning message in jcmd VM.log

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3448/head:pull/3448
$ git checkout pull/3448

Update a local copy of the PR:
$ git checkout pull/3448
$ git pull https://git.openjdk.java.net/jdk pull/3448/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3448

View PR using the GUI difftool:
$ git pr show -t 3448

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3448.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 13, 2021

👋 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 openjdk bot commented Apr 13, 2021

@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 label Apr 13, 2021
@jyukutyo jyukutyo marked this pull request as ready for review Apr 13, 2021
@openjdk openjdk bot added the rfr label Apr 13, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 13, 2021

Webrevs

@plummercj
Copy link
Contributor

@plummercj plummercj commented Apr 20, 2021

/label serviceability

@openjdk openjdk bot added the serviceability label Apr 20, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 20, 2021

@plummercj
The serviceability label was successfully added.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Sorry for the delay in noticing this PR!

Fix looks good. One nit on variable naming below.

Thanks,
David

@@ -427,6 +427,7 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr,

ConfigurationLock cl;
size_t idx;
bool is_added = false;
Copy link
Member

@dholmes-ora dholmes-ora May 4, 2021

Choose a reason for hiding this comment

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

Nit: was_added (or even just added)

Copy link
Contributor Author

@jyukutyo jyukutyo May 6, 2021

Choose a reason for hiding this comment

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

Thank you, David. I changed is_added to added.

@openjdk
Copy link

@openjdk openjdk bot commented May 4, 2021

@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:

8265047: Inconsistent warning message in jcmd VM.log

Reviewed-by: dholmes, stuefe, sspitsyn

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 436 new commits pushed to the master branch:

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, @tstuefe, @sspitsyn) 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 label May 4, 2021
@navyxliu
Copy link
Member

@navyxliu navyxliu commented May 5, 2021

Your bugfix looks good to me.
I am not a reviewer. I just happen to work on this file recently. You still need reviewer's approval.

tstuefe
tstuefe approved these changes May 5, 2021
Copy link
Member

@tstuefe tstuefe left a comment

Looks good.

Copy link
Contributor

@sspitsyn sspitsyn left a comment

Looks good to me.
Thanks,
Serguei

Copy link
Contributor Author

@jyukutyo jyukutyo left a comment

Thank you for your reviews!

@@ -427,6 +427,7 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr,

ConfigurationLock cl;
size_t idx;
bool is_added = false;
Copy link
Contributor Author

@jyukutyo jyukutyo May 6, 2021

Choose a reason for hiding this comment

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

Thank you, David. I changed is_added to added.

@jyukutyo
Copy link
Contributor Author

@jyukutyo jyukutyo commented May 6, 2021

/integrate

@openjdk openjdk bot added the sponsor label May 6, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 6, 2021

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

@tstuefe
Copy link
Member

@tstuefe tstuefe commented May 6, 2021

/sponsor

@openjdk openjdk bot closed this May 6, 2021
@openjdk openjdk bot added integrated and removed sponsor ready rfr labels May 6, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 6, 2021

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

Your commit was automatically rebased without conflicts.

Pushed as commit 51f5adf.

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

@jyukutyo jyukutyo deleted the JDK-8265047_message_in_jcmd_vmlog branch Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime integrated serviceability
6 participants