RFR: 8330198: Add some class loading related perf counters to measure VM startup [v3]
Calvin Cheung
ccheung at openjdk.org
Wed Jun 5 19:11:57 UTC 2024
On Wed, 5 Jun 2024 04:41:22 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>>> > The -Xlog:init (perhaps with a better name/tag!)
>>>
>>
>> How about `-Xlog:initcounters` as the name/tag? It is similar to @dholmes-ora 's suggestion above without the underscore between "init" and "counters". Currently, none of the logging tag contains an underscore character.
>>
>> @iwanowww, @iklam, @dholmes-ora, what do you guys think?
>
> While these counters are useful for start-up measurement, they can be used for other purposes (e.g., monitoring how much time is spend in linking classes in a long running application). So I think the logging tag should be more neutral.
>
> We already have `-Xlog:perf`. Maybe we can have sub options like `-Xlog:perf+class+link` for the counters in this PR?
>
> I know an upcoming PR will be for stats for MutexLocker. Something like `-Xlog:perf+lock` would work for such stats.
The above suggestion is fine with me. The `perf` tag is pre-existence, I noticed that if I specified `-Xlog:perf*`, the following log output appeared:
[0.002s][info][perf,memops] Trying to open /tmp/...
[0.003s][info][perf,memops] Successfully opened
It is probably ok if there are not too many of the above log output.
I've made the following changes and will push another commit after some testing:
- added the `link` logging tag; both `perf` and `class` tags already there;
- removed the `ProfileClassLinkage` diagnostics flag;
- added a global bool variable `_perf_class_link` in arguments.hpp;
it will be set to true if `-Xlog:perf+class+link` is specified. I think it is more efficient to check `Argument::perf_class_link()` vs `log_is_enabled(Info, perf, class, link)`
- changed the check for `log_is_enabled(Info, init)` to `log_is_enabled(Info, perf, class, link)`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18790#discussion_r1628306814
More information about the hotspot-dev
mailing list