RFR: 8330198: Add some class loading related perf counters to measure VM startup [v2]
Ioi Lam
iklam at openjdk.org
Fri May 10 23:07:06 UTC 2024
On Fri, 10 May 2024 00:56:35 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> Adding a few perf counters related to class loading to measure VM startup. The counters are only active if the user specifies `-Xlog:init` in the command line. A diagnostic flag `ProfileClassLinkage` is added to control the new counters. The flag is set to false by default and will be enabled if `-Xlog:init` is specified.
>>
>> This change is already in the leyden/premain branch. There are more counters in the branch to measure other stuff. For now, just upstreaming class loader related counters.
>>
>> Refer to the [comment](https://bugs.openjdk.org/browse/JDK-8330198?focusedId=14665311&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14665311) in the bug report for an example output.
>>
>> Passed tiers 1 - 4 testing.
>
> Calvin Cheung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
>
> - Merge branch 'master' into xloginit-classloading
> - fix build issues on macos-x64 and -aarch64
> - Merge branch 'master' into xloginit-classloading
> - fix linux-x86 and minimal build issues
> - 8330198: Add some class loading related perf counters to measure VM startup
src/hotspot/share/runtime/java.cpp line 245:
> 243: #else
> 244:
> 245: void print_method_invocation_histogram() {}
Is this change necessary?
src/hotspot/share/runtime/perfData.hpp line 420:
> 418: inline void inc(jlong val) { (*(jlong*)_valuep) += val; }
> 419: inline void dec(jlong val) { inc(-val); }
> 420: inline void reset() { (*(jlong*)_valuep) = 0; }
This new function doesn't seem to be used.
src/hotspot/share/runtime/perfData.hpp line 835:
> 833: public:
> 834: inline PerfTraceTime(PerfLongCounter* timerp, bool is_on = true) : _timerp(timerp) {
> 835: if (!is_on || !UsePerfData) return;
Instead of having a separate `is_on` parameter, can we check for `timerp == nullptr1` instead?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18790#discussion_r1597288341
PR Review Comment: https://git.openjdk.org/jdk/pull/18790#discussion_r1597289948
PR Review Comment: https://git.openjdk.org/jdk/pull/18790#discussion_r1597289730
More information about the hotspot-dev
mailing list