RFR: 8284849: Add deoptimization to unified logging
Johan Sjölén
duke at openjdk.java.net
Tue May 24 14:03:38 UTC 2022
On Fri, 20 May 2022 16:40:05 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> Thanks for looking at this!
>
> I suggest trying to match the style of the `-Xlog:jit+compilation=debug` messages, since deoptimization is like the dual of compilation. And trying to keep the output on a single line (less output makes it easier to sift through lengthy logs).
>
> Rather than printing the compiler name, I think printing the compilation level is more useful, as well as including some info about whether it was an osr compilation maybe. The `jit+compilation` log messages do the latter by printing an extra `%`.
>
> Maybe something like:
>
> ```
> <compile id> <is osr> <compile level> <method signature> @ <bci> <reason> -> <action>
> ```
>
> The instruction and line number could also be incorporated somewhere, but the compilation messages don't have them either. They seem fine to leave out I think. (not all class files have useful line numbers, and the bci should be enough to find the bytecode source of the deopt, and from that the instruction).
I'm not sure whether we can know if something was an OCR compilation or not. This is how jit+compilation does it:
// CompileTask::print_compilation
void CompileTask::print(outputStream* st, const char* msg, bool short_form, bool cr) {
bool is_osr_method = osr_bci() != InvocationEntryBci;
print_impl(st, is_unloaded() ? NULL : method(), compile_id(), comp_level(), is_osr_method, osr_bci(), is_blocking(), msg, short_form, cr, _time_queued, _time_started);
}
I don't think we have a `CompileTask` to look at. Other than that, I'm completely up for changing this to a single log line with a similar format to the one you suggested.
>
> Also, I noticed that `jit+compilation` has the `debug` level, so maybe this log message should be under the `debug` level as well, instead of `info`. I don't know if there is any guidance on that somewhere.
There's some guidance in the JEP, basically `debug` is allowed to be a bit more computationally intensive than `info`. I think it sounds good to move it to `info`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8812
More information about the hotspot-dev
mailing list