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
JDK-8278329: some TraceDeoptimization code not included in PRODUCT build #6746
Conversation
👋 Welcome back tobiasholenstein! A progress list of the required criteria for merging this PR into |
@tobiasholenstein The following label will be automatically applied to this pull request:
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. |
Webrevs
|
@@ -245,6 +243,7 @@ static bool rematerialize_objects(JavaThread* thread, int exec_mode, CompiledMet | |||
assert(Universe::heap()->is_in_or_null(result), "must be heap pointer"); | |||
if (TraceDeoptimization) { | |||
tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, p2i(result), p2i(thread)); | |||
tty->cr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this tty->cr()
necessary given the print_cr
call above?
if (TraceDeoptimization) { | ||
tty->print_cr("DEOPT UNPACKING thread " INTPTR_FORMAT " vframeArray " INTPTR_FORMAT " mode %d", | ||
p2i(thread), p2i(array), exec_mode); | ||
tty->cr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above about the necessity of cr()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEOPT PACKING thread 0x00007f9b9b008a20 Compiled frame (sp=0x0000700002121f00 unextended sp=0x0000700002121f00, fp=0x0000000000000000, real_fp=0x0000700002121f30, pc=0x000000011bad5944)
nmethod 1714 154 4 java.lang.String::indexOf (29 bytes)
Virtual frames (innermost first):
0 - (0x00007f9b9ff91038) - ifge @ bci 13
1 - (0x00007f9b9ff923a0) - invokestatic @ bci 13
Created vframeArray 0x00007f9ba280a820
DEOPT UNPACKING thread 0x00007f9b9b008a20 vframeArray 0x00007f9ba280a820 mode 2
{method} {0x000000012d00b8c8} 'indexOf' '(II)I' in 'java/lang/String' - invokestatic @ bci 13 sp = 0x0000700002121eb8
Expressions size: 0
Locals size: 3
[1. Interpreted Frame]
[...]
I have put it for separating the DEOPT PACKING
, DEOPT UNPACKING
and SAVED OOP RESULT
blocks for readability reasons. But I don't mind removing it, if a compact log is preferred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel strongly about it but I think -XX:+TraceDeoptimization -XX:-PrintDeoptimizationDetails
has never printed blank lines. However, this is primarily for human consumption so it's fine to leave as you have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good.
@tobiasholenstein 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:
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 203 new commits pushed to the
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 (@dougxc, @vnkozlov, @tkrodriguez, @TobiHartmann) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Thanks for cleaning this up. I think a one or two things should be moved under PrintDeoptimizationDetails for consistency but I wanted to look more closely at the output before adding my comments. I'll have some comments up soon. |
Sure I will wait for your comment. (It could make sense to move some parts to Note: |
We can convert JDK-8278329 into a RFE if we need to. Creating yet another bug just complicates things. For debugging output the distinction between a bug and an RFE is pretty small anyway. The first thing I notice that in a release build we get
In fastdebug we get output like:
so I think the code is using a print function that doesn't exist in product. That said I don't think that line of output is helpful since it reiterates the information in the trap or packing messages, so I'd be inclined to delete it.
The
|
I have cleaned up the output of
A
and like this in
@tkrodriguez does that look like what you had in mind? |
Yes that output looks great to me. Thank you for taking the time to do this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, looks good to me. Just found some minor style issues.
if (TraceDeoptimization) { | ||
ResourceMark rm; | ||
stringStream st; | ||
//st.print_cr("DEOPT PACKING thread " INTPTR_FORMAT " ", p2i(thread)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed.
st.print(" bci=%d pc=" INTPTR_FORMAT ", relative_pc=" INTPTR_FORMAT JVMCI_ONLY(", debug_id=%d"), trap_scope->bci(), p2i(fr.pc()), fr.pc() - nm->code_begin() | ||
#if INCLUDE_JVMCI | ||
, debug_id | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use JVMCI_ONLY
here as well. Same in line 1840.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, because of the comma and the way JVMCI_ONLY is defined, this does not work. I will leave it as it is
ResourceMark rm; | ||
stringStream st; | ||
st.print_cr("DEOPT UNPACKING thread=" INTPTR_FORMAT " vframeArray=" INTPTR_FORMAT " mode=%d", | ||
p2i(current), p2i(this), exec_mode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation of line 586 is off-by-one.
@tkrodriguez , @dougxc , @vnkozlov and @TobiHartmann Thanks for the inputs and the reviews! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for changing. Looks good!
Mailing list message from David Holmes on hotspot-dev: Hi Tobias, On 7/01/2022 8:56 pm, Tobias Holenstein wrote:
We have the COMMA macro to solve that problem e.g. ./share/runtime/threadSMR.inline.hpp: DEBUG_ONLY(COMMA _list(list)) Cheers, |
Ok, I didn't know that. I changed it now to DEBUG_ONLY(COMMA ...) Thanks David!
|
/integrate |
@tobiasholenstein |
/sponsor |
Going to push as commit 1f101b0.
Your commit was automatically rebased without conflicts. |
@TobiHartmann @tobiasholenstein Pushed as commit 1f101b0. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
After "JDK-8154011: Make
TraceDeoptimization
a diagnostic flag" some code was not included in the PRODUCT build.Removed all the #ifndef PRODUCT guards around
TraceDeoptimization
checks and made sure to be consistent.The DEOPT PACKING messages were controlled by
PrintDeoptimizationDetails
(develop flag), but DEOPT UNPACKING is controlled byTraceDeoptimization
(product flag),. Therefore changed DEOPT PACKING messages to be controlled byTraceDeoptimization
as well.Checked that tests are not affected. Checked on Aurora that performance is not affected.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6746/head:pull/6746
$ git checkout pull/6746
Update a local copy of the PR:
$ git checkout pull/6746
$ git pull https://git.openjdk.java.net/jdk pull/6746/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6746
View PR using the GUI difftool:
$ git pr show -t 6746
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6746.diff