KEMBAR78
8358666: [REDO] Implement JEP 509: JFR CPU-Time Profiling by parttimenerd · Pull Request #25654 · openjdk/jdk · GitHub
Skip to content

Conversation

@parttimenerd
Copy link
Contributor

@parttimenerd parttimenerd commented Jun 5, 2025

This is the code for the JEP 509: CPU Time based profiling for JFR.

Currently tested using this test suite. This runs profiles the Renaissance benchmark with

  • ... different heap sizes
  • ... different GCs
  • ... different samplers (the standard JFR and the new CPU Time Sampler and both)
  • ... different JFR recording durations
  • ... different chunk-sizes

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8358666: [REDO] Implement JEP 509: JFR CPU-Time Profiling (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25654/head:pull/25654
$ git checkout pull/25654

Update a local copy of the PR:
$ git checkout pull/25654
$ git pull https://git.openjdk.org/jdk.git pull/25654/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25654

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25654.diff

Using Webrev

Link to Webrev Comment

if (isCPUTimeMethodSampling) {
this.cpuRate = rate;
if (isEnabled()) {
JVM.setCPUThrottle(rate.rate(), rate.autoAdapt());
Copy link
Contributor Author

@parttimenerd parttimenerd Jun 5, 2025

Choose a reason for hiding this comment

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

but we need to set the throttle somewhere? Else changes are not propagated?

@mgronlun
Copy link

mgronlun commented Jun 5, 2025

That call was what caused the issues to begin with, so I'm slightly nervous about it.

@mgronlun
Copy link

mgronlun commented Jun 5, 2025

Perhaps it's correct, but again....

@SirYwell
Copy link
Member

SirYwell commented Jun 5, 2025

I think you need a REDO issue.

@parttimenerd
Copy link
Contributor Author

I tested it and it works as expected. This is similar to what the normal JFR profiler does.

We have two scenarios:

  1. Not enabled: then setting the throttle only sets the value in the event, and the enable call picks it up.
  2. Enabled: We push it directly into CPU Time Sampler

@parttimenerd
Copy link
Contributor Author

I think you need a REDO issue.

I reopened it, isn't this enough?

@mgronlun
Copy link

mgronlun commented Jun 5, 2025

No, you can't reopen it. Its already integrated.

@parttimenerd parttimenerd changed the title 8342818: Implement JEP 509: JFR CPU-Time Profiling 8358666: Implement JEP 509: JFR CPU-Time Profiling Jun 5, 2025
@parttimenerd
Copy link
Contributor Author

parttimenerd commented Jun 5, 2025

I created a new issue and linked it

@parttimenerd parttimenerd changed the title 8358666: Implement JEP 509: JFR CPU-Time Profiling 8358666: [Redo] Implement JEP 509: JFR CPU-Time Profiling Jun 5, 2025
@egahlin
Copy link
Member

egahlin commented Jun 5, 2025

The settings change looks reasonable.

@mgronlun
Copy link

mgronlun commented Jun 5, 2025

I updated the JIRA issue to capitalized [REDO] which seems to be the more common process. Can you please update the PR title accordingly?

@openjdk openjdk bot changed the title 8358666: [Redo] Implement JEP 509: JFR CPU-Time Profiling 8358666: [REDO] Implement JEP 509: JFR CPU-Time Profiling Jun 5, 2025
@parttimenerd
Copy link
Contributor Author

Skara did it automatically

Copy link

@mgronlun mgronlun left a comment

Choose a reason for hiding this comment

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

I see that this PR includes my fixes for the issues I found during this night of debugging, as detailed in the backout issue: https://bugs.openjdk.org/browse/JDK-8358628

I am approving for that reason, else all that work would have been in vain.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 5, 2025
@parttimenerd
Copy link
Contributor Author

I'm waiting for the last test to finish (just in case)

@parttimenerd
Copy link
Contributor Author

/integrate

@merykitty
Copy link
Member

The JEP is targeted for JDK-25, if you are planning to integrate this today then I think it is too rushed. There is no need to rush this into JDK-25 instead of deferring it to JDK-26.

@mgronlun
Copy link

mgronlun commented Jun 5, 2025

You need two reviewers! sigh...

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

As mentioned in #25302, I think this is good enough for an experimental feature assuming the the tests are fine this time :-)

@openjdk
Copy link

openjdk bot commented Jun 5, 2025

Going to push as commit ace70a6.
Since your change was applied there have been 26 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 5, 2025
@openjdk openjdk bot closed this Jun 5, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 5, 2025
@openjdk
Copy link

openjdk bot commented Jun 5, 2025

@parttimenerd Pushed as commit ace70a6.

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

@mrserb
Copy link
Member

mrserb commented Jun 11, 2025

It seems the new test TestCPUTimeSampleMultipleRecordings fails most of the time on the systems with 90+G of memory.

@parttimenerd
Copy link
Contributor Author

It seems the new test TestCPUTimeSampleMultipleRecordings fails most of the time on the systems with 90+G of memory.

I can't reproduce this on a machine with 128G of RAM, can you give me more details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

8 participants