Skip to content

8335946: DTrace code snippets should be generated when DTrace flags are enabled #20090

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

Closed
wants to merge 2 commits into from

Conversation

kuaiwei
Copy link
Contributor

@kuaiwei kuaiwei commented Jul 9, 2024

Some DTrace code snippets are generated no matter dtrace is enabled or not. It looks dtrace flags could be dynamic changed in previous jdk releases. Since they are not changeable, the code snippets can be generated based on flags. The code snippets are:

  1. method entry of native wrapper
  2. method entry/exit of interpreter
  3. allocation of interpreter

For example, run this command and check output with x86_64 build:
./java -XX:+UnlockDiagnosticVMOptions -XX:+PrintNativeNMethods -version

  0x00007f541436418f: cmpb $0x0,0x163c8b17(%rip) # 0x00007f542a72ccad
                                                            ; {external_word}
  0x00007f5414364196: je 0x00007f54143641d0
  0x00007f541436419c: push %rsi
  0x00007f541436419d: push %rdx
  0x00007f541436419e: push %rcx
  0x00007f541436419f: movabs $0x7f5386436860,%rsi ; {metadata({method} {0x00007f5386436860} 'getReferenceVolatile' '(Ljava/lang/Object;J)Ljava/lang/Object;' in 'jdk/internal/misc/Unsafe')}
  0x00007f54143641a9: mov %r15,%rdi
  0x00007f54143641ac: test $0xf,%spl
  0x00007f54143641b0: je 0x00007f54143641c8
  0x00007f54143641b6: sub $0x8,%rsp
  0x00007f54143641ba: callq 0x00007f5429ffe180 ; {runtime_call SharedRuntime::dtrace_method_entry(JavaThread*, Method*)}
  0x00007f54143641bf: add $0x8,%rsp
  0x00007f54143641c3: jmpq 0x00007f54143641cd
  0x00007f54143641c8: callq 0x00007f5429ffe180 ; {runtime_call SharedRuntime::dtrace_method_entry(JavaThread*, Method*)}
  0x00007f54143641cd: pop %rcx
  0x00007f54143641ce: pop %rdx
  0x00007f54143641cf: pop %rsi

Apply this patch, dtrace_method invocation will be emitted only when DTraceMethodProbes is enabled.


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-8335946: DTrace code snippets should be generated when DTrace flags are enabled (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20090

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 9, 2024

👋 Welcome back kuaiwei! 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 Jul 9, 2024

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

8335946: DTrace code snippets should be generated when DTrace flags are enabled

Reviewed-by: coleenp, dholmes

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:

  • a44b60c: 8335778: runtime/ClassInitErrors/TestStackOverflowDuringInit.java fails on ppc64 platforms after JDK-8334545
  • b5909ca: 8323242: Remove vestigial DONT_USE_REGISTER_DEFINES
  • dcf4e0d: 8335966: Remove incorrect problem listing of java/lang/instrument/NativeMethodPrefixAgent.java in ProblemList-Virtual.txt
  • 1472124: 8333364: Minor cleanup could be done in com.sun.crypto.provider
  • 7e11fb7: 8335688: Fix -Wzero-as-null-pointer-constant warnings from fflush calls in jvmti tests
  • 531a6d8: 8335911: Document ccls indexer in doc/ide.md
  • 0e0dfca: 8330806: test/hotspot/jtreg/compiler/c1/TestLargeMonitorOffset.java fails on ARM32
  • f3ff4f7: 8335882: platform/cgroup/TestSystemSettings.java fails on Alpine Linux
  • 8f62f31: 8335906: [s390x] Test Failure: GTestWrapper.java
  • 2a29647: 8334777: Test javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java failed with NullPointerException
  • ... and 18 more: https://git.openjdk.org/jdk/compare/3f37c5718d676b7001e6a084aed3ba645745a144...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 (@coleenp, @dholmes-ora) 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
Copy link

openjdk bot commented Jul 9, 2024

@kuaiwei 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 Jul 9, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 9, 2024
@mlbridge
Copy link

mlbridge bot commented Jul 9, 2024

Webrevs

@TobiHartmann
Copy link
Member

/label remove hotspot-compiler
/label add hotspot-runtime

I think this should go to hotspot-runtime.

@openjdk openjdk bot removed the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jul 9, 2024
@openjdk
Copy link

openjdk bot commented Jul 9, 2024

@TobiHartmann
The hotspot-compiler label was successfully removed.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Jul 9, 2024
@openjdk
Copy link

openjdk bot commented Jul 9, 2024

@TobiHartmann
The hotspot-runtime label was successfully added.

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

This looks good. Does anyone use DTRACE?

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 9, 2024
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.

Looks reasonable. The dynamic DTrace ability was only on Solaris.

Thanks

@kuaiwei
Copy link
Contributor Author

kuaiwei commented Jul 10, 2024

Thanks for review.

@kuaiwei
Copy link
Contributor Author

kuaiwei commented Jul 10, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jul 10, 2024
@openjdk
Copy link

openjdk bot commented Jul 10, 2024

@kuaiwei
Your change (at version 0fe5d82) is now ready to be sponsored by a Committer.

@dholmes-ora
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 11, 2024

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

  • d6c6847: 8335743: jhsdb jstack cannot print some information on the waiting thread
  • cad68e0: 8335935: Chained builders not sending transformed models to next transforms
  • 242f113: 8334481: [JVMCI] add LINK_TO_NATIVE to MethodHandleAccessProvider.IntrinsicMethod
  • 66db715: 8335637: Add explicit non-null return value expectations to Object.toString()
  • 7ab96c7: 8335409: Can't allocate and retain memory from resource area in frame::oops_interpreted_do oop closure after 8329665
  • fb66716: 8331725: ubsan: pc may not always be the entry point for a VtableStub
  • fb9a227: 8313909: [JVMCI] assert(cp->tag_at(index).is_unresolved_klass()) in lookupKlassInPool
  • e6c5aa7: 8336012: Fix usages of jtreg-reserved properties
  • e0fb949: 8335779: JFR: Hide sleep events
  • 537d20a: 8335766: Switch case with pattern matching and guard clause compiles inconsistently
  • ... and 28 more: https://git.openjdk.org/jdk/compare/3f37c5718d676b7001e6a084aed3ba645745a144...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 11, 2024
@openjdk openjdk bot closed this Jul 11, 2024
@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 Jul 11, 2024
@openjdk
Copy link

openjdk bot commented Jul 11, 2024

@dholmes-ora @kuaiwei Pushed as commit b363de8.

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

@kuaiwei
Copy link
Contributor Author

kuaiwei commented Jul 11, 2024

@dholmes-ora Thanks for your help.

@kuaiwei kuaiwei deleted the fix_dtrace branch July 11, 2024 03:38
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
Development

Successfully merging this pull request may close these issues.

4 participants