Skip to content

8278423: ExtendedDTraceProbes should be deprecated #7110

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 12 commits into from

Conversation

eme64
Copy link
Contributor

@eme64 eme64 commented Jan 17, 2022

Deprecated ExtendedDTraceProbes.
Edited help messages and man pages accordingly, added the 3 flags to man pages.
Added flag to VMDeprecatedOptions test.
Replaced the flag with 3 flags in SDTProbesGNULinuxTest.java.

Checked that tests are not affected.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed
  • Change requires a CSR request to be approved

Issues

  • JDK-8278423: ExtendedDTraceProbes should be deprecated
  • JDK-8279629: ExtendedDTraceProbes should be deprecated (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7110

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 17, 2022

👋 Welcome back eme64! 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 Jan 17, 2022

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label Jan 17, 2022
@eme64 eme64 marked this pull request as ready for review January 18, 2022 08:04
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 18, 2022
@mlbridge
Copy link

mlbridge bot commented Jan 18, 2022

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 Emanuel,

There are a few changes needed as described in comments below. Also when we deprecate flags we add them to the VMDeprecatedOptions test.

Thanks,
David

@@ -2879,6 +2880,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
}
} else if (match_option(option, "-XX:+ExtendedDTraceProbes")) {
#if defined(DTRACE_ENABLED)
warning("-XX:+ExtendedDTraceProbes is deprecated. Use a combination of -XX:+DTraceMethodProbes, -XX:+DTraceAllocProbes and -XX:+DTraceMonitorProbes instead.");
Copy link
Member

Choose a reason for hiding this comment

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

Because the flag is deprecated, a deprecation warning will already be generated for it, so this will cause two warnings to be produced. You either put the flag in the special_jvm_flags table and accept the standard deprecation message, or else you don't put it in the table and handle the deprecation (and later obsoletion) warning directly. In this case the direct approach seems best.

Copy link
Contributor Author

@eme64 eme64 Jan 18, 2022

Choose a reason for hiding this comment

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

@dholmes-ora : The warning is actually not already generated, since this flag is handled separately, the handling is only done if none of the cases matches, and we land in the } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx case.
I had to add the warning separately now. I think this is a bug though, @TobiHartmann thought so too. All options should first be checked if they are deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you very much, I added the flag to the Test.

Copy link
Member

Choose a reason for hiding this comment

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

@eme64 thanks for that correction - yes I thought we checked all args up front and then processed the specialized logic. The opposite does make some sense though as it means we can use the table and do specialized handling. When the flag is obsoleted we delete the specialized handling.

@@ -2975,6 +2975,7 @@ different JDK version.
.RE
.TP
.B \f[CB]\-XX:+ExtendedDTraceProbes\f[R]
Deprecated. Use combination of these flags instead: -XX:+DTraceMethodProbes, -XX:+DTraceAllocProbes, -XX:+DTraceMonitorProbes
Copy link
Member

Choose a reason for hiding this comment

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

When a flag is deprecated we move it to the "Deprecated Java Options" section of the manpage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @dholmes-ora

@eme64
Copy link
Contributor Author

eme64 commented Jan 18, 2022

/label add hotspot

@eme64
Copy link
Contributor Author

eme64 commented Jan 18, 2022

/label remove hotspot-runtime

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Jan 18, 2022
@openjdk
Copy link

openjdk bot commented Jan 18, 2022

@eme64
The hotspot label was successfully added.

@openjdk openjdk bot removed the hotspot-runtime hotspot-runtime-dev@openjdk.org label Jan 18, 2022
@openjdk
Copy link

openjdk bot commented Jan 18, 2022

@eme64
The hotspot-runtime label was successfully removed.

@openjdk
Copy link

openjdk bot commented Jan 18, 2022

⚠️ @eme64 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).

@hseigel
Copy link
Member

hseigel commented Jan 18, 2022

Can you replace the use of -XX:+ExtendedDTraceProbes in test/hotspot/jtreg/serviceability/7170638/SDTProbesGNULinuxTest.java with the three new flags ?

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.

A few more tweaks below.

Thanks,
David

@@ -28,7 +28,6 @@
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.inline.hpp"
#include "services/attachListener.hpp"
#include "services/dtraceAttacher.hpp"
Copy link
Member

Choose a reason for hiding this comment

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

These changes are somewhat independent of the deprecation issue and could be split out into a separate RFE. The serviceability folk may have an opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dholmes-ora Ok, I reverted this and will do it in a separate RFE.

@@ -2879,6 +2880,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
}
} else if (match_option(option, "-XX:+ExtendedDTraceProbes")) {
#if defined(DTRACE_ENABLED)
warning("Option ExtendedDTraceProbes was deprecated in version 19 and will likely be removed in a future release.");
warning("Use a combination of -XX:+DTraceMethodProbes, -XX:+DTraceAllocProbes and -XX:+DTraceMonitorProbes instead.");
Copy link
Member

Choose a reason for hiding this comment

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

s/a/the/

Applies to all three uses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, changing it

@@ -4005,6 +3997,15 @@ Example:
\f[CB]\-Xlog:gc:garbage\-collection.log\f[R]
.RE
.TP
.B \f[CB]\-XX:+ExtendedDTraceProbes\f[R]
Deprecated. Use combination of these flags instead: -XX:+DTraceMethodProbes, -XX:+DTraceAllocProbes, -XX:+DTraceMonitorProbes
Copy link
Member

Choose a reason for hiding this comment

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

Delete "Deprecated" as we are in the deprecated options section.

The wording also needs updating as per the warning text ... though that might read a little odd here so I suggest a tweak:

Use the combination of -XX:+DTraceMethodProbes, -XX:+DTraceAllocProbes and -XX:+DTraceMonitorProbes instead of this deprecated flag.

I would also move that new text to the end, so we still describe the flag first (otherwise it again reads a little odd.)

We will also need to add those flags to the "ADVANCED SERVICEABILITY OPTIONS FOR JAVA" section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dholmes-ora thanks for the suggestions, I implemented them.

@dholmes-ora
Copy link
Member

/label add serviceability

This is really a serviceability flag, though it only does anything interesting in compiler code these days, so adding serviceability team to emails.

@openjdk openjdk bot added the serviceability serviceability-dev@openjdk.org label Jan 19, 2022
@openjdk
Copy link

openjdk bot commented Jan 19, 2022

@dholmes-ora
The serviceability label was successfully added.

…: /src/hotspot/share/services/dtraceAttacher.hpp"

This reverts commit 885b985.
@eme64 eme64 marked this pull request as draft February 9, 2022 15:38
@openjdk openjdk bot removed the rfr Pull request is ready for review label Feb 9, 2022
@eme64
Copy link
Contributor Author

eme64 commented Feb 9, 2022

Can you replace the use of -XX:+ExtendedDTraceProbes in test/hotspot/jtreg/serviceability/7170638/SDTProbesGNULinuxTest.java with the three new flags ?

Thank you @hseigel , I patched it according to your suggestion.

@eme64 eme64 marked this pull request as ready for review February 9, 2022 16:20
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 9, 2022
Copy link
Member

@hseigel hseigel left a comment

Choose a reason for hiding this comment

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

Other than the need to update the copyright dates to 2022, these changes look good.
Thanks, Harold

@openjdk
Copy link

openjdk bot commented Feb 9, 2022

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

8278423: ExtendedDTraceProbes should be deprecated

Reviewed-by: dholmes, hseigel, kvn, thartmann

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

  • aa918a6: 8281033: Improve ImageCheckboxTest to test all available LaF
  • 6fdfe04: 8281674: tools/javac/annotations/typeAnnotations/classfile/AnonymousExtendsTest.java fails with AssertionError
  • c3179a8: 8281462: Annotation toString output for enum not reusable for source input
  • 4032fe7: 8281238: TYPE_USE annotations not printed in correct position in toString output
  • 83ffbd2: 8277175: Add a parallel multiply method to BigInteger
  • 0786ddb: 8281535: Create a regression test for JDK-4670051
  • c5ff6e4: 8223077: module path support for dynamic CDS archive
  • 8886839: 8281622: JFR: Improve documentation of jdk.jfr.Relational
  • e75e8cd: 8279997: check_for_dynamic_dump should not exit vm
  • e73ee0c: 8281259: MutableBigInteger subtraction could be simplified
  • ... and 456 more: https://git.openjdk.java.net/jdk/compare/62d03c283667c4122130ec9bbeec623e6a2840e5...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 (@dholmes-ora, @hseigel, @vnkozlov, @TobiHartmann) 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 Feb 9, 2022
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 Emanuel,

A few minor nits below.

Thanks,
David

@@ -1864,7 +1864,9 @@ const intx ObjectAlignmentInBytes = 8;
"Pause and wait for keypress on exit if a debugger is attached") \
\
product(bool, ExtendedDTraceProbes, false, \
"Enable performance-impacting dtrace probes") \
"(Deprecated) Enable performance-impacting dtrace probes. " \
"Use a combination of -XX:+DTraceMethodProbes, " \
Copy link
Member

Choose a reason for hiding this comment

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

You missed changing 'a' to 'the' here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

that affect the performance.
By default, this option is disabled and \f[CB]dtrace\f[R] performs only
standard probes.
.B \f[CB]\-XX:+DTraceAllocProbes\f[R]
Copy link
Member

Choose a reason for hiding this comment

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

The three newly documented flags should all be marked "Linux and macOS". It is somewhat of a poor design that the flags are available on all platforms but only have an effect on systems with DTrace or SystemTap support - which (for our main platforms) is Linux and macOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

that affect the performance.
By default, this option is disabled and \f[CB]dtrace\f[R] performs only
standard probes.
Use the combination of these flags instead: -XX:+DTraceMethodProbes, -XX:+DTraceAllocProbes, -XX:+DTraceMonitorProbes
Copy link
Member

Choose a reason for hiding this comment

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

The flags should be in a code font (use `-XX:...` in the markdown source).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -4005,6 +4012,15 @@ Example:
\f[CB]\-Xlog:gc:garbage\-collection.log\f[R]
.RE
.TP
.B \f[CB]\-XX:+ExtendedDTraceProbes\f[R]
\f[B]Linux and macOS:\f[R] Enables additional \f[CB]dtrace\f[R] tool probes
that affect the performance.
Copy link
Member

Choose a reason for hiding this comment

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

Existing grammatical nit: please delete 'the'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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.

Thanks for the updates.

David

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.

Good.

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.

@eme64
Copy link
Contributor Author

eme64 commented Feb 12, 2022

Thanks @dholmes-ora , @vnkozlov , @TobiHartmann @hseigel for the reviews.
/integrate

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

openjdk bot commented Feb 12, 2022

@eme64
Your change (at version 78d8e00) is now ready to be sponsored by a Committer.

@dholmes-ora
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Feb 12, 2022

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

  • 58dae60: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake
  • aa918a6: 8281033: Improve ImageCheckboxTest to test all available LaF
  • 6fdfe04: 8281674: tools/javac/annotations/typeAnnotations/classfile/AnonymousExtendsTest.java fails with AssertionError
  • c3179a8: 8281462: Annotation toString output for enum not reusable for source input
  • 4032fe7: 8281238: TYPE_USE annotations not printed in correct position in toString output
  • 83ffbd2: 8277175: Add a parallel multiply method to BigInteger
  • 0786ddb: 8281535: Create a regression test for JDK-4670051
  • c5ff6e4: 8223077: module path support for dynamic CDS archive
  • 8886839: 8281622: JFR: Improve documentation of jdk.jfr.Relational
  • e75e8cd: 8279997: check_for_dynamic_dump should not exit vm
  • ... and 457 more: https://git.openjdk.java.net/jdk/compare/62d03c283667c4122130ec9bbeec623e6a2840e5...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 12, 2022

@dholmes-ora @eme64 Pushed as commit 67077a0.

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

@dholmes-ora
Copy link
Member

@eme64 the test fails in our CI as it encounters builds for which DTrace is not enabled - see JDK-8281675.

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 serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

5 participants