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

8317761: Combine two versions of print_statistics() in java.cpp #16110

Closed

Conversation

iklam
Copy link
Member

@iklam iklam commented Oct 9, 2023

The non-product version of print_statistics() can be compiled in the product build as well, so there's no need to keep two different versions.

BTW, for some reason print_method_profiling_data() is called unconditionally in non-product builds, but is guarded by PrintMethodData in product builds. I made the behavior the same as before in this PR. This can probably be cleaned up in a future PR.

I verified that:

  • All functions call by the original product version are also called by the non-product version (but could be in different order).
  • For functions that are called by the non-product version but not call by the original product version: all such calls are guarded by non-product flags (e.g. TimeOopMap), or the function itself does nothing (e.g., declared as PRODUCT_RETURN)

Testing: tier1, tier2, build-tiers5


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-8317761: Combine two versions of print_statistics() in java.cpp (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16110

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 9, 2023

👋 Welcome back iklam! 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 openjdk bot added the rfr Pull request is ready for review label Oct 9, 2023
@openjdk
Copy link

openjdk bot commented Oct 9, 2023

@iklam The following label will be automatically applied to this pull request:

  • hotspot

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 hotspot-dev@openjdk.org label Oct 9, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 9, 2023

Webrevs

Comment on lines 280 to 290
print_method_profiling_data();
if (NOT_PRODUCT(true) PRODUCT_ONLY(PrintMethodData)) {
// TODO: why is this unconditional in non-product builds?
print_method_profiling_data();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be called unconditional always because we have check inside method.

I think the check in product VM is historical. Originally print_method_profiling_data() was called only in NOT_PRODUCT and later 8037970 add call to PRODUCT under PrintMethodData check (there was no this flag check inside method).
Then 8042727 added the flag check inside method to avoid unconditional walk class data (I assume in debug VM). This change made the check before call the method in product version redundant.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. I removed the if check.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@openjdk
Copy link

openjdk bot commented Oct 10, 2023

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

8317761: Combine two versions of print_statistics() in java.cpp

Reviewed-by: kvn, vlivanov

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 12 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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 10, 2023
Copy link
Contributor

@iwanowww iwanowww left a comment

Choose a reason for hiding this comment

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

FTR a slight difference in behavior between product and non-product builds when it comes to -XX:CompileCommand=print,... command is whether MDOs are printed or not.

I'm fine with aligning all builds flavors include MDOs into -XX:CompileCommand=print,... output.

@iklam
Copy link
Member Author

iklam commented Oct 11, 2023

Thanks @vnkozlov and @iwanowww for the review.
/integrate

@openjdk
Copy link

openjdk bot commented Oct 11, 2023

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

  • 3aa4cba: 8316975: Memory leak in MTLSurfaceData
  • 54861df: 8317802: jmh tests fail with Unable to find the resource: /META-INF/BenchmarkList after JDK-8306819
  • f40ea51: 8317751: ProblemList ConsumeForModalDialogTest.java, MenuItemActivatedTest.java & MouseModifiersUnitTest_Standard.java for windows
  • fec1d49: 8316452: java/lang/instrument/modules/AppendToClassPathModuleTest.java ignores VM flags
  • 2b8276a: 8316691: Heap dump: separate stack traces for mounted virtual threads
  • 33591a3: 8317795: Add an ImmutableBitSetPredicate variant for bitsets <= 128 elements
  • fb4098f: 8317730: Change byte_size to return size_t
  • c2abf12: 8261894: Remove support for UseSHM
  • ad7a8e8: 8315505: CompileTask timestamp printed can overflow
  • fcff222: 8317706: Exclude java/awt/Graphics2D/DrawString/RotTransText.java on linux
  • ... and 7 more: https://git.openjdk.org/jdk/compare/5e8d893c4809fdb30e01bdfe06b4f488f7bbef83...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 11, 2023

@iklam Pushed as commit 84b7cc1.

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

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.

3 participants