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

8345955: Deprecate the UseOprofile flag with a view to removing the legacy oprofile support in the VM #22674

Closed
wants to merge 1 commit into from

Conversation

dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Dec 11, 2024

Please review this simple change to deprecate the UseOprofile flag in JDK 25, with a view to obsoleting it in JDK 26.

The VM has supported the Linux OProfile profiler since 2005, however to work properly with OProfile's Linux kernel module (ref lookup_dcookie()), the VM has to change the way compiled code memory is mapped. That is done under the control of the UseOprofile flag (default false). Since 2012 OProfile has not needed the kernel module, and it was removed from the kernel in 2021. Consequently this special code and the UseOprofile flag are not needed.

Could I also get a Reviewer for the CSR request please.

Testing: tiers 1-3 (sanity)

Thanks


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
  • Change requires CSR request JDK-8345956 to be approved

Issues

  • JDK-8345955: Deprecate the UseOprofile flag with a view to removing the legacy oprofile support in the VM (Enhancement - P4)
  • JDK-8345956: Deprecate the UseOprofile flag with a view to removing the legacy oprofile support in the VM (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22674

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 11, 2024

👋 Welcome back dholmes! 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 11, 2024

@dholmes-ora 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:

8345955: Deprecate the UseOprofile flag with a view to removing the legacy oprofile support in the VM

Reviewed-by: iklam, shade

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

  • ec219ae: 8346039: [BACKOUT] - [C1] LIR Operations with one input should be implemented as LIR_Op1
  • 05c5678: 8345959: Make JVM_IsStaticallyLinked JVM_LEAF
  • 64fad1c: 8345797: Update copyright year to 2024 for client-libs in files where it was missed
  • ddf0461: 8345799: Update copyright year to 2024 for core-libs in files where it was missed
  • cbab40b: 8345683: Remove special flags for files compiled for static libraries
  • 08bdeed: 8345269: Fix -Wzero-as-null-pointer-constant warnings in ppc code
  • e4a34e9: 8345616: Unnecessary Hashtable usage in javax.swing.text.html.parser.Element
  • cce5808: 8345421: (bf) Create specific test for temporary direct buffers and the buffer size limit
  • cf0e1aa: 8345335: Add excluded jdk_foreign tests to manual group
  • 2c4567a: 8342651: Refactor array constant to use an array of jbyte
  • ... and 19 more: https://git.openjdk.org/jdk/compare/c6317191e323e27cde61b5ed3c23d1a230053969...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 csr Pull request needs approved CSR before integration rfr Pull request is ready for review labels Dec 11, 2024
@openjdk
Copy link

openjdk bot commented Dec 11, 2024

@dholmes-ora 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 Dec 11, 2024
@mlbridge
Copy link

mlbridge bot commented Dec 11, 2024

Webrevs

@iklam
Copy link
Member

iklam commented Dec 11, 2024

The UseOprofile flag is still used in linux_wrap_code(). Should we remove this function as well?

void linux_wrap_code(char* base, size_t size) {
static volatile jint cnt = 0;
static_assert(sizeof(off_t) == 8, "Expected Large File Support in this file");
if (!UseOprofile) {
return;
}
char buf[PATH_MAX+1];
int num = Atomic::add(&cnt, 1);
snprintf(buf, sizeof(buf), "%s/hs-vm-%d-%d",
os::get_temp_directory(), os::current_process_id(), num);
unlink(buf);
int fd = ::open(buf, O_CREAT | O_RDWR, S_IRWXU);
if (fd != -1) {
off_t rv = ::lseek(fd, size-2, SEEK_SET);
if (rv != (off_t)-1) {
if (::write(fd, "", 1) == 1) {
mmap(base, size,
PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE, fd, 0);
}
}
::close(fd);
unlink(buf);
}
}

@dholmes-ora
Copy link
Member Author

@iklam at this stage we are only deprecating the flag to prepare for the code removal in JDK 26.

Copy link
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

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

LGTM

@dholmes-ora
Copy link
Member Author

Thanks for the review @iklam !

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Dec 12, 2024
@dholmes-ora
Copy link
Member Author

Thanks for the review @shipilev !

/integrate

@openjdk
Copy link

openjdk bot commented Dec 12, 2024

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

  • 72c59de: 8345876: Update nativeAddAtIndex comment to match the code
  • 75cfb64: 8310691: [REDO] [vectorapi] Refactor VectorShuffle implementation
  • 4da6fd4: 8345423: Shenandoah: Parallelize concurrent cleanup
  • ec219ae: 8346039: [BACKOUT] - [C1] LIR Operations with one input should be implemented as LIR_Op1
  • 05c5678: 8345959: Make JVM_IsStaticallyLinked JVM_LEAF
  • 64fad1c: 8345797: Update copyright year to 2024 for client-libs in files where it was missed
  • ddf0461: 8345799: Update copyright year to 2024 for core-libs in files where it was missed
  • cbab40b: 8345683: Remove special flags for files compiled for static libraries
  • 08bdeed: 8345269: Fix -Wzero-as-null-pointer-constant warnings in ppc code
  • e4a34e9: 8345616: Unnecessary Hashtable usage in javax.swing.text.html.parser.Element
  • ... and 22 more: https://git.openjdk.org/jdk/compare/c6317191e323e27cde61b5ed3c23d1a230053969...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Dec 12, 2024

@dholmes-ora Pushed as commit ceb4366.

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

@dholmes-ora dholmes-ora deleted the 8345955-oprofile branch December 12, 2024 07:57
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.

3 participants