-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8284686: Interval of < 1 ms disables ExecutionSample events #8183
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
Conversation
|
👋 Welcome back parttimenerd! A progress list of the required criteria for merging this PR into |
|
@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
|
|
The failing test seems to fail spuriously on Mac aarch64 (https://bugs.openjdk.java.net/browse/JDK-8284144). It does not have any relation to the proposed changes (it should not even call the changed code as JFR is not used). |
src/jdk.jfr/share/classes/jdk/jfr/internal/settings/PeriodSetting.java
Outdated
Show resolved
Hide resolved
|
You mentioned elsewhere that it fails in debug mode, I think it should work there as well. Did you try your change with tests in test/jdk/jdk/jfr? Might make sense to write a test, or add your use case to an existing test. The documentation should say "1 ms" instead of "1ms". The latter is only used at command-line. You are changing the specification, so a CSR might be needed as well. |
|
I added a small test case, hopefully it works. |
|
@egahlin is my PR fine? |
I discussed this with Markus and we're leaning towards not mentioning it in the documentation and instead keep it as an implementation detail. All settings are a best effort, not just the period, as it depends OS, hardware etc. so the error could in practise be magnitudes more than a ms. In the test, could you check the behaviour instead of using internal classes. Perhaps something like this. I have not tested the code. |
|
Then I close the CSR too? |
Yes. /csr unneeded |
|
@egahlin The CSR requirement cannot be removed as there is already a CSR associated with the main issue of this pull request. Please withdraw the CSR JDK-8284824 and then use the command |
|
@parttimenerd only Reviewers can determine that a CSR is not needed. |
What do you want to test with this? A far simpler test could be to just check that after calling |
I want to test that events are emitted. A check of EventType::isEnabled could return true, but events still not being recorded. |
|
But where do you test it? Or more generally: How can I write a test that runs JFR? Should this test run a small loop 100ms and then check that there are > 0 events recorded? |
The test code above will run JFR until an event is emitted (RecordingStream::start() is blocking) If there is a bug, the test will hang with a stack trace indicating which test method that failed. |
|
Thanks for your explanation. |
|
/csr unneeded |
|
I'm currently struggling with writing the tests as there are problems, even with durations > 1ms and on the stock JVM. |
|
@parttimenerd 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: 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 362 new commits pushed to the
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 (@egahlin) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
/integrate |
|
@parttimenerd |
|
/sponsor |
|
Going to push as commit 902b1dd.
Your commit was automatically rebased without conflicts. |
|
@egahlin @parttimenerd Pushed as commit 902b1dd. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Fixes the issue by rounding the period interval to the next full millisecond larger than zero.
The following from the bug report works now:
java -XX:StartFlightRecording=filename=flight.jfr,jdk.ExecutionSample#period=999us CLASS_FILE; jfr print --events jdk.ExecutionSample flight.jfrIt considers the period to be
1ms, producing the recording as expected.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8183/head:pull/8183$ git checkout pull/8183Update a local copy of the PR:
$ git checkout pull/8183$ git pull https://git.openjdk.java.net/jdk pull/8183/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 8183View PR using the GUI difftool:
$ git pr show -t 8183Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8183.diff