Skip to content

Conversation

@mgronlun
Copy link

@mgronlun mgronlun commented Dec 1, 2023

Greetings,

please help review this enhancement to add a JFR event to report runtime invocations of methods that have been declared deprecated in the JDK.

Testing: jdk_jfr, CI 1-6, stress testing

Thanks
Markus


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-8211238: @Deprecated JFR event (Enhancement - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16931

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 1, 2023

👋 Welcome back mgronlun! 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 Dec 1, 2023

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

  • build
  • hotspot

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 build build-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Dec 1, 2023
@mgronlun
Copy link
Author

mgronlun commented Dec 1, 2023

/label add hotspot-jfr

@openjdk openjdk bot added the hotspot-jfr hotspot-jfr-dev@openjdk.org label Dec 1, 2023
@openjdk
Copy link

openjdk bot commented Dec 1, 2023

@mgronlun
The hotspot-jfr label was successfully added.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 2, 2023
@mlbridge
Copy link

mlbridge bot commented Dec 2, 2023

@openjdk
Copy link

openjdk bot commented Dec 2, 2023

⚠️ @mgronlun This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk openjdk bot removed the rfr Pull request is ready for review label Dec 3, 2023
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 3, 2023
@AlanBateman
Copy link
Contributor

A question about "level". Is the intention that the value can be anything, e.g. some new event next month might use the values "1", "2, "3"? Just asking because ordinarily deprecated vs. terminally deprecated is very specific to the manner in which a program element is deprecated and I assume you don't want this event grabbing the general name for a very specific event setting.

@mgronlun
Copy link
Author

mgronlun commented Dec 3, 2023

A question about "level". Is the intention that the value can be anything, e.g. some new event next month might use the values "1", "2, "3"? Just asking because ordinarily deprecated vs. terminally deprecated is very specific to the manner in which a program element is deprecated and I assume you don't want this event grabbing the general name for a very specific event setting.

Yes, the design is generic. An event control/setting to be used also for other events.

@jbachorik
Copy link

Hi @mgronlun - sorry for opening a design discussion in PR :(

I wonder - will this report each single one invocation of a deprecated method conforming to the rules (JDK method called from non-JDK code)? Can this, potentially, flood the recording if the deprecated method gets called from a hot loop?

@mgronlun
Copy link
Author

mgronlun commented Dec 4, 2023

Hi @mgronlun - sorry for opening a design discussion in PR :(

I wonder - will this report each single one invocation of a deprecated method conforming to the rules (JDK method called from non-JDK code)? Can this, potentially, flood the recording if the deprecated method gets called from a hot loop?

Hi @jbachorik, it will only report one event per unique call site, during link time. Its not a function of hotness, only unique edge discovery.

@magicus
Copy link
Member

magicus commented Dec 4, 2023

/label -build

@openjdk openjdk bot removed the build build-dev@openjdk.org label Dec 4, 2023
@openjdk
Copy link

openjdk bot commented Dec 4, 2023

@magicus
The build label was successfully removed.

@jbachorik
Copy link

Hi @jbachorik, it will only report one event per unique call site, during link time. Its not a function of hotness, only unique edge discovery.

Excellent! Thanks!

@openjdk
Copy link

openjdk bot commented Dec 6, 2023

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

8211238: @Deprecated JFR event

Reviewed-by: egahlin, jbachorik

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

  • 656b446: 8320969: Shenandoah: Enforce stable number of GC workers
  • 9a87e52: 8320538: Obsolete CSS styles in collection framework doc-file
  • 03c4595: 8321164: javac with annotation processor throws AssertionError: Filling jrt:/... during JarFileObject[/...]
  • 632a3c5: 8305825: getBounds API returns wrong value resulting in multiple Regression Test Failures on Ubuntu 23.04
  • 75a7c19: 8315827: Kitchensink.java and RenaissanceStressTest.java time out with jvmti module errors
  • 91ffdfb: 8320365: IPPPrintService.getAttributes() causes blanket re-initialisation
  • 50baaf4: 8321013: Parallel: Refactor ObjectStartArray
  • afb8964: 8320443: [macos] Test java/awt/print/PrinterJob/PrinterDevice.java fails on macOS
  • 82796bd: 8320570: NegativeArraySizeException decoding >1G UTF8 bytes with non-ascii characters
  • 781775d: 8321484: Make TestImplicitlyDeclaredClasses release independent
  • ... and 71 more: https://git.openjdk.org/jdk/compare/5dee2a36756caba28cf12920dc562278576f6de0...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 Dec 6, 2023
@mgronlun
Copy link
Author

mgronlun commented Dec 7, 2023

Many thanks, @jbachorik and @egahlin, for your reviews - much appreciated!

@mgronlun
Copy link
Author

mgronlun commented Dec 7, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Dec 7, 2023

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

  • 656b446: 8320969: Shenandoah: Enforce stable number of GC workers
  • 9a87e52: 8320538: Obsolete CSS styles in collection framework doc-file
  • 03c4595: 8321164: javac with annotation processor throws AssertionError: Filling jrt:/... during JarFileObject[/...]
  • 632a3c5: 8305825: getBounds API returns wrong value resulting in multiple Regression Test Failures on Ubuntu 23.04
  • 75a7c19: 8315827: Kitchensink.java and RenaissanceStressTest.java time out with jvmti module errors
  • 91ffdfb: 8320365: IPPPrintService.getAttributes() causes blanket re-initialisation
  • 50baaf4: 8321013: Parallel: Refactor ObjectStartArray
  • afb8964: 8320443: [macos] Test java/awt/print/PrinterJob/PrinterDevice.java fails on macOS
  • 82796bd: 8320570: NegativeArraySizeException decoding >1G UTF8 bytes with non-ascii characters
  • 781775d: 8321484: Make TestImplicitlyDeclaredClasses release independent
  • ... and 71 more: https://git.openjdk.org/jdk/compare/5dee2a36756caba28cf12920dc562278576f6de0...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Dec 7, 2023

@mgronlun Pushed as commit 49fff01.

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

Development

Successfully merging this pull request may close these issues.

5 participants