RFR: 8255746: Make PrintCompilation available on a per method level

Vladimir Kozlov kvn at openjdk.org
Wed Oct 12 17:20:07 UTC 2022


On Wed, 12 Oct 2022 15:28:16 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> I've kept it this way because the timer was started after printing prior to this change as well. If a dev is benchmarking compilation time, it is better to not include the timer. Printing adds noise that is not there during real-world runs.
>
> Okay, I don't have a strong opinion about it. In the old code, we somehow did it in-between: We printed UL, then with `PrintCompilation`, then started the timer and then printed to `CompilationLog::log()`. So, I'm not sure what the original intention was. Maybe someone else can comment on that, too.

`elapsedTimer time;` just declares variable. `TraceTime` uses it (with start/stop) later to accumulate time.
So declaration can be placed anywhere before JVMCI code below.

But I think you should be more flexible here. Consider the case when you hit `assert` at the line 2120. Before this change you will see `PrintCompilation` line, with change - you do not. Of cause in hs_err file you will see it because you did not move `log_compile`.  I understand that you need to check directive. I would suggest to keep global `PrintCompilation` code and add variable to mark that line is already printed. Then check it in you code which checks directive to avoid duplicate.

-------------

PR: https://git.openjdk.org/jdk/pull/10668


More information about the hotspot-compiler-dev mailing list