RFR: 8330198: Add some class loading related perf counters to measure VM startup [v3]
Calvin Cheung
ccheung at openjdk.org
Wed May 29 05:05:06 UTC 2024
On Mon, 27 May 2024 04:26:16 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> 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.
We are planning to add more diagnostic flags to control different sets of counters. With the current design, the user just needs to specify `-Xlog:init` to enable all the "new" counters. If the `init` logging is enabled by individual flag, the user needs to enable individual flag in the command line.
Anyway, I think the follow would achieve what you are alluding to?
if (FLAG_IS_CMDLINE(ProfileClassLinkage) && !log_is_enabled(Info, init)) {
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(init));
}
I think it's better to keep the current change.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18790#discussion_r1618180989
More information about the hotspot-dev
mailing list