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

8296301: Interpreter(RISC-V): Implement -XX:+PrintBytecodeHistogram and -XX:+PrintBytecodePairHistogram options #11051

Closed
wants to merge 2 commits into from

Conversation

yhzhu20
Copy link

@yhzhu20 yhzhu20 commented Nov 9, 2022

In this patch, count_bytecode() is modified by using "x7" as temporary register. Also implement histogram_bytecode() and histogram_bytecode_pair(), which can be enabled on debug mode by setting the options PrintBytecodeHistogram and PrintBytecodePairHistogram.

The following is the output when PrintBytecodeHistogram or PrintBytecodePairHistogram is TRUE.

$ java -XX:+PrintBytecodeHistogram --version|head -n 20
openjdk 20 2022-11-09
OpenJDK Runtime Environment (fastdebug build 20)
OpenJDK 64-Bit Server VM (fastdebug build 20, mixed mode)

Histogram of 8101142 executed bytecodes:

  absolute  relative  code    name
----------------------------------------------------------------------
    634592     7.83%    dc    fast_aload_0
    471840     5.82%    b6    invokevirtual
    376275     4.64%    2b    aload_1
    358520     4.43%    e0    fast_iload
    332267     4.10%    de    fast_aaccess_0
    270189     3.34%    a7    goto
    249831     3.08%    19    aload
    223361     2.76%    b9    invokeinterface
    215666     2.66%    1c    iload_2
    194877     2.41%    b8    invokestatic
    192212     2.37%    2c    aload_2
    185826     2.29%    1b    iload_1

$ java -XX:+PrintBytecodePairHistogram --version|head -n 20
openjdk 20 2022-11-09
OpenJDK Runtime Environment (fastdebug build 20)
OpenJDK 64-Bit Server VM (fastdebug build 20, mixed mode)

Histogram of 7627721 executed bytecode pairs:

  absolute  relative    codes    1st bytecode        2nd bytecode
----------------------------------------------------------------------
    102673    1.346%    84 a7    iinc                goto
     85429    1.120%    dc 2b    fast_aload_0        aload_1
     84394    1.106%    dc b6    fast_aload_0        invokevirtual
     73131    0.959%    b7 dc    invokespecial       fast_aload_0
     64605    0.847%    2b b6    aload_1             invokevirtual
     64086    0.840%    dc b9    fast_aload_0        invokeinterface
     63663    0.835%    b6 dc    invokevirtual       fast_aload_0
     59946    0.786%    b6 de    invokevirtual       fast_aaccess_0
     56631    0.742%    36 e0    istore              fast_iload
     51261    0.672%    b9 de    invokeinterface     fast_aaccess_0
     49556    0.650%    3a 19    astore              aload
     49106    0.644%    a7 e0    goto                fast_iload

The items in column "relative" are equal to percentages of bytecodes in the result of the TraceBytecodes option(counting bytecodes manually).


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-8296301: Interpreter(RISC-V): Implement -XX:+PrintBytecodeHistogram and -XX:+PrintBytecodePairHistogram options

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11051

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 9, 2022

👋 Welcome back yzhu! 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
Copy link

openjdk bot commented Nov 9, 2022

@yhzhu20 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 Nov 9, 2022
@yhzhu20 yhzhu20 changed the title 8296301:Interpreter(RISC-V): Implement -XX:+PrintBytecodeHistogram and -XX:+PrintBytecodePairHistogram options 8296301: Interpreter(RISC-V): Implement -XX:+PrintBytecodeHistogram and -XX:+PrintBytecodePairHistogram options Nov 9, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 9, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 9, 2022

Webrevs

__ pop_reg(x10);
__ pop_reg(t0);
__ mv(x7, (address) &BytecodeCounter::_counter_value);
__ atomic_addalw(noreg, 1, x7);
Copy link
Member

Choose a reason for hiding this comment

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

I think a simpler __ atomic_addw will do here? I don't think there is any memory ordering issue here.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for your review. Fixed.

Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

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

Updated change looks good. Thanks.

@openjdk
Copy link

openjdk bot commented Nov 11, 2022

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

8296301: Interpreter(RISC-V): Implement -XX:+PrintBytecodeHistogram and -XX:+PrintBytecodePairHistogram options

Reviewed-by: fjiang, fyang

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

  • 12e76cb: 8296349: [aarch64] Avoid slicing Address::extend
  • 7244eac: 8296771: RISC-V: C2: assert(false) failed: bad AD file
  • 956d75b: 8295099: vmTestbase/nsk/stress/strace/strace013.java failed with "TestFailure: wrong lengths of stack traces: strace013Thread0: NNN strace013Thread83: MMM"
  • 2f9a94f: 8296824: ProblemList compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java
  • 43ebd96: 8296822: ProblemList jdk/jfr/api/consumer/TestRecordingFileWrite.java
  • 84e1224: 8296496: Overzealous check in sizecalc.h prevents large memory allocation
  • 27527b4: 8296612: CertAttrSet is useless
  • 6b456f7: 8262901: [macos_aarch64] NativeCallTest expected:<-3.8194101E18> but was:<3.02668882E10>
  • e1badb7: 8295871: G1: Use different explicit claim marks for CLDs
  • 9ef7852: 8290714: Make com.sun.jndi.dns.DnsClient virtual threads friendly
  • ... and 91 more: https://git.openjdk.org/jdk/compare/19507470c458182be04cdd75b5b819013c5e0115...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@RealFYang) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 11, 2022
@yhzhu20
Copy link
Author

yhzhu20 commented Nov 11, 2022

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 11, 2022
@openjdk
Copy link

openjdk bot commented Nov 11, 2022

@yhzhu20
Your change (at version 26e70df) is now ready to be sponsored by a Committer.

@RealFYang
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 11, 2022

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

  • f754840: 8296773: G1: Factor out hash function for G1CardSet
  • fdabd37: 8293696: java/nio/channels/DatagramChannel/SelectWhenRefused.java fails with "Unexpected wakeup"
  • 4a30081: 8296747: com/sun/net/httpserver/simpleserver/StressDirListings.java timed out
  • 12e76cb: 8296349: [aarch64] Avoid slicing Address::extend
  • 7244eac: 8296771: RISC-V: C2: assert(false) failed: bad AD file
  • 956d75b: 8295099: vmTestbase/nsk/stress/strace/strace013.java failed with "TestFailure: wrong lengths of stack traces: strace013Thread0: NNN strace013Thread83: MMM"
  • 2f9a94f: 8296824: ProblemList compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java
  • 43ebd96: 8296822: ProblemList jdk/jfr/api/consumer/TestRecordingFileWrite.java
  • 84e1224: 8296496: Overzealous check in sizecalc.h prevents large memory allocation
  • 27527b4: 8296612: CertAttrSet is useless
  • ... and 94 more: https://git.openjdk.org/jdk/compare/19507470c458182be04cdd75b5b819013c5e0115...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 11, 2022

@RealFYang @yhzhu20 Pushed as commit d4d183e.

💡 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
3 participants