Skip to content

8304089: Convert TraceDependencies to UL #13007

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

Conversation

coleenp
Copy link
Contributor

@coleenp coleenp commented Mar 13, 2023

This change converts TraceDependencies to UL and removes the develop option. I think this provides further flexibility to add tags to only trace certain things in dependency analysis, as I did when trying to understand a PR for a deoptimization change. For now, the messages are the same and the option is -Xlog:dependencies=debug.
Tested with 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

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13007

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 13, 2023

👋 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 Mar 13, 2023

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

  • hotspot

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 hotspot-dev@openjdk.org label Mar 13, 2023
@coleenp coleenp changed the title Logging 8304089: Convert TraceDependencies to UL Mar 14, 2023
@coleenp coleenp marked this pull request as ready for review March 14, 2023 13:22
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 14, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 14, 2023

Webrevs

Copy link
Contributor

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

@openjdk
Copy link

openjdk bot commented Mar 14, 2023

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

8304089: Convert TraceDependencies to UL

Reviewed-by: vlivanov, 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 91 new commits pushed to the master branch:

  • 0156909: 8304502: Classfile API class hierarchy makes assumptions when class is not resolved
  • 0deb648: 8290200: com/sun/jdi/InvokeHangTest.java fails with "Debuggee appears to be hung"
  • 019fcd8: 8304139: Add and method constants to ConstantDescs
  • d6f20e2: 8304680: Problemlist compiler/sharedstubs/SharedStubToInterpTest.java
  • d788a1b: 8304180: Constant Descriptors for MethodHandles::classData and classDataAt
  • bbde215: 8299494: Test vmTestbase/nsk/stress/except/except011.java failed: ExceptionInInitializerError: target class not found
  • 1c04686: 8304387: Fix positions of shared static stubs / trampolines
  • c65bb2c: 8304334: java/awt/color/ICC_ColorSpace/ToFromCIEXYZRoundTrip.java times out on slow platforms
  • 4bf1fbb: 8303648: Add String.indexOf(String str, int beginIndex, int endIndex)
  • c4df9b5: 8304537: Ant-based langtools build fails after JDK-8015831 Add lint check for calling overridable methods from a constructor
  • ... and 81 more: https://git.openjdk.org/jdk/compare/55aa122462c34d8f4cafa58f4d1f2d900449c83e...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 Mar 14, 2023
@coleenp
Copy link
Contributor Author

coleenp commented Mar 14, 2023

Thank you Vladimir.

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.

Overall looks good. Just a couple of small tweaks needed.

Thanks.

@@ -3586,7 +3586,7 @@ static bool use_vm_log() {
if (LogCompilation || !FLAG_IS_DEFAULT(LogFile) ||
PrintCompilation || PrintInlining || PrintDependencies || PrintNativeNMethods ||
PrintDebugInfo || PrintRelocations || PrintNMethods || PrintExceptionHandlers ||
PrintAssembly || TraceDeoptimization || TraceDependencies ||
PrintAssembly || TraceDeoptimization || log_is_enabled(Debug, dependencies) ||
Copy link
Member

Choose a reason for hiding this comment

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

Now TraceDependencies is converted to UL I think it should just be deleted from this function. We don't need to enable LogVMOutput in that case.

Copy link
Contributor Author

@coleenp coleenp Mar 15, 2023

Choose a reason for hiding this comment

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

No, this is the right thing to do. If -Xlog:dependency - the compiler group also expects the dependency printed to the compiler log file. The logging is a separate mechanism, but should be enabled with -Xlog:dependency.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry I don't follow that. use_vm_log() only affects non-product builds and forces LogVMOutput to true. That in turn will cause defaultStream::init_log() to execute which initializes the log file etc. But I don't see how that would cause UL logging for "dependencies" to also get written to the log file???

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See the function log_dependency()

void Dependencies::DepStream::log_dependency(Klass* witness) {

called from here (as one place).

log_dependency(witness);

When TraceDependencies was true, the log file would be non-null and log_dependency would write to it. Keeping this with -Xlog:dependencies=debug retains what TraceDependencies did.

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm this seems broken to me then. We output the general dependency logging to one place based on UL configuration, but then we output log_dependency to the log file. If these are meant to be related and always reported together then we have lost that. If they are actually unrelated then this may still need the TraceDependencies flag to control it.

@iwanowww can you comment on this please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we don't need this -Xlog test in this place, because this is also what PrintDependencies does.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, UL check doesn't help here. Irrespective of the check, UL output isn't automatically placed in VM log.
It's convenient for LogCompilation to have VM output along with other VM events present in the log.
Having said that, I'm fine with dropping TraceDependencies check here and improve the interaction between UL and LogVMOutput separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay thank you.

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.

Nothing further from me - update is good. Thanks.

@coleenp
Copy link
Contributor Author

coleenp commented Mar 22, 2023

Thank you Vladimir and David.
/integrate

@openjdk
Copy link

openjdk bot commented Mar 22, 2023

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

  • 358c61b: 8294972: Convert jdk.jlink internal plugins to use the Classfile API
  • c74507e: 8304657: G1: Rename set_state_empty to set_state_untracked
  • ca94287: 8304144: G1: Remove unnecessary is_survivor check in G1ClearCardTableTask
  • eda0065: 8304286: java/net/SocketOption/OptionsTest.java failing after JDK-8302659
  • c039d26: 8303804: Fix some errors of If-VectorTest and CMove-VectorTest
  • 0156909: 8304502: Classfile API class hierarchy makes assumptions when class is not resolved
  • 0deb648: 8290200: com/sun/jdi/InvokeHangTest.java fails with "Debuggee appears to be hung"
  • 019fcd8: 8304139: Add and method constants to ConstantDescs
  • d6f20e2: 8304680: Problemlist compiler/sharedstubs/SharedStubToInterpTest.java
  • d788a1b: 8304180: Constant Descriptors for MethodHandles::classData and classDataAt
  • ... and 86 more: https://git.openjdk.org/jdk/compare/55aa122462c34d8f4cafa58f4d1f2d900449c83e...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 22, 2023

@coleenp Pushed as commit ddf1e34.

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

@coleenp coleenp deleted the trace-dependencies-logging branch March 22, 2023 12:39
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
Development

Successfully merging this pull request may close these issues.

3 participants