RFR: 8365610: Sort share/jfr includes
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted. Passes tier1. ------------- Commit messages: - reorder Changes: https://git.openjdk.org/jdk/pull/26800/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26800&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365610 Stats: 173 lines in 56 files changed: 82 ins; 89 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/26800.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26800/head:pull/26800 PR: https://git.openjdk.org/jdk/pull/26800
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Passes tier1.
src/hotspot/share/jfr/periodic/jfrOSInterface.cpp line 35:
33: #include "utilities/ostream.hpp" 34: 35: #include <stdlib.h> // for environment variables
I couldn't find any usage for this include, let me know if it should stay. It's been here for a long time: https://github.com/openjdk/jdk/commit/a060be188df894ed5c26fc12fc9e902f9af32b... src/hotspot/share/jfr/support/jfrDeprecationManager.cpp line 52:
50: #include "runtime/thread.inline.hpp" 51: 52: // for strstr
Let me know if the comment should stay ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26800#discussion_r2278998210 PR Review Comment: https://git.openjdk.org/jdk/pull/26800#discussion_r2278998848
On Fri, 15 Aug 2025 13:32:11 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
src/hotspot/share/jfr/periodic/jfrOSInterface.cpp line 35:
33: #include "utilities/ostream.hpp" 34: 35: #include <stdlib.h> // for environment variables
I couldn't find any usage for this include, let me know if it should stay. It's been here for a long time: https://github.com/openjdk/jdk/commit/a060be188df894ed5c26fc12fc9e902f9af32b...
I suspect it has to do with `generate_environment_variables_events()` here: https://github.com/openjdk/jdk/pull/26800/files#diff-2d77a162387fd8e8a57c631... Which does not have any implementation. I cannot find any code history about this as well; looks like it was unimplemented from day 1: % git log -p --follow src/hotspot/ | grep generate_environment_variables_events + void generate_environment_variables_events(); So maybe keep this one intact, and submit another quick RFE to clean up both the header inclusion and the dead method declarations? It would also match the synopsis for current PR ("sort") better. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26800#discussion_r2284818979
On Tue, 19 Aug 2025 10:25:34 GMT, Aleksey Shipilev <shade@openjdk.org> wrote:
src/hotspot/share/jfr/periodic/jfrOSInterface.cpp line 35:
33: #include "utilities/ostream.hpp" 34: 35: #include <stdlib.h> // for environment variables
I couldn't find any usage for this include, let me know if it should stay. It's been here for a long time: https://github.com/openjdk/jdk/commit/a060be188df894ed5c26fc12fc9e902f9af32b...
I suspect it has to do with `generate_environment_variables_events()` here: https://github.com/openjdk/jdk/pull/26800/files#diff-2d77a162387fd8e8a57c631...
Which does not have any implementation. I cannot find any code history about this as well; looks like it was unimplemented from day 1:
% git log -p --follow src/hotspot/ | grep generate_environment_variables_events + void generate_environment_variables_events();
So maybe keep this one intact, and submit another quick RFE to clean up both the header inclusion and the dead method declarations? It would also match the synopsis for current PR ("sort") better.
Sure: f734135f2ecc399ef2aa2a2d150ebba454e5776d https://bugs.openjdk.org/browse/JDK-8365782 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26800#discussion_r2284870134
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
This creates a dependency on a test that is not normally run when we develop JFR. What tier is the test located? ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3195982055
On Mon, 18 Aug 2025 09:56:32 GMT, Markus Grönlund <mgronlun@openjdk.org> wrote:
This creates a dependency on a test that is not normally run when we develop JFR.
What tier is the test located?
`TestIncludesAreSorted.java` is in [`tier1`](https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/TEST.groups#L1...). ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3196013395
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
A blanket HotSpot change that does not add much value, but instead creates an unnecessary dependency that will make development of JFR more problematic. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3196133193
On Mon, 18 Aug 2025 10:43:38 GMT, Markus Grönlund <mgronlun@openjdk.org> wrote:
A blanket HotSpot change that does not add much value, but instead creates an unnecessary dependency that will make development of JFR more problematic.
It is not "blanket", is it? The includes get sorted component by component, and many components in Hotspot have already been processed, with a long view of entire Hotspot being covered. Overall, while I agree maintaining the include order hygiene would require additional work, that is true for _any_ hygiene work. It does not mean we refrain from it. What we do is to make sure the detection is as prompt and the fixes are as easy as practically possible. Also, there is already a "dependency" on source tests. For example, if you write `NULL` anywhere in JFR code, this test would fail: https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/sources/TestNo.... You'll get a failure with any `tier1` testing, including GHA checks. The include order test is not that different. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3196274329
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
That is a blanket change, yes - it means all of HotSpot being covered. In my opinion, it adds little value and instead creates more work for us that develop JFR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3196311191
On Mon, 18 Aug 2025 11:44:38 GMT, Markus Grönlund <mgronlun@openjdk.org> wrote:
That is a blanket change, yes - it means all of HotSpot being covered.
In my opinion, it adds little value and instead creates more work for us that develop JFR.
But if "someone" has said this is good to do for all of HotSpot (who?) we can accommodate to the general will. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3196327634
On Mon, 18 Aug 2025 11:44:38 GMT, Markus Grönlund <mgronlun@openjdk.org> wrote:
In my opinion, it adds little value and instead creates more work for us that develop JFR.
Noted, but I think this overestimates the amount of work. If the test would fail in `tier1` (which the required pre-integration testing, runs even in GHA), in 99% of cases you either sort the includes by hand, or run the tool in the way that test failure itself would guide you through: https://github.com/openjdk/jdk/blob/c1198bba0e8cbdaa47c821263d122d0ba4dd6759...
But if "someone" has said this is good to do for all of HotSpot (who?) we can accommodate to the general will.
Take a look at [Hotspot Style Guide](https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md#source-files): "Keep the include lines within a section alphabetically sorted by their lowercase value. If an include must be out of order for correctness, suffix with it a comment such as // do not reorder. Source code processing tools can also use this hint." Both the original [JDK-8352645](https://bugs.openjdk.org/browse/JDK-8352645), and the related tasks from it maintain the same consensus: sort the includes, make sure the test would keep them sorted. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3196365263
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
That the test is integrated with GHA is the good part. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3196955412
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
Marked as reviewed by mgronlun (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26800#pullrequestreview-3128733760
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
@fandreuz Your change (at version 3bfcf13525c3eb1c1ff5a5e1e37fdc8de7323995) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3197353485
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
For Hotspot changes, you need to wait 24 hours, so people around the globe could take a look. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3197465672
On Mon, 18 Aug 2025 15:46:09 GMT, Aleksey Shipilev <shade@openjdk.org> wrote:
For Hotspot changes, you need to wait 24 hours, so people around the globe could take a look.
Sure, so is it 24 hours after getting approval? I thought it's 24 hours after opening the PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3197491190
On Mon, 18 Aug 2025 15:53:50 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
For Hotspot changes, you need to wait 24 hours, so people around the globe could take a look.
Sure, so is it 24 hours after getting approval? I thought it's 24 hours after opening the PR.
Ah no, you're right: https://openjdk.org/guide/#life-of-a-pr -- 24 hours is the bare minimum. It gets a bit murky around holidays/weekends, as people take time off or checkout on Friday earlier. But this looks fine. You also need a Review from one area expert (for JFR, Markus definitely qualifies), and another Review from any other reviewer. I'll do it shortly. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3200112542
On Tue, 19 Aug 2025 10:10:56 GMT, Aleksey Shipilev <shade@openjdk.org> wrote:
For Hotspot changes, you need to wait 24 hours, so people around the globe could take a look.
Sure, so is it 24 hours after getting approval? I thought it's 24 hours after opening the PR.
For Hotspot changes, you need to wait 24 hours, so people around the globe could take a look.
Sure, so is it 24 hours after getting approval? I thought it's 24 hours after opening the PR.
Ah no, you're right: https://openjdk.org/guide/#life-of-a-pr -- 24 hours is the bare minimum. It gets a bit murky around holidays/weekends, as people take time off or checkout on Friday earlier. But this looks fine.
You also need a Review from one area expert (for JFR, Markus definitely qualifies), and another Review from any other reviewer. I'll do it shortly.
Thanks for your reviews @shipilev and @mgronlun ! ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3201175425
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
Looks fine, but I think we should refrain from deleting the includes here. ------------- PR Review: https://git.openjdk.org/jdk/pull/26800#pullrequestreview-3131682406
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
Francesco Andreuzzi has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - revert - Merge branch 'master' into JDK-8365610 - reorder ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26800/files - new: https://git.openjdk.org/jdk/pull/26800/files/3bfcf135..f734135f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26800&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26800&range=00-01 Stats: 5591 lines in 165 files changed: 4356 ins; 612 del; 623 mod Patch: https://git.openjdk.org/jdk/pull/26800.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26800/head:pull/26800 PR: https://git.openjdk.org/jdk/pull/26800
On Tue, 19 Aug 2025 10:53:25 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
Francesco Andreuzzi has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
- revert - Merge branch 'master' into JDK-8365610 - reorder
Looks fine, thanks. ------------- Marked as reviewed by shade (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26800#pullrequestreview-3132770097
On Tue, 19 Aug 2025 10:53:25 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
Francesco Andreuzzi has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
- revert - Merge branch 'master' into JDK-8365610 - reorder
@fandreuz Your change (at version f734135f2ecc399ef2aa2a2d150ebba454e5776d) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3201182213
On Fri, 15 Aug 2025 13:30:33 GMT, Francesco Andreuzzi <duke@openjdk.org> wrote:
This PR sorts the includes in hotspot/share/jfr using SortIncludes.java. I'm also adding the directory to TestIncludesAreSorted.
Testing: - [x] tier1 - [x] tier2
This pull request has now been integrated. Changeset: ecab52c0 Author: Francesco Andreuzzi <andreuzzi.francesco@gmail.com> Committer: Volker Simonis <simonis@openjdk.org> URL: https://git.openjdk.org/jdk/commit/ecab52c09b078201ebeb8d45c0982b0481e15dc3 Stats: 171 lines in 55 files changed: 82 ins; 87 del; 2 mod 8365610: Sort share/jfr includes Reviewed-by: shade, mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/26800
participants (4)
-
Aleksey Shipilev
-
duke
-
Francesco Andreuzzi
-
Markus Grönlund