Skip to content

8316178: Better diagnostic header for CodeBlobs#15708

Closed
shipilev wants to merge 1 commit intoopenjdk:masterfrom
shipilev:JDK-8316178-better-diagnostics-codeblobs
Closed

8316178: Better diagnostic header for CodeBlobs#15708
shipilev wants to merge 1 commit intoopenjdk:masterfrom
shipilev:JDK-8316178-better-diagnostics-codeblobs

Conversation

@shipilev
Copy link
Member

@shipilev shipilev commented Sep 13, 2023

I realized that JMH perfasm misses some CodeBlobs, notably C1 RuntimeBlobs. While amending perfasm to capture those, I discovered the header printout for those blobs is not as convenient as for others. Notably, perfasm would like to know where the stub code ends.

# Good:
StubRoutines::sha512_implCompressMB [0x0000000117da2d80, 0x0000000117da3528] (1960 bytes)

# Bad:
Decoding RuntimeStub - _complete_monitor_locking_Java 0x0000000117e4fd10

After this change, we print this:

Decoding RuntimeStub - _complete_monitor_locking_Java 0x0000000114203110 [0x00000001142031c0, 0x0000000114203258] (152 bytes)

Note it still prints the (base) stub address. I think it is still useful for debugging. The brackets print the code size, because that is what the decoding block handles: the code.


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-8316178: Better diagnostic header for CodeBlobs (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15708

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 13, 2023

👋 Welcome back shade! 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 Sep 13, 2023
@openjdk
Copy link

openjdk bot commented Sep 13, 2023

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

  • hotspot-compiler

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

mlbridge bot commented Sep 13, 2023

Webrevs

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@openjdk
Copy link

openjdk bot commented Sep 13, 2023

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

8316178: Better diagnostic header for CodeBlobs

Reviewed-by: thartmann, kvn

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

  • c11f835: 8315824: Open source several Swing Text/HTML related tests
  • 5cea53d: 8315810: Reimplement sun.reflect.ReflectionFactory::newConstructorForSerialization with method handles
  • eb1f67b: 8315937: Enable parallelism in vmTestbase/nsk/stress/numeric tests
  • a57b9da: 8316242: Opensource SwingGraphics manual test
  • 3abe798: 8316115: Parallel: Fix -Wconversion warnings around NUMA node ID
  • 83dca62: 8313638: Add test for dump of resolved references
  • cfa8901: 8315338: RISC-V: Change flags for stable extensions to non-experimental
  • edd454b: 8315766: Parallelize gc/stress/TestStressIHOPMultiThread.java test
  • de9b971: 8315933: Serial: Remove empty Generation::ensure_parsability
  • b48dbf6: 8316181: Move the fast locking implementation out of the .ad files
  • ... and 17 more: https://git.openjdk.org/jdk/compare/f8df754b9a3f58ff5f26e63de70d02f3433a9384...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 Sep 13, 2023
@shipilev
Copy link
Member Author

Thanks @TobiHartmann! I think I would need another review before I can integrate.

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.

Looks good.
One question: did you change INTPTR_FORMAT to PTR_FORMAT because they are the same but shorter name?

@shipilev
Copy link
Member Author

Looks good. One question: did you change INTPTR_FORMAT to PTR_FORMAT because they are the same but shorter name?

Muscle memory: when using p2i I use PTR_FORMAT, so when I rewrote stub to p2i(stub), I also changed to PTR_FORMAT to match. Not really sure what is our agreed style here, though.

@vnkozlov
Copy link
Contributor

Looks good. One question: did you change INTPTR_FORMAT to PTR_FORMAT because they are the same but shorter name?

Muscle memory: when using p2i I use PTR_FORMAT, so when I rewrote stub to p2i(stub), I also changed to PTR_FORMAT to match. Not really sure what is our agreed style here, though.

It looks like we use both evenly so I am fine with this change.

@stefank
Copy link
Member

stefank commented Sep 15, 2023

Looks good. One question: did you change INTPTR_FORMAT to PTR_FORMAT because they are the same but shorter name?

Muscle memory: when using p2i I use PTR_FORMAT, so when I rewrote stub to p2i(stub), I also changed to PTR_FORMAT to match. Not really sure what is our agreed style here, though.

It looks like we use both evenly so I am fine with this change.

We have been pushing people towards using PTR_FORMAT instead of INTPTR_FORMAT when printing pointers.

@shipilev
Copy link
Member Author

Okay, thanks for reviews. I'll integrate and see to JMH perfasm changes. Once that is done, I am going to backport this to actively maintained JDK releases.

/integrate

@openjdk
Copy link

openjdk bot commented Sep 15, 2023

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

  • bfbc41c: 8315741: Open source few swing JFormattedTextField and JPopupMenu tests
  • 0775bf2: 8316106: Open source few swing JInternalFrame and JMenuBar tests
  • 4a63eb0: 8315834: Open source several Swing JSpinner related tests
  • 8dc2d92: 8316190: Improve MemorySegment::toString
  • 783e44d: 8316326: ProblemList java/awt/Mouse/EnterExitEvents/DragWindowTest.java on macosx-all again
  • 96781ba: 8312332: C2: Refactor SWPointer out from SuperWord
  • b55e418: 8301991: Convert l10n properties resource bundles to UTF-8 native
  • d475f61: 8315731: Open source several Swing Text related tests
  • 4415261: 8315683: Parallelize java/util/concurrent/tck/JSR166TestCase.java
  • b2e9106: 8313452: Improve Classfile API attributes handling safety
  • ... and 31 more: https://git.openjdk.org/jdk/compare/f8df754b9a3f58ff5f26e63de70d02f3433a9384...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 15, 2023

@shipilev Pushed as commit d575968.

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

@shipilev
Copy link
Member Author

/backport jdk21u

@openjdk
Copy link

openjdk bot commented Sep 20, 2023

@shipilev the backport was successfully created on the branch shipilev-backport-d575968b in my personal fork of openjdk/jdk21u. To create a pull request with this backport targeting openjdk/jdk21u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit d575968b from the openjdk/jdk repository.

The commit being backported was authored by Aleksey Shipilev on 15 Sep 2023 and was reviewed by Tobias Hartmann and Vladimir Kozlov.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u:

$ git fetch https://github.com/openjdk-bots/jdk21u.git shipilev-backport-d575968b:shipilev-backport-d575968b
$ git checkout shipilev-backport-d575968b
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u.git shipilev-backport-d575968b

@shipilev
Copy link
Member Author

/backport jdk17u-dev

@openjdk
Copy link

openjdk bot commented Sep 21, 2023

@shipilev Could not automatically backport d575968b to openjdk/jdk17u-dev due to conflicts in the following files:

  • src/hotspot/share/code/codeBlob.cpp

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk17u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk17u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b shipilev-backport-d575968b

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git d575968b4bde74bd557cb84e89f0fa0f96b04087

# Backport the commit
$ git cherry-pick --no-commit d575968b4bde74bd557cb84e89f0fa0f96b04087
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport d575968b4bde74bd557cb84e89f0fa0f96b04087'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk17u-dev with the title Backport d575968b4bde74bd557cb84e89f0fa0f96b04087.

@shipilev shipilev deleted the JDK-8316178-better-diagnostics-codeblobs branch November 28, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Development

Successfully merging this pull request may close these issues.

4 participants

Comments