Skip to content

8295851: Do not use ttyLock in BytecodeTracer::trace #25915

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

coleenp
Copy link
Contributor

@coleenp coleenp commented Jun 20, 2025

This didn't need ttyLock for synchronization, the code only needs to see if the method changes so it can print the method name before the bytecodes, like:

[490166] static void java.lang.String.()
[490166] 13 18 putstatic 613 <java/lang/String.CASE_INSENSITIVE_ORDER:Ljava/util/Comparator;>
[490166] 14 21 return

[490166] static void java.lang.System.()
[490166] 15 0 invokestatic 471 <java/lang/System.registerNatives()V>
[490166] 16 3 aconst_null
[490166] 17 4 putstatic 474 <java/lang/System.in:Ljava/io/InputStream;>

Verified manually and added some parallelism to the test, and fixed trace() to initialize is_linked(), which it always is.
Also ran tier1-4.


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-8295851: Do not use ttyLock in BytecodeTracer::trace (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25915

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 20, 2025

👋 Welcome back coleenp! 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 Jun 20, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 20, 2025
@openjdk
Copy link

openjdk bot commented Jun 20, 2025

@coleenp 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.

@mlbridge
Copy link

mlbridge bot commented Jun 20, 2025

Webrevs

Comment on lines +179 to +182
// We need a global instance to keep track of the method being printed so we can report that
// the method has changed. If this method is redefined and removed, that's ok because the method passed in won't match, and
// this will print that one.
static Method* _current_method = nullptr;
Copy link
Member

Choose a reason for hiding this comment

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

And if we are calling trace_interpreter from multiple threads they will each stomp on this shared global field. Sorry I can't see how some form of locking is not needed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants