Skip to content

JDK-8276983: Small fixes to DumpAllocStat::print_stats #6347

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

tstuefe
Copy link
Member

@tstuefe tstuefe commented Nov 11, 2021

When looking at CDS code in the context of Lilliput, I had to spend some time in DumpAllocStat::print(). I noticed two small things which can be fixed independently:

  • the divide-by-zero check at lines 45ff is not needed, since percent_of does this already. It also can cause the asserts at the end of the function to fire wrongly.

  • About those asserts: it makes sense to flush the debug message before scope end, otherwise, we won't see the debug message if the asserts fire. If they fire, the debug message would be helpful.

I also improved the assert message somewhat. I noticed that all sizes in this method are int, but left it that way because changing it would have too many ripple effects. I guess we won't get CDS archives beyond int_max any time soon.

Thanks, Thomas


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8276983: Small fixes to DumpAllocStat::print_stats

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6347/head:pull/6347
$ git checkout pull/6347

Update a local copy of the PR:
$ git checkout pull/6347
$ git pull https://git.openjdk.java.net/jdk pull/6347/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6347

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6347.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 11, 2021

👋 Welcome back stuefe! 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.

@tstuefe tstuefe closed this Nov 11, 2021
@tstuefe tstuefe reopened this Nov 11, 2021
@openjdk
Copy link

openjdk bot commented Nov 11, 2021

@tstuefe The following labels will be automatically applied to this pull request:

  • hotspot-runtime
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org labels Nov 11, 2021
@tstuefe tstuefe force-pushed the JDK-8276983-small-fixes-to-DumpAllocStat-print_stat branch from 9fab885 to 45a2c3c Compare November 11, 2021 06:20
@tstuefe tstuefe marked this pull request as ready for review November 12, 2021 10:00
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 12, 2021
@mlbridge
Copy link

mlbridge bot commented Nov 12, 2021

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Hi Thomas,

Seems okay. Relying on percent_of rather than passing in 1 does seem to change what will be output, but AFAICS we should never be able to pass zero in the first place.

Thanks,
David

@openjdk
Copy link

openjdk bot commented Nov 15, 2021

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

8276983: Small fixes to DumpAllocStat::print_stats

Reviewed-by: dholmes, iklam

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 28 new commits pushed to the master branch:

  • 8c5f030: 8276453: Undefined behavior in C1 LIR_OprDesc causes SEGV in fastdebug build
  • 176d21d: 8276824: refactor Thread::is_JavaThread_protected
  • 74f3e69: 8277071: [BACKOUT] JDK-8276743 Make openjdk build Zip Archive generation "reproducible"
  • b85500e: 8276123: ZipFile::getEntry will not return a file entry when there is a directory entry of the same name within a Zip File
  • 0d2980c: 8258192: Obsolete the CriticalJNINatives flag
  • 5a2452c: 8274835: Remove unnecessary castings in java.base
  • 3b2585c: 8276658: Clean up JNI local handles code
  • aeba653: 8276743: Make openjdk build Zip Archive generation "reproducible"
  • 51a5731: 8277016: Use blessed modifier order in jdk.httpserver
  • c4b4432: 8277012: Use blessed modifier order in src/utils
  • ... and 18 more: https://git.openjdk.java.net/jdk/compare/ad3be04d2ac84836e393d696ff03ddfe72779094...master

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 Nov 15, 2021
Copy link
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

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

LGTM. Good clean up.

@tstuefe
Copy link
Member Author

tstuefe commented Nov 15, 2021

Thanks @dholmes-ora and @iklam !

/integrate

@openjdk
Copy link

openjdk bot commented Nov 15, 2021

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

  • 8c5f030: 8276453: Undefined behavior in C1 LIR_OprDesc causes SEGV in fastdebug build
  • 176d21d: 8276824: refactor Thread::is_JavaThread_protected
  • 74f3e69: 8277071: [BACKOUT] JDK-8276743 Make openjdk build Zip Archive generation "reproducible"
  • b85500e: 8276123: ZipFile::getEntry will not return a file entry when there is a directory entry of the same name within a Zip File
  • 0d2980c: 8258192: Obsolete the CriticalJNINatives flag
  • 5a2452c: 8274835: Remove unnecessary castings in java.base
  • 3b2585c: 8276658: Clean up JNI local handles code
  • aeba653: 8276743: Make openjdk build Zip Archive generation "reproducible"
  • 51a5731: 8277016: Use blessed modifier order in jdk.httpserver
  • c4b4432: 8277012: Use blessed modifier order in src/utils
  • ... and 18 more: https://git.openjdk.java.net/jdk/compare/ad3be04d2ac84836e393d696ff03ddfe72779094...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 15, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 15, 2021
@openjdk
Copy link

openjdk bot commented Nov 15, 2021

@tstuefe Pushed as commit 296780c.

💡 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-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants