-
Notifications
You must be signed in to change notification settings - Fork 6.3k
8366232: JFR startup messages are shown with -Xlog:jfr+startup=warning #26957
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
base: master
Are you sure you want to change the base?
8366232: JFR startup messages are shown with -Xlog:jfr+startup=warning #26957
Conversation
👋 Welcome back jbechberger! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@parttimenerd The following label will be automatically applied to this pull request:
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. |
Webrevs
|
/label add hotspot-jfr |
@dholmes-ora |
@dholmes-ora |
@dholmes-ora |
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.
I can't say I like the general changes to UL to accommodate this. I also don't really like what JFR is already doing. I'm trying to see what the motivation is here. It appears to be "give a verbose startup message but don't label it as a 'warning'". But there is also no guarantee that jfr+startup
is being logged to stdout
so this could by-pass the user's control over logging output!
The motivation is to better capture the user's intent. When the user doesn't set any warning level, then we keep the default behaviour, for backwards compatibility as in the original change, when the user sets the logging level, then we consider it. You mentioned yourself in the original issue:
I just implemented this. I just implemented a way to properly check whether the user didn't specify a logging level, so the code doesn't have to assume that a This change tries to reduce confusion. |
What was the original issue? I have forgotten about this. |
The original issue was JDK-8244190, this PR just fixes a short-coming of the implementation. The limitations is even mentioned in one of the tests: startJfrJvm("-Xlog:jfr+startup=error")
.shouldNotContain("[jfr,startup")
.shouldNotContain("Started recording")
.shouldNotContain("Use jcmd");
// Known limitation.
// Can't turn off log with -Xlog:jfr+startup=warning
startJfrJvm()
.shouldContain("[info][jfr,startup")
.shouldContain("Started recording")
.shouldContain("Use jcmd"); This PR updates the test too. |
Okay in the original JBS issue I wrote:
But what got implemented was not what I had in mind - nor, I think, is the adjustment you propose here. What I intended was along the lines of:
and then in the logic that starts JFR something like:
Though checking if it is enabled on stdout may be the tricky part. This was recognised in the original PR:
but you also have to allow for it being turned off explicitly by the user. |
But isn't my PR closer to what the user expects? When you explicitly set the level to |
Functionally yes, but I'm just not sure about the mechanism. Need to think more about it. This reminds me of the flag complexity: FLAG_IS_DEFAULT, FLAG_IS_CMDLINE etc. |
Does your change handle logging to a file? I looked into fixing this when I did the initial implementation, but I didn't think it was worth addressing. It only applies to jfr+startup and if the user wants the warning level. If a user doesn't want the message, they can specify jfr+startup=error. Do we log anything with jfr+startup=warning? |
Without this change, I'll look into how it handles files later in the day |
Regarding files:
So it works both for files and stdout, the implementation changes the behaviour at the root. |
This PR needs an update since |
Only print the JFR startup messages when no or a < warning log level is set explicitly by the user.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26957/head:pull/26957
$ git checkout pull/26957
Update a local copy of the PR:
$ git checkout pull/26957
$ git pull https://git.openjdk.org/jdk.git pull/26957/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26957
View PR using the GUI difftool:
$ git pr show -t 26957
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26957.diff
Using Webrev
Link to Webrev Comment