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

David Holmes dholmes at openjdk.org
Tue Jun 4 05:17:05 UTC 2024


On Tue, 4 Jun 2024 03:47:19 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> It's about usability. `-Xlog:init` means "I want to see logs related to initialization", so it should enable all the counters for printing the related logs. We may add several groups of counters in the future. We don't want to force the user to enumerate all these counters like:
>> 
>> 
>> java -Xlog:init -XX:+ ProfileClassLinkage -XX:+ProfileAAA  -XX:+ProfileBBB ....
>> 
>> 
>> Also,  `-Xlog:init` doesn't force the all the counters to be used. It just changes the default value of the selection:
>> 
>> 
>>   if (log_is_enabled(Info, init)) {
>>     FLAG_SET_ERGO_IF_DEFAULT(ProfileClassLinkage, true);
>>     FLAG_SET_ERGO_IF_DEFAULT(ProfileAAA, true);
>>     FLAG_SET_ERGO_IF_DEFAULT(ProfileBBB, true);
>>   }
>> 
>> 
>> The user could disable certain counters by:
>> 
>> 
>> java -Xlog:init  -XX:-ProfileAAA
>
>> The -Xlog:init (perhaps with a better name/tag!)
> 
> I'm all for a better naming scheme. Any suggestions?

> -Xlog:init means "I want to see logs related to initialization", so it should enable all the counters for printing the related logs. 

I don't agree. Initialization logging could encompass many different things, some of which are individually controllable via different flags. Simply turning on init logging should not turn on all such flags. If you want that level of coupling then perhaps use init_counters (or something like that) to make it clear this is not a general log tag intended for any initialization code to use, but something you have chosen to tie to specific functionality.

> We may add several groups of counters in the future. We don't want to force the user to enumerate all these counters

It is not clear to me how you envisage that working. You want individual group switches plus a global one?

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

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


More information about the hotspot-dev mailing list