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

David Holmes dholmes at openjdk.org
Mon Jun 3 08:33:06 UTC 2024


On Mon, 3 Jun 2024 06:08:37 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

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

I'm getting confused.

The ProfileClassLinkage flag should control whether the counters are initialized and used.

The -Xlog:init (perhaps with a better name/tag!) should control whether they get printed - in theory you could chose to print under any logging setting.

I don't think either flag should imply/force the setting of the other.

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

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


More information about the hotspot-dev mailing list