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

David Holmes dholmes at openjdk.org
Mon May 27 05:29:12 UTC 2024


On Fri, 24 May 2024 05:21:36 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> src/hotspot/share/runtime/arguments.cpp line 3759:
>> 
>>> 3757:   if (log_is_enabled(Info, init)) {
>>> 3758:      FLAG_SET_ERGO_IF_DEFAULT(ProfileClassLinkage, true);
>>> 3759:   }
>> 
>> What if ProfileClassLinkage is set true on the command-line without -Xlog:init? That doesn't seem to make sense to me. So I'm not clear why it is a settable diagnostic flag.
>
> If only `ProfileClassLinkage` is set to true without `-Xlog:init`, the user will not see any counters output.
> In `java.cpp`:
> 
> 160 void log_vm_init_stats() {
> 161   LogStreamHandle(Info, init) log;
> 162   if (log.is_enabled()) {
> 163     ClassLoader::print_counters();
> 164   }
> 165 }
> 
> 
> In the future, there will be other sets of counters controlled by other diagnostic flags.

Yeah I'm not really getting the control aspects here. If I turn on logging I should not get these new counters unless I explicitly ask for them - simply turning on the logging should not set `ProfileClassLinkage` IMO. But enabling `ProfileClassLinkage` should turn on `init` logging, else it serves no purpose.

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

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


More information about the hotspot-dev mailing list