RFR: 8330198: Add some class loading related perf counters to measure VM startup [v3]

Calvin Cheung ccheung at openjdk.org
Mon Jun 3 06:11:16 UTC 2024


On Sat, 1 Jun 2024 05:51:03 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> I've modified the fix so that the user needs to specify both `-Xlog:init` and `-XX:+ProfileClassLinkage` for the counters to be printed.
>
> IMO a dedicated flag (`ProfileClassLinkage`) is well-justified here. `-Xlog:init` prints some data which is not collected by default. So, if a user explicitly specifies `-Xlog:init`, the expectation is JVM automatically enables relevant profiling logic. There's no need to require a user to explicitly specify another flag. 
> 
> (The main reason the data is not collected by default, unlike most of PerfData counters, is because Calvin spotted some negative effects on startup when profiling is turned on.)
> 
> Speaking of the extra flag itself, it can be achieved solely by consulting whether `-Xlog:init` is enabled or not (replace `ProfileClassLinkage` with `log_is_enabled(Info, init)` checks). But I find it clearer and more convenient to control profiling logic with a dedicated flag. As a bonus, it fits nicely with the rest of PerfData framework: when `-XX:+ProfileClassLinkage` is specified w/o `-Xlog:init`, it is still possible to dump the data using external tools (jcmd and jstat).

Thanks @iwanowww for charming in.
I've changed `arguments.cpp` back to the first version.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18790#discussion_r1623827552


More information about the hotspot-dev mailing list